/******/ (function(modules) { // webpackBootstrap
/******/ 	function hotDisposeChunk(chunkId) {
/******/ 		delete installedChunks[chunkId];
/******/ 	}
/******/ 	var parentHotUpdateCallback = this["webpackHotUpdate"];
/******/ 	this["webpackHotUpdate"] = 
/******/ 	function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
/******/ 		hotAddUpdateChunk(chunkId, moreModules);
/******/ 		if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
/******/ 	} ;
/******/ 	
/******/ 	function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
/******/ 		var head = document.getElementsByTagName("head")[0];
/******/ 		var script = document.createElement("script");
/******/ 		script.type = "text/javascript";
/******/ 		script.charset = "utf-8";
/******/ 		script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js";
/******/ 		head.appendChild(script);
/******/ 	}
/******/ 	
/******/ 	function hotDownloadManifest() { // eslint-disable-line no-unused-vars
/******/ 		return new Promise(function(resolve, reject) {
/******/ 			if(typeof XMLHttpRequest === "undefined")
/******/ 				return reject(new Error("No browser support"));
/******/ 			try {
/******/ 				var request = new XMLHttpRequest();
/******/ 				var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json";
/******/ 				request.open("GET", requestPath, true);
/******/ 				request.timeout = 10000;
/******/ 				request.send(null);
/******/ 			} catch(err) {
/******/ 				return reject(err);
/******/ 			}
/******/ 			request.onreadystatechange = function() {
/******/ 				if(request.readyState !== 4) return;
/******/ 				if(request.status === 0) {
/******/ 					// timeout
/******/ 					reject(new Error("Manifest request to " + requestPath + " timed out."));
/******/ 				} else if(request.status === 404) {
/******/ 					// no update available
/******/ 					resolve();
/******/ 				} else if(request.status !== 200 && request.status !== 304) {
/******/ 					// other failure
/******/ 					reject(new Error("Manifest request to " + requestPath + " failed."));
/******/ 				} else {
/******/ 					// success
/******/ 					try {
/******/ 						var update = JSON.parse(request.responseText);
/******/ 					} catch(e) {
/******/ 						reject(e);
/******/ 						return;
/******/ 					}
/******/ 					resolve(update);
/******/ 				}
/******/ 			};
/******/ 		});
/******/ 	}
/******/
/******/ 	
/******/ 	
/******/ 	var hotApplyOnUpdate = true;
/******/ 	var hotCurrentHash = "0854a8ffa33ed3856bff"; // eslint-disable-line no-unused-vars
/******/ 	var hotCurrentModuleData = {};
/******/ 	var hotCurrentChildModule; // eslint-disable-line no-unused-vars
/******/ 	var hotCurrentParents = []; // eslint-disable-line no-unused-vars
/******/ 	var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars
/******/ 	
/******/ 	function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars
/******/ 		var me = installedModules[moduleId];
/******/ 		if(!me) return __webpack_require__;
/******/ 		var fn = function(request) {
/******/ 			if(me.hot.active) {
/******/ 				if(installedModules[request]) {
/******/ 					if(installedModules[request].parents.indexOf(moduleId) < 0)
/******/ 						installedModules[request].parents.push(moduleId);
/******/ 				} else {
/******/ 					hotCurrentParents = [moduleId];
/******/ 					hotCurrentChildModule = request;
/******/ 				}
/******/ 				if(me.children.indexOf(request) < 0)
/******/ 					me.children.push(request);
/******/ 			} else {
/******/ 				console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
/******/ 				hotCurrentParents = [];
/******/ 			}
/******/ 			return __webpack_require__(request);
/******/ 		};
/******/ 		var ObjectFactory = function ObjectFactory(name) {
/******/ 			return {
/******/ 				configurable: true,
/******/ 				enumerable: true,
/******/ 				get: function() {
/******/ 					return __webpack_require__[name];
/******/ 				},
/******/ 				set: function(value) {
/******/ 					__webpack_require__[name] = value;
/******/ 				}
/******/ 			};
/******/ 		};
/******/ 		for(var name in __webpack_require__) {
/******/ 			if(Object.prototype.hasOwnProperty.call(__webpack_require__, name) && name !== "e") {
/******/ 				Object.defineProperty(fn, name, ObjectFactory(name));
/******/ 			}
/******/ 		}
/******/ 		fn.e = function(chunkId) {
/******/ 			if(hotStatus === "ready")
/******/ 				hotSetStatus("prepare");
/******/ 			hotChunksLoading++;
/******/ 			return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {
/******/ 				finishChunkLoading();
/******/ 				throw err;
/******/ 			});
/******/ 	
/******/ 			function finishChunkLoading() {
/******/ 				hotChunksLoading--;
/******/ 				if(hotStatus === "prepare") {
/******/ 					if(!hotWaitingFilesMap[chunkId]) {
/******/ 						hotEnsureUpdateChunk(chunkId);
/******/ 					}
/******/ 					if(hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ 						hotUpdateDownloaded();
/******/ 					}
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 		return fn;
/******/ 	}
/******/ 	
/******/ 	function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars
/******/ 		var hot = {
/******/ 			// private stuff
/******/ 			_acceptedDependencies: {},
/******/ 			_declinedDependencies: {},
/******/ 			_selfAccepted: false,
/******/ 			_selfDeclined: false,
/******/ 			_disposeHandlers: [],
/******/ 			_main: hotCurrentChildModule !== moduleId,
/******/ 	
/******/ 			// Module API
/******/ 			active: true,
/******/ 			accept: function(dep, callback) {
/******/ 				if(typeof dep === "undefined")
/******/ 					hot._selfAccepted = true;
/******/ 				else if(typeof dep === "function")
/******/ 					hot._selfAccepted = dep;
/******/ 				else if(typeof dep === "object")
/******/ 					for(var i = 0; i < dep.length; i++)
/******/ 						hot._acceptedDependencies[dep[i]] = callback || function() {};
/******/ 				else
/******/ 					hot._acceptedDependencies[dep] = callback || function() {};
/******/ 			},
/******/ 			decline: function(dep) {
/******/ 				if(typeof dep === "undefined")
/******/ 					hot._selfDeclined = true;
/******/ 				else if(typeof dep === "object")
/******/ 					for(var i = 0; i < dep.length; i++)
/******/ 						hot._declinedDependencies[dep[i]] = true;
/******/ 				else
/******/ 					hot._declinedDependencies[dep] = true;
/******/ 			},
/******/ 			dispose: function(callback) {
/******/ 				hot._disposeHandlers.push(callback);
/******/ 			},
/******/ 			addDisposeHandler: function(callback) {
/******/ 				hot._disposeHandlers.push(callback);
/******/ 			},
/******/ 			removeDisposeHandler: function(callback) {
/******/ 				var idx = hot._disposeHandlers.indexOf(callback);
/******/ 				if(idx >= 0) hot._disposeHandlers.splice(idx, 1);
/******/ 			},
/******/ 	
/******/ 			// Management API
/******/ 			check: hotCheck,
/******/ 			apply: hotApply,
/******/ 			status: function(l) {
/******/ 				if(!l) return hotStatus;
/******/ 				hotStatusHandlers.push(l);
/******/ 			},
/******/ 			addStatusHandler: function(l) {
/******/ 				hotStatusHandlers.push(l);
/******/ 			},
/******/ 			removeStatusHandler: function(l) {
/******/ 				var idx = hotStatusHandlers.indexOf(l);
/******/ 				if(idx >= 0) hotStatusHandlers.splice(idx, 1);
/******/ 			},
/******/ 	
/******/ 			//inherit from previous dispose call
/******/ 			data: hotCurrentModuleData[moduleId]
/******/ 		};
/******/ 		hotCurrentChildModule = undefined;
/******/ 		return hot;
/******/ 	}
/******/ 	
/******/ 	var hotStatusHandlers = [];
/******/ 	var hotStatus = "idle";
/******/ 	
/******/ 	function hotSetStatus(newStatus) {
/******/ 		hotStatus = newStatus;
/******/ 		for(var i = 0; i < hotStatusHandlers.length; i++)
/******/ 			hotStatusHandlers[i].call(null, newStatus);
/******/ 	}
/******/ 	
/******/ 	// while downloading
/******/ 	var hotWaitingFiles = 0;
/******/ 	var hotChunksLoading = 0;
/******/ 	var hotWaitingFilesMap = {};
/******/ 	var hotRequestedFilesMap = {};
/******/ 	var hotAvailableFilesMap = {};
/******/ 	var hotDeferred;
/******/ 	
/******/ 	// The update info
/******/ 	var hotUpdate, hotUpdateNewHash;
/******/ 	
/******/ 	function toModuleId(id) {
/******/ 		var isNumber = (+id) + "" === id;
/******/ 		return isNumber ? +id : id;
/******/ 	}
/******/ 	
/******/ 	function hotCheck(apply) {
/******/ 		if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status");
/******/ 		hotApplyOnUpdate = apply;
/******/ 		hotSetStatus("check");
/******/ 		return hotDownloadManifest().then(function(update) {
/******/ 			if(!update) {
/******/ 				hotSetStatus("idle");
/******/ 				return null;
/******/ 			}
/******/ 			hotRequestedFilesMap = {};
/******/ 			hotWaitingFilesMap = {};
/******/ 			hotAvailableFilesMap = update.c;
/******/ 			hotUpdateNewHash = update.h;
/******/ 	
/******/ 			hotSetStatus("prepare");
/******/ 			var promise = new Promise(function(resolve, reject) {
/******/ 				hotDeferred = {
/******/ 					resolve: resolve,
/******/ 					reject: reject
/******/ 				};
/******/ 			});
/******/ 			hotUpdate = {};
/******/ 			var chunkId = 0;
/******/ 			{ // eslint-disable-line no-lone-blocks
/******/ 				/*globals chunkId */
/******/ 				hotEnsureUpdateChunk(chunkId);
/******/ 			}
/******/ 			if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ 				hotUpdateDownloaded();
/******/ 			}
/******/ 			return promise;
/******/ 		});
/******/ 	}
/******/ 	
/******/ 	function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars
/******/ 		if(!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
/******/ 			return;
/******/ 		hotRequestedFilesMap[chunkId] = false;
/******/ 		for(var moduleId in moreModules) {
/******/ 			if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ 				hotUpdate[moduleId] = moreModules[moduleId];
/******/ 			}
/******/ 		}
/******/ 		if(--hotWaitingFiles === 0 && hotChunksLoading === 0) {
/******/ 			hotUpdateDownloaded();
/******/ 		}
/******/ 	}
/******/ 	
/******/ 	function hotEnsureUpdateChunk(chunkId) {
/******/ 		if(!hotAvailableFilesMap[chunkId]) {
/******/ 			hotWaitingFilesMap[chunkId] = true;
/******/ 		} else {
/******/ 			hotRequestedFilesMap[chunkId] = true;
/******/ 			hotWaitingFiles++;
/******/ 			hotDownloadUpdateChunk(chunkId);
/******/ 		}
/******/ 	}
/******/ 	
/******/ 	function hotUpdateDownloaded() {
/******/ 		hotSetStatus("ready");
/******/ 		var deferred = hotDeferred;
/******/ 		hotDeferred = null;
/******/ 		if(!deferred) return;
/******/ 		if(hotApplyOnUpdate) {
/******/ 			hotApply(hotApplyOnUpdate).then(function(result) {
/******/ 				deferred.resolve(result);
/******/ 			}, function(err) {
/******/ 				deferred.reject(err);
/******/ 			});
/******/ 		} else {
/******/ 			var outdatedModules = [];
/******/ 			for(var id in hotUpdate) {
/******/ 				if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
/******/ 					outdatedModules.push(toModuleId(id));
/******/ 				}
/******/ 			}
/******/ 			deferred.resolve(outdatedModules);
/******/ 		}
/******/ 	}
/******/ 	
/******/ 	function hotApply(options) {
/******/ 		if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status");
/******/ 		options = options || {};
/******/ 	
/******/ 		var cb;
/******/ 		var i;
/******/ 		var j;
/******/ 		var module;
/******/ 		var moduleId;
/******/ 	
/******/ 		function getAffectedStuff(updateModuleId) {
/******/ 			var outdatedModules = [updateModuleId];
/******/ 			var outdatedDependencies = {};
/******/ 	
/******/ 			var queue = outdatedModules.slice().map(function(id) {
/******/ 				return {
/******/ 					chain: [id],
/******/ 					id: id
/******/ 				};
/******/ 			});
/******/ 			while(queue.length > 0) {
/******/ 				var queueItem = queue.pop();
/******/ 				var moduleId = queueItem.id;
/******/ 				var chain = queueItem.chain;
/******/ 				module = installedModules[moduleId];
/******/ 				if(!module || module.hot._selfAccepted)
/******/ 					continue;
/******/ 				if(module.hot._selfDeclined) {
/******/ 					return {
/******/ 						type: "self-declined",
/******/ 						chain: chain,
/******/ 						moduleId: moduleId
/******/ 					};
/******/ 				}
/******/ 				if(module.hot._main) {
/******/ 					return {
/******/ 						type: "unaccepted",
/******/ 						chain: chain,
/******/ 						moduleId: moduleId
/******/ 					};
/******/ 				}
/******/ 				for(var i = 0; i < module.parents.length; i++) {
/******/ 					var parentId = module.parents[i];
/******/ 					var parent = installedModules[parentId];
/******/ 					if(!parent) continue;
/******/ 					if(parent.hot._declinedDependencies[moduleId]) {
/******/ 						return {
/******/ 							type: "declined",
/******/ 							chain: chain.concat([parentId]),
/******/ 							moduleId: moduleId,
/******/ 							parentId: parentId
/******/ 						};
/******/ 					}
/******/ 					if(outdatedModules.indexOf(parentId) >= 0) continue;
/******/ 					if(parent.hot._acceptedDependencies[moduleId]) {
/******/ 						if(!outdatedDependencies[parentId])
/******/ 							outdatedDependencies[parentId] = [];
/******/ 						addAllToSet(outdatedDependencies[parentId], [moduleId]);
/******/ 						continue;
/******/ 					}
/******/ 					delete outdatedDependencies[parentId];
/******/ 					outdatedModules.push(parentId);
/******/ 					queue.push({
/******/ 						chain: chain.concat([parentId]),
/******/ 						id: parentId
/******/ 					});
/******/ 				}
/******/ 			}
/******/ 	
/******/ 			return {
/******/ 				type: "accepted",
/******/ 				moduleId: updateModuleId,
/******/ 				outdatedModules: outdatedModules,
/******/ 				outdatedDependencies: outdatedDependencies
/******/ 			};
/******/ 		}
/******/ 	
/******/ 		function addAllToSet(a, b) {
/******/ 			for(var i = 0; i < b.length; i++) {
/******/ 				var item = b[i];
/******/ 				if(a.indexOf(item) < 0)
/******/ 					a.push(item);
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// at begin all updates modules are outdated
/******/ 		// the "outdated" status can propagate to parents if they don't accept the children
/******/ 		var outdatedDependencies = {};
/******/ 		var outdatedModules = [];
/******/ 		var appliedUpdate = {};
/******/ 	
/******/ 		var warnUnexpectedRequire = function warnUnexpectedRequire() {
/******/ 			console.warn("[HMR] unexpected require(" + result.moduleId + ") to disposed module");
/******/ 		};
/******/ 	
/******/ 		for(var id in hotUpdate) {
/******/ 			if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
/******/ 				moduleId = toModuleId(id);
/******/ 				var result;
/******/ 				if(hotUpdate[id]) {
/******/ 					result = getAffectedStuff(moduleId);
/******/ 				} else {
/******/ 					result = {
/******/ 						type: "disposed",
/******/ 						moduleId: id
/******/ 					};
/******/ 				}
/******/ 				var abortError = false;
/******/ 				var doApply = false;
/******/ 				var doDispose = false;
/******/ 				var chainInfo = "";
/******/ 				if(result.chain) {
/******/ 					chainInfo = "\nUpdate propagation: " + result.chain.join(" -> ");
/******/ 				}
/******/ 				switch(result.type) {
/******/ 					case "self-declined":
/******/ 						if(options.onDeclined)
/******/ 							options.onDeclined(result);
/******/ 						if(!options.ignoreDeclined)
/******/ 							abortError = new Error("Aborted because of self decline: " + result.moduleId + chainInfo);
/******/ 						break;
/******/ 					case "declined":
/******/ 						if(options.onDeclined)
/******/ 							options.onDeclined(result);
/******/ 						if(!options.ignoreDeclined)
/******/ 							abortError = new Error("Aborted because of declined dependency: " + result.moduleId + " in " + result.parentId + chainInfo);
/******/ 						break;
/******/ 					case "unaccepted":
/******/ 						if(options.onUnaccepted)
/******/ 							options.onUnaccepted(result);
/******/ 						if(!options.ignoreUnaccepted)
/******/ 							abortError = new Error("Aborted because " + moduleId + " is not accepted" + chainInfo);
/******/ 						break;
/******/ 					case "accepted":
/******/ 						if(options.onAccepted)
/******/ 							options.onAccepted(result);
/******/ 						doApply = true;
/******/ 						break;
/******/ 					case "disposed":
/******/ 						if(options.onDisposed)
/******/ 							options.onDisposed(result);
/******/ 						doDispose = true;
/******/ 						break;
/******/ 					default:
/******/ 						throw new Error("Unexception type " + result.type);
/******/ 				}
/******/ 				if(abortError) {
/******/ 					hotSetStatus("abort");
/******/ 					return Promise.reject(abortError);
/******/ 				}
/******/ 				if(doApply) {
/******/ 					appliedUpdate[moduleId] = hotUpdate[moduleId];
/******/ 					addAllToSet(outdatedModules, result.outdatedModules);
/******/ 					for(moduleId in result.outdatedDependencies) {
/******/ 						if(Object.prototype.hasOwnProperty.call(result.outdatedDependencies, moduleId)) {
/******/ 							if(!outdatedDependencies[moduleId])
/******/ 								outdatedDependencies[moduleId] = [];
/******/ 							addAllToSet(outdatedDependencies[moduleId], result.outdatedDependencies[moduleId]);
/******/ 						}
/******/ 					}
/******/ 				}
/******/ 				if(doDispose) {
/******/ 					addAllToSet(outdatedModules, [result.moduleId]);
/******/ 					appliedUpdate[moduleId] = warnUnexpectedRequire;
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// Store self accepted outdated modules to require them later by the module system
/******/ 		var outdatedSelfAcceptedModules = [];
/******/ 		for(i = 0; i < outdatedModules.length; i++) {
/******/ 			moduleId = outdatedModules[i];
/******/ 			if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted)
/******/ 				outdatedSelfAcceptedModules.push({
/******/ 					module: moduleId,
/******/ 					errorHandler: installedModules[moduleId].hot._selfAccepted
/******/ 				});
/******/ 		}
/******/ 	
/******/ 		// Now in "dispose" phase
/******/ 		hotSetStatus("dispose");
/******/ 		Object.keys(hotAvailableFilesMap).forEach(function(chunkId) {
/******/ 			if(hotAvailableFilesMap[chunkId] === false) {
/******/ 				hotDisposeChunk(chunkId);
/******/ 			}
/******/ 		});
/******/ 	
/******/ 		var idx;
/******/ 		var queue = outdatedModules.slice();
/******/ 		while(queue.length > 0) {
/******/ 			moduleId = queue.pop();
/******/ 			module = installedModules[moduleId];
/******/ 			if(!module) continue;
/******/ 	
/******/ 			var data = {};
/******/ 	
/******/ 			// Call dispose handlers
/******/ 			var disposeHandlers = module.hot._disposeHandlers;
/******/ 			for(j = 0; j < disposeHandlers.length; j++) {
/******/ 				cb = disposeHandlers[j];
/******/ 				cb(data);
/******/ 			}
/******/ 			hotCurrentModuleData[moduleId] = data;
/******/ 	
/******/ 			// disable module (this disables requires from this module)
/******/ 			module.hot.active = false;
/******/ 	
/******/ 			// remove module from cache
/******/ 			delete installedModules[moduleId];
/******/ 	
/******/ 			// remove "parents" references from all children
/******/ 			for(j = 0; j < module.children.length; j++) {
/******/ 				var child = installedModules[module.children[j]];
/******/ 				if(!child) continue;
/******/ 				idx = child.parents.indexOf(moduleId);
/******/ 				if(idx >= 0) {
/******/ 					child.parents.splice(idx, 1);
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// remove outdated dependency from module children
/******/ 		var dependency;
/******/ 		var moduleOutdatedDependencies;
/******/ 		for(moduleId in outdatedDependencies) {
/******/ 			if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
/******/ 				module = installedModules[moduleId];
/******/ 				if(module) {
/******/ 					moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ 					for(j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ 						dependency = moduleOutdatedDependencies[j];
/******/ 						idx = module.children.indexOf(dependency);
/******/ 						if(idx >= 0) module.children.splice(idx, 1);
/******/ 					}
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// Not in "apply" phase
/******/ 		hotSetStatus("apply");
/******/ 	
/******/ 		hotCurrentHash = hotUpdateNewHash;
/******/ 	
/******/ 		// insert new code
/******/ 		for(moduleId in appliedUpdate) {
/******/ 			if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {
/******/ 				modules[moduleId] = appliedUpdate[moduleId];
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// call accept handlers
/******/ 		var error = null;
/******/ 		for(moduleId in outdatedDependencies) {
/******/ 			if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
/******/ 				module = installedModules[moduleId];
/******/ 				moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ 				var callbacks = [];
/******/ 				for(i = 0; i < moduleOutdatedDependencies.length; i++) {
/******/ 					dependency = moduleOutdatedDependencies[i];
/******/ 					cb = module.hot._acceptedDependencies[dependency];
/******/ 					if(callbacks.indexOf(cb) >= 0) continue;
/******/ 					callbacks.push(cb);
/******/ 				}
/******/ 				for(i = 0; i < callbacks.length; i++) {
/******/ 					cb = callbacks[i];
/******/ 					try {
/******/ 						cb(moduleOutdatedDependencies);
/******/ 					} catch(err) {
/******/ 						if(options.onErrored) {
/******/ 							options.onErrored({
/******/ 								type: "accept-errored",
/******/ 								moduleId: moduleId,
/******/ 								dependencyId: moduleOutdatedDependencies[i],
/******/ 								error: err
/******/ 							});
/******/ 						}
/******/ 						if(!options.ignoreErrored) {
/******/ 							if(!error)
/******/ 								error = err;
/******/ 						}
/******/ 					}
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// Load self accepted modules
/******/ 		for(i = 0; i < outdatedSelfAcceptedModules.length; i++) {
/******/ 			var item = outdatedSelfAcceptedModules[i];
/******/ 			moduleId = item.module;
/******/ 			hotCurrentParents = [moduleId];
/******/ 			try {
/******/ 				__webpack_require__(moduleId);
/******/ 			} catch(err) {
/******/ 				if(typeof item.errorHandler === "function") {
/******/ 					try {
/******/ 						item.errorHandler(err);
/******/ 					} catch(err2) {
/******/ 						if(options.onErrored) {
/******/ 							options.onErrored({
/******/ 								type: "self-accept-error-handler-errored",
/******/ 								moduleId: moduleId,
/******/ 								error: err2,
/******/ 								orginalError: err
/******/ 							});
/******/ 						}
/******/ 						if(!options.ignoreErrored) {
/******/ 							if(!error)
/******/ 								error = err2;
/******/ 						}
/******/ 						if(!error)
/******/ 							error = err;
/******/ 					}
/******/ 				} else {
/******/ 					if(options.onErrored) {
/******/ 						options.onErrored({
/******/ 							type: "self-accept-errored",
/******/ 							moduleId: moduleId,
/******/ 							error: err
/******/ 						});
/******/ 					}
/******/ 					if(!options.ignoreErrored) {
/******/ 						if(!error)
/******/ 							error = err;
/******/ 					}
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 	
/******/ 		// handle errors in accept handlers and self accepted module load
/******/ 		if(error) {
/******/ 			hotSetStatus("fail");
/******/ 			return Promise.reject(error);
/******/ 		}
/******/ 	
/******/ 		hotSetStatus("idle");
/******/ 		return Promise.resolve(outdatedModules);
/******/ 	}
/******/
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {},
/******/ 			hot: hotCreateModule(moduleId),
/******/ 			parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),
/******/ 			children: []
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmony imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "dist/";
/******/
/******/ 	// __webpack_hash__
/******/ 	__webpack_require__.h = function() { return hotCurrentHash; };
/******/
/******/ 	// Load entry module and return exports
/******/ 	return hotCreateRequire(1071)(__webpack_require__.s = 1071);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(3);

/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(0);

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(4);

/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__message_service__ = __webpack_require__(396);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component_messages__ = __webpack_require__(623);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__component_messages__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__localization_service__ = __webpack_require__(624);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__localization_service__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__localization_service__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl__ = __webpack_require__(625);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_3__rtl__["a"]; });






/***/ }),
/* 4 */
/***/ (function(module, exports) {

module.exports = vendor_bbc7e04c4fe4ad6edcff;

/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_append__ = __webpack_require__(720);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__util_append__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_arabic_to_roman__ = __webpack_require__(721);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return __WEBPACK_IMPORTED_MODULE_1__util_arabic_to_roman__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_create_promise__ = __webpack_require__(723);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__util_create_promise__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_defined__ = __webpack_require__(101);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_3__util_defined__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_definition_id__ = __webpack_require__(724);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_4__util_definition_id__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_deg__ = __webpack_require__(725);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_5__util_deg__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_encode_base64__ = __webpack_require__(728);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_6__util_encode_base64__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_event_coordinates__ = __webpack_require__(729);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return __WEBPACK_IMPORTED_MODULE_7__util_event_coordinates__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util_event_element__ = __webpack_require__(730);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return __WEBPACK_IMPORTED_MODULE_8__util_event_element__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_is_transparent__ = __webpack_require__(731);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return __WEBPACK_IMPORTED_MODULE_9__util_is_transparent__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_last__ = __webpack_require__(732);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return __WEBPACK_IMPORTED_MODULE_10__util_last__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__util_limit_value__ = __webpack_require__(733);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return __WEBPACK_IMPORTED_MODULE_11__util_limit_value__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__util_merge_sort__ = __webpack_require__(734);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return __WEBPACK_IMPORTED_MODULE_12__util_merge_sort__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__util_promise_all__ = __webpack_require__(735);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_13__util_promise_all__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__util_rad__ = __webpack_require__(736);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_14__util_rad__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__util_round__ = __webpack_require__(737);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_15__util_round__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__util_value_or_default__ = __webpack_require__(739);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return __WEBPACK_IMPORTED_MODULE_16__util_value_or_default__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__util_bind_events__ = __webpack_require__(722);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_17__util_bind_events__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__util_element_offset__ = __webpack_require__(726);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return __WEBPACK_IMPORTED_MODULE_18__util_element_offset__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__util_element_size__ = __webpack_require__(727);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_19__util_element_size__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__util_element_styles__ = __webpack_require__(457);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return __WEBPACK_IMPORTED_MODULE_20__util_element_styles__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__util_unbind_events__ = __webpack_require__(738);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_21__util_unbind_events__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__util_constants__ = __webpack_require__(229);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_22__util_constants__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_22__util_constants__["c"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__text_metrics__ = __webpack_require__(453);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "w", function() { return __WEBPACK_IMPORTED_MODULE_23__text_metrics__["b"]; });

























//# sourceMappingURL=util.js.map


/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(2);

/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isPresent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isBlank; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isTruthy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isNullOrEmptyString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isChanged; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return anyChanged; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return observe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isUniversal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return extractFormat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return not; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return or; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return and; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return Skip; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return guid; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_from__ = __webpack_require__(240);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_from___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_from__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_merge__ = __webpack_require__(104);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_merge__);




/**
 * @hidden
 */
var isPresent = function (value) { return value !== null && value !== undefined; };
/**
 * @hidden
 */
var isBlank = function (value) { return value === null || value === undefined; };
/**
 * @hidden
 */
var isArray = function (value) { return Array.isArray(value); };
/**
 * @hidden
 */
var isTruthy = function (value) { return !!value; };
/**
 * @hidden
 */
var isNullOrEmptyString = function (value) { return isBlank(value) || (value.trim && value.trim().length === 0); };
/**
 * @hidden
 */
var isChanged = function (propertyName, changes, skipFirstChange) {
    if (skipFirstChange === void 0) { skipFirstChange = true; }
    return (changes[propertyName] && (!changes[propertyName].isFirstChange() || !skipFirstChange) &&
        changes[propertyName].previousValue !== changes[propertyName].currentValue);
};
/**
 * @hidden
 */
var anyChanged = function (propertyNames, changes, skipFirstChange) {
    if (skipFirstChange === void 0) { skipFirstChange = true; }
    return propertyNames.some(function (name) { return isChanged(name, changes, skipFirstChange); });
};
/**
 * @hidden
 */
var observe = function (list) { return __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].from([list]).merge(list.changes); };
/**
 * @hidden
 */
var isUniversal = function () { return typeof document === 'undefined'; };
/**
 * @hidden
 */
var extractFormat = function (format) {
    if (!isNullOrEmptyString(format) && format.startsWith('{0:')) {
        return format.slice(3, format.length - 1);
    }
    return format;
};
/**
 * @hidden
 */
var not = function (fn) { return function () {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return !fn.apply(null, args);
}; };
/**
 * @hidden
 */
var or = function () {
    var conditions = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        conditions[_i] = arguments[_i];
    }
    return function (value) { return conditions.reduce(function (acc, x) { return x(value) || acc; }, false); };
};
/**
 * @hidden
 */
var and = function () {
    var conditions = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        conditions[_i] = arguments[_i];
    }
    return function (value) { return conditions.reduce(function (acc, x) { return x(value) && acc; }, true); };
};
/**
 * @hidden
 */
var Skip = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]("Skip"); // tslint:disable-line:variable-name
/**
 * @hidden
 */
// tslint:disable-line:variable-name
var guid = function () {
    var id = "";
    var i;
    var random;
    for (i = 0; i < 32; i++) {
        random = Math.random() * 16 | 0; // tslint:disable-line:no-bitwise
        if (i === 8 || i === 12 || i === 16 || i === 20) {
            id += "-";
        }
        // tslint:disable-next-line:no-bitwise
        id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
    }
    return id;
};


/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_animation_frame__ = __webpack_require__(678);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_0__common_animation_frame__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_class__ = __webpack_require__(137);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__common_class__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_html_encode__ = __webpack_require__(681);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2__common_html_encode__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_log_to_console__ = __webpack_require__(682);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_3__common_log_to_console__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_observable__ = __webpack_require__(683);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_4__common_observable__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_save_as__ = __webpack_require__(684);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_5__common_save_as__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_support__ = __webpack_require__(422);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_6__common_support__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common_template__ = __webpack_require__(685);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_7__common_template__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__common_throttle__ = __webpack_require__(686);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_8__common_throttle__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__common_color__ = __webpack_require__(679);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_9__common_color__["a"]; });













//# sourceMappingURL=common.js.map


/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(10);

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(12);

/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(7);

/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__intl_service__ = __webpack_require__(127);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__intl_service__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cldr_intl_service__ = __webpack_require__(393);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_1__cldr_intl_service__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__date_pipe__ = __webpack_require__(394);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__number_pipe__ = __webpack_require__(395);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__intl_module__ = __webpack_require__(622);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_4__intl_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__intl_members__ = __webpack_require__(126);
/* unused harmony namespace reexport */








/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(9);

/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return setTime; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return setHours; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMinutes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setSeconds; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return range; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return isInRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isInTimeRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isValidRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return dateInRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return timeInRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return getNow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return getToday; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return guid; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return noop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isDocumentAvailable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return stringifyClassObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return shiftWeekNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return approximateStringMatching; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return domContainerFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return hasChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return hasExistingValue; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaults__ = __webpack_require__(26);
/* tslint:disable:no-bitwise max-line-length */


var isSet = function (value) { return value !== null && value !== undefined; };
var setter = function (method) { return function (date, value) {
    var clone = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["a" /* cloneDate */])(date);
    clone[method](value);
    return clone;
}; };
/**
 * @hidden
 */
var setTime = function (origin, candidate) {
    var date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["a" /* cloneDate */])(origin);
    date.setHours(candidate.getHours(), candidate.getMinutes(), candidate.getSeconds(), candidate.getMilliseconds());
    return date;
};
var normalizeTimes = function (candidate, min, max) { return ({
    candidateValue: setTime(__WEBPACK_IMPORTED_MODULE_1__defaults__["a" /* MIDNIGHT_DATE */], candidate),
    maxValue: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["c" /* addDays */])(setTime(__WEBPACK_IMPORTED_MODULE_1__defaults__["a" /* MIDNIGHT_DATE */], max), min.getHours() < max.getHours() ? 0 : 1),
    minValue: setTime(__WEBPACK_IMPORTED_MODULE_1__defaults__["a" /* MIDNIGHT_DATE */], min)
}); };
/**
 * @hidden
 */
var setHours = setter('setHours');
/**
 * @hidden
 */
var setMinutes = setter('setMinutes');
/**
 * @hidden
 */
var setSeconds = setter('setSeconds');
/**
 * @hidden
 */
var range = function (start, end, step) {
    if (step === void 0) { step = 1; }
    var result = [];
    for (var i = start; i < end; i = i + step) {
        result.push(i);
    }
    return result;
};
/**
 * @hidden
 */
var isInRange = function (candidate, min, max) { return (!candidate || !((min && min > candidate) || (max && max < candidate))); };
/**
 * @hidden
 */
var isInTimeRange = function (candidate, min, max) {
    if (!candidate || !min || !max) {
        return true;
    }
    var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;
    return minValue <= candidateValue && candidateValue <= maxValue;
};
/**
 * @hidden
 */
var isValidRange = function (min, max) { return (!isSet(min) || !isSet(max) || min <= max); };
/**
 * @hidden
 */
var dateInRange = function (candidate, min, max) {
    if (!candidate) {
        return candidate;
    }
    if (min && candidate < min) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["a" /* cloneDate */])(min);
    }
    if (max && candidate > max) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["a" /* cloneDate */])(max);
    }
    return candidate;
};
/**
 * @hidden
 */
var timeInRange = function (candidate, min, max) {
    if (!candidate || !min || !max) {
        return candidate;
    }
    var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;
    if (candidateValue < minValue) {
        return setTime(candidate, min);
    }
    if (candidateValue > maxValue) {
        return setTime(candidate, max);
    }
    return candidate;
};
/**
 * @hidden
 */
var getNow = function () { return new Date(); };
/**
 * @hidden
 */
var getToday = function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["d" /* getDate */])(new Date()); };
/**
 * @hidden
 */
var guid = function () {
    var id = "", random;
    for (var i = 0; i < 32; i++) {
        random = Math.random() * 16 | 0;
        if (i === 8 || i === 12 || i === 16 || i === 20) {
            id += "-";
        }
        id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
    }
    return id;
};
/**
 * @hidden
 */
var noop = function (_) { }; // tslint:disable-line:no-empty
/**
 * @hidden
 */
// tslint:disable-line:no-empty
var isDocumentAvailable = function () {
    return typeof document !== 'undefined';
};
/**
 * @hidden
 */
var stringifyClassObject = function (classes) {
    var pushToAcc = function (acc, cls) { return classes[cls] ? acc.concat(cls) : acc; };
    return Object.keys(classes).reduce(pushToAcc, []).join(' ');
};
/**
 * @hidden
 */
var shiftWeekNames = function (names, offset) { return (names.slice(offset).concat(names.slice(0, offset))); };
/**
 * @hidden
 */
var approximateStringMatching = function (oldTextOrigin, oldFormat, newTextOrigin, caret) {
    // Remove the right part of the cursor.
    //oldFormat = oldFormat.substring(0, caret + oldText.length - newText.length);
    var oldTextSeparator = oldTextOrigin[caret + oldTextOrigin.length - newTextOrigin.length];
    var oldText = oldTextOrigin.substring(0, caret + oldTextOrigin.length - newTextOrigin.length);
    var newText = newTextOrigin.substring(0, caret);
    var diff = [];
    // Handle typing a single character over the same selection.
    if (oldText === newText && caret > 0) {
        diff.push([oldFormat[caret - 1], newText[caret - 1]]);
        return diff;
    }
    if (oldText.indexOf(newText) === 0 && (newText.length === 0 || oldFormat[newText.length - 1] !== oldFormat[newText.length])) {
        // Handle Delete/Backspace.
        var deletedSymbol = "";
        //XXX:
        // Whole text is replaced with a same char
        // Nasty patch required to keep the selection in the first segment
        if (newText.length === 1) {
            diff.push([oldFormat[0], newText[0]]);
        }
        for (var i = newText.length; i < oldText.length; i++) {
            if (oldFormat[i] !== deletedSymbol && oldFormat[i] !== "_") {
                deletedSymbol = oldFormat[i];
                diff.push([deletedSymbol, ""]);
            }
        }
        return diff;
    }
    // Handle inserting text (the new text is longer than the previous one).
    // Handle typing over a literal as well.
    if (newText.indexOf(oldText) === 0 || oldFormat[caret - 1] === "_") {
        var symbol = oldFormat[0];
        for (var i = Math.max(0, oldText.length - 1); i < oldFormat.length; i++) {
            if (oldFormat[i] !== "_") {
                symbol = oldFormat[i];
                break;
            }
        }
        return [[symbol, newText[caret - 1]]];
    }
    // Handle entering a space or a separator, for navigation to the next item.
    if (newText[newText.length - 1] === " " || newText[newText.length - 1] === oldTextSeparator) {
        return [[oldFormat[caret - 1], "_"]];
    }
    // Handle typing over a correctly selected part.
    return [[oldFormat[caret - 1], newText[caret - 1]]];
};
/**
 * @hidden
 */
var domContainerFactory = function (type) { return function (children, classes, styles) {
    if (classes === void 0) { classes = ""; }
    if (styles === void 0) { styles = {}; }
    var container = document.createElement(type);
    container.className = classes;
    Object.keys(styles).map(function (key) { return container.style[key] = styles[key]; });
    if (typeof children === 'string') {
        container.innerHTML = children || '';
    }
    else {
        (children || []).forEach(function (child) { return container.appendChild(child); });
    }
    return container;
}; };
/**
 * @hidden
 */
var hasChange = function (changes, field) { return changes[field] !== undefined; };
/**
 * @hidden
 */
var hasExistingValue = function (changes, field) { return changes[field] && changes[field].currentValue !== undefined && changes[field].currentValue !== null; };


/***/ }),
/* 15 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_days__ = __webpack_require__(128);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__add_days__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__add_months__ = __webpack_require__(213);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_1__add_months__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__add_weeks__ = __webpack_require__(642);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2__add_weeks__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__add_years__ = __webpack_require__(214);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_3__add_years__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__add_decades__ = __webpack_require__(641);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "p", function() { return __WEBPACK_IMPORTED_MODULE_4__add_decades__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__add_centuries__ = __webpack_require__(640);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "t", function() { return __WEBPACK_IMPORTED_MODULE_5__add_centuries__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__adjust_dst__ = __webpack_require__(76);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__clone_date__ = __webpack_require__(77);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_7__clone_date__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__create_date__ = __webpack_require__(51);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_8__create_date__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__day_of_week__ = __webpack_require__(215);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_9__day_of_week__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__day_enum__ = __webpack_require__(216);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__direction_enum__ = __webpack_require__(129);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__duration_in_months__ = __webpack_require__(645);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "o", function() { return __WEBPACK_IMPORTED_MODULE_12__duration_in_months__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__duration_in_years__ = __webpack_require__(646);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_13__duration_in_years__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__duration_in_decades__ = __webpack_require__(644);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "s", function() { return __WEBPACK_IMPORTED_MODULE_14__duration_in_decades__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__duration_in_centuries__ = __webpack_require__(643);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "w", function() { return __WEBPACK_IMPORTED_MODULE_15__duration_in_centuries__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__next_day_of_week__ = __webpack_require__(654);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__prev_day_of_week__ = __webpack_require__(409);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__get_date__ = __webpack_require__(406);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_18__get_date__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__first_day_in_week__ = __webpack_require__(647);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__first_day_of_month__ = __webpack_require__(648);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_20__first_day_of_month__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__first_month_of_year__ = __webpack_require__(649);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_21__first_month_of_year__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__first_year_of_decade__ = __webpack_require__(405);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "q", function() { return __WEBPACK_IMPORTED_MODULE_22__first_year_of_decade__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__first_decade_of_century__ = __webpack_require__(404);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "u", function() { return __WEBPACK_IMPORTED_MODULE_23__first_decade_of_century__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__is_equal__ = __webpack_require__(407);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_24__is_equal__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__is_equal_date__ = __webpack_require__(650);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__last_day_of_month__ = __webpack_require__(130);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_26__last_day_of_month__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__last_month_of_year__ = __webpack_require__(652);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_27__last_month_of_year__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__last_year_of_decade__ = __webpack_require__(653);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "r", function() { return __WEBPACK_IMPORTED_MODULE_28__last_year_of_decade__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__last_decade_of_century__ = __webpack_require__(651);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "v", function() { return __WEBPACK_IMPORTED_MODULE_29__last_decade_of_century__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__ms_per_day__ = __webpack_require__(408);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__week_in_year__ = __webpack_require__(655);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "x", function() { return __WEBPACK_IMPORTED_MODULE_31__week_in_year__["a"]; });


































/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(11);

/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(38);

/***/ }),
/* 18 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return toJSON; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterOperatorBase; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);


var localizeOperators = function (operators) { return function (localization) {
    return Object.keys(operators).reduce(function (acc, key) {
        acc[operators[key]] = localization.get(key);
        return acc;
    }, {});
}; }; // tslint:disable-line:align
var operatorTexts = localizeOperators({
    "filterEqOperator": "eq",
    "filterNotEqOperator": "neq",
    // tslint:disable-next-line:object-literal-sort-keys
    "filterGteOperator": "gte",
    "filterGtOperator": "gt",
    "filterLteOperator": "lte",
    "filterLtOperator": "lt",
    "filterIsNullOperator": "isnull",
    "filterIsNotNullOperator": "isnotnull",
    "filterIsEmptyOperator": "isempty",
    "filterIsNotEmptyOperator": "isnotempty",
    "filterContainsOperator": "contains",
    "filterNotContainsOperator": "doesnotcontain",
    "filterStartsWithOperator": "startswith",
    "filterEndsWithOperator": "endswith",
    "filterAfterOrEqualOperator": "after-eq",
    "filterAfterOperator": "after"
});
/**
 * @hidden
 */
var toJSON = function (xs) { return xs.map(function (x) { return x.toJSON(); }); };
/**
 * @hidden
 */
var FilterOperatorBase = (function () {
    function FilterOperatorBase(operator, localization) {
        this.operator = operator;
        this.localization = localization;
        this.messages = operatorTexts(this.localization);
        this._text = this.messages[this.operator];
    }
    Object.defineProperty(FilterOperatorBase.prototype, "text", {
        /**
         * The text to be displayed in the DropDownList.
         * @readonly
         * @type {string}
         * @memberOf FilterOperatorBase
         */
        get: function () {
            return this._text;
        },
        /**
         *
         */
        set: function (value) {
            this._text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNullOrEmptyString */])(value) ? this.messages[this.operator] : value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    FilterOperatorBase.prototype.toJSON = function () {
        return {
            text: this.text,
            value: this.operator
        };
    };
    return FilterOperatorBase;
}());

FilterOperatorBase.propDecorators = {
    'text': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 19 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__ = __webpack_require__(132);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matrix__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__to_matrix__ = __webpack_require__(54);







var Point = (function (Class) {
    function Point(x, y) {
        Class.call(this);

        this.x = x || 0;
        this.y = y || 0;
    }

    if ( Class ) Point.__proto__ = Class;
    Point.prototype = Object.create( Class && Class.prototype );
    Point.prototype.constructor = Point;

    var staticAccessors = { ZERO: {} };

    Point.prototype.equals = function equals (other) {
        return other && other.x === this.x && other.y === this.y;
    };

    Point.prototype.clone = function clone () {
        return new Point(this.x, this.y);
    };

    Point.prototype.rotate = function rotate (angle, origin) {
        var originPoint = Point.create(origin) || Point.ZERO;

        return this.transform(__WEBPACK_IMPORTED_MODULE_4__matrix__["a" /* default */].rotate(angle, originPoint.x, originPoint.y));
    };

    Point.prototype.translate = function translate (x, y) {
        this.x += x;
        this.y += y;

        this.geometryChange();

        return this;
    };

    Point.prototype.translateWith = function translateWith (point) {
        return this.translate(point.x, point.y);
    };

    Point.prototype.move = function move (x, y) {
        this.x = this.y = 0;
        return this.translate(x, y);
    };

    Point.prototype.scale = function scale (scaleX, scaleY) {
        if ( scaleY === void 0 ) scaleY = scaleX;

        this.x *= scaleX;
        this.y *= scaleY;

        this.geometryChange();

        return this;
    };

    Point.prototype.scaleCopy = function scaleCopy (scaleX, scaleY) {
        return this.clone().scale(scaleX, scaleY);
    };

    Point.prototype.transform = function transform (transformation) {
        var matrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__to_matrix__["a" /* default */])(transformation);
        var ref = this;
        var x = ref.x;
        var y = ref.y;

        this.x = matrix.a * x + matrix.c * y + matrix.e;
        this.y = matrix.b * x + matrix.d * y + matrix.f;

        this.geometryChange();

        return this;
    };

    Point.prototype.transformCopy = function transformCopy (transformation) {
        var point = this.clone();

        if (transformation) {
            point.transform(transformation);
        }

        return point;
    };

    Point.prototype.distanceTo = function distanceTo (point) {
        var dx = this.x - point.x;
        var dy = this.y - point.y;

        return Math.sqrt(dx * dx + dy * dy);
    };

    Point.prototype.round = function round$1 (digits) {
        this.x = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(this.x, digits);
        this.y = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(this.y, digits);

        this.geometryChange();

        return this;
    };

    Point.prototype.toArray = function toArray (digits) {
        var doRound = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(digits);
        var x = doRound ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(this.x, digits) : this.x;
        var y = doRound ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(this.y, digits) : this.y;

        return [ x, y ];
    };

    Point.prototype.toString = function toString (digits, separator) {
        if ( separator === void 0 ) separator = " ";

        var ref = this;
        var x = ref.x;
        var y = ref.y;

        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(digits)) {
            x = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(x, digits);
            y = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(y, digits);
        }

        return x + separator + y;
    };

    Point.create = function create (arg0, arg1) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(arg0)) {
            if (arg0 instanceof Point) {
                return arg0;
            } else if (arguments.length === 1 && arg0.length === 2) {
                return new Point(arg0[0], arg0[1]);
            }

            return new Point(arg0, arg1);
        }
    };

    Point.min = function min () {
        var arguments$1 = arguments;

        var minX = __WEBPACK_IMPORTED_MODULE_3__util__["f" /* MAX_NUM */];
        var minY = __WEBPACK_IMPORTED_MODULE_3__util__["f" /* MAX_NUM */];

        for (var i = 0; i < arguments.length; i++) {
            var point = arguments$1[i];
            minX = Math.min(point.x, minX);
            minY = Math.min(point.y, minY);
        }

        return new Point(minX, minY);
    };

    Point.max = function max () {
        var arguments$1 = arguments;

        var maxX = __WEBPACK_IMPORTED_MODULE_3__util__["g" /* MIN_NUM */];
        var maxY = __WEBPACK_IMPORTED_MODULE_3__util__["g" /* MIN_NUM */];

        for (var i = 0; i < arguments.length; i++) {
            var point = arguments$1[i];
            maxX = Math.max(point.x, maxX);
            maxY = Math.max(point.y, maxY);
        }

        return new Point(maxX, maxY);
    };

    Point.minPoint = function minPoint () {
        return new Point(__WEBPACK_IMPORTED_MODULE_3__util__["g" /* MIN_NUM */], __WEBPACK_IMPORTED_MODULE_3__util__["g" /* MIN_NUM */]);
    };

    Point.maxPoint = function maxPoint () {
        return new Point(__WEBPACK_IMPORTED_MODULE_3__util__["f" /* MAX_NUM */], __WEBPACK_IMPORTED_MODULE_3__util__["f" /* MAX_NUM */]);
    };

    staticAccessors.ZERO.get = function () {
        return new Point(0, 0);
    };

    Object.defineProperties( Point, staticAccessors );

    return Point;
}(__WEBPACK_IMPORTED_MODULE_2__common__["d" /* Class */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__["a" /* default */])(Point.prototype, [ "x", "y" ]);
__WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__["a" /* default */].extend(Point.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Point);

//# sourceMappingURL=point.js.map


/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(31);

/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(88);

/***/ }),
/* 22 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return DECIMAL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return CURRENCY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ACCOUNTING; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return PERCENT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return SCIENTIFIC; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CURRENCY_PLACEHOLDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return PERCENT_PLACEHOLDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return NUMBER_PLACEHOLDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return LIST_SEPARATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return GROUP_SEPARATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return POINT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EMPTY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEFAULT_LOCALE; });
var DECIMAL = "decimal";
var CURRENCY = "currency";
var ACCOUNTING = "accounting";
var PERCENT = "percent";
var SCIENTIFIC = "scientific";

var CURRENCY_PLACEHOLDER = "$";
var PERCENT_PLACEHOLDER = "%";
var NUMBER_PLACEHOLDER = "n";

var LIST_SEPARATOR = ";";
var GROUP_SEPARATOR = ",";

var POINT = ".";
var EMPTY = "";

var DEFAULT_LOCALE = "en";


//# sourceMappingURL=constants.js.map


/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var AsyncAction_1 = __webpack_require__(108);
var AsyncScheduler_1 = __webpack_require__(109);
/**
 *
 * Async Scheduler
 *
 * <span class="informal">Schedule task as if you used setTimeout(task, duration)</span>
 *
 * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript
 * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating
 * in intervals.
 *
 * If you just want to "defer" task, that is to perform it right after currently
 * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),
 * better choice will be the {@link asap} scheduler.
 *
 * @example <caption>Use async scheduler to delay task</caption>
 * const task = () => console.log('it works!');
 *
 * Rx.Scheduler.async.schedule(task, 2000);
 *
 * // After 2 seconds logs:
 * // "it works!"
 *
 *
 * @example <caption>Use async scheduler to repeat task in intervals</caption>
 * function task(state) {
 *   console.log(state);
 *   this.schedule(state + 1, 1000); // `this` references currently executing Action,
 *                                   // which we reschedule with new state and delay
 * }
 *
 * Rx.Scheduler.async.schedule(task, 3000, 0);
 *
 * // Logs:
 * // 0 after 3s
 * // 1 after 4s
 * // 2 after 5s
 * // 3 after 6s
 *
 * @static true
 * @name async
 * @owner Scheduler
 */
exports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction);
//# sourceMappingURL=async.js.map

/***/ }),
/* 24 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isPresent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isBlank; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isFunction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isString; });
/* unused harmony export isTruthy */
/* unused harmony export isNullOrEmptyString */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isNotNullOrEmptyString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isNumeric; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isDate; });
/**
 * @hidden
 */
var isPresent = function (value) { return value !== null && value !== undefined; };
/**
 * @hidden
 */
var isBlank = function (value) { return value === null || value === undefined; };
/**
 * @hidden
 */
var isArray = function (value) { return Array.isArray(value); };
/**
 * @hidden
 */
var isFunction = function (value) { return typeof value === 'function'; };
/**
 * @hidden
 */
var isString = function (value) { return typeof value === 'string'; };
/**
 * @hidden
 */
var isTruthy = function (value) { return !!value; };
/**
 * @hidden
 */
var isNullOrEmptyString = function (value) { return isBlank(value) || value.trim().length === 0; };
/**
 * @hidden
 */
var isNotNullOrEmptyString = function (value) { return !isNullOrEmptyString(value); };
/**
 * @hidden
 */
var isNumeric = function (value) { return !isNaN(value - parseFloat(value)); };
/**
 * @hidden
 */
var isDate = function (value) { return value && value.getTime; };


/***/ }),
/* 25 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

var ObserversMixin = {
    extend: function(proto) {
        var this$1 = this;

        for (var method in this) {
            if (method !== "extend") {
                proto[method] = this$1[method];
            }
        }
    },

    observers: function() {
        this._observers = this._observers || [];
        return this._observers;
    },

    addObserver: function(element) {
        if (!this._observers) {
            this._observers = [ element ];
        } else {
            this._observers.push(element);
        }
        return this;
    },

    removeObserver: function(element) {
        var observers = this.observers();
        var index = observers.indexOf(element);
        if (index !== -1) {
            observers.splice(index, 1);
        }
        return this;
    },

    trigger: function(methodName, event) {
        var observers = this._observers;

        if (observers && !this._suspended) {
            for (var idx = 0; idx < observers.length; idx++) {
                var observer = observers[idx];
                if (observer[methodName]) {
                    observer[methodName](event);
                }
            }
        }
        return this;
    },

    optionsChange: function(e) {
        if ( e === void 0 ) e = {};

        e.element = this;
        this.trigger("optionsChange", e);
    },

    geometryChange: function() {
        this.trigger("geometryChange", {
            element: this
        });
    },

    suspend: function() {
        this._suspended = (this._suspended || 0) + 1;
        return this;
    },

    resume: function() {
        this._suspended = Math.max((this._suspended || 0) - 1, 0);
        return this;
    },

    _observerField: function(field, value) {
        if (this[field]) {
            this[field].removeObserver(this);
        }
        this[field] = value;
        value.addObserver(this);
    }
};

/* harmony default export */ __webpack_exports__["a"] = (ObserversMixin);
//# sourceMappingURL=observers-mixin.js.map


/***/ }),
/* 26 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MIDNIGHT_DATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return MIN_DATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return MAX_DATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MIN_TIME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return MAX_TIME; });
/**
 * @hidden
 */
var MIDNIGHT_DATE = new Date(1980, 0, 1);
/**
 * @hidden
 */
var MIN_DATE = new Date(1900, 0, 1);
/**
 * @hidden
 */
var MAX_DATE = new Date(2099, 11, 31);
/**
 * @hidden
 */
var MIN_TIME = new Date(1980, 0, 1);
/**
 * @hidden
 */
var MAX_TIME = new Date(1980, 0, 1, 23, 59, 59);


/***/ }),
/* 27 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return expandColumns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return columnsToRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return columnsSpan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isValidFieldName; });
/* unused harmony export children */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return leafColumns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return resizableColumns; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__span_column_component__ = __webpack_require__(172);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);


/**
 * @hidden
 */
var expandColumns = function (columns) { return (columns.reduce(function (acc, column) { return acc.concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__span_column_component__["a" /* isSpanColumnComponent */])(column) ? column.childColumns.toArray() : [column]); }, []) // tslint:disable-line:align
); };
/**
 * @hidden
 */
var columnsToRender = function (columns) { return (expandColumns(columns).filter(function (x) { return !x.hidden; })); };
/**
 * @hidden
 */
var columnsSpan = function (columns) {
    return (columns || []).reduce(function (acc, col) { return acc + col.colspan; }, 0);
};
// tslint:disable-next-line:max-line-length
var validField = new RegExp("^[$A-Z_a-z][$A-Z_a-z0-9\\.]*$");
/**
 * @hidden
 */
var isValidFieldName = function (fieldName) {
    return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNullOrEmptyString */])(fieldName) && validField.test(fieldName) &&
        fieldName[0] !== "." && fieldName[fieldName.length - 1] !== ".";
};
/**
 * @hidden
 */
var children = function (column) { return column.children.filter(function (child) { return child !== column; }); };
/**
 * @hidden
 */
var leafColumns = function (columns) {
    return columns.reduce(function (acc, column) {
        if (column.isColumnGroup) {
            acc = acc.concat(leafColumns(children(column)));
        }
        else if (column.isSpanColumn) {
            acc = acc.concat(column.childColumns.toArray());
        }
        else {
            acc.push(column);
        }
        return acc;
    }, []).filter(function (x) { return !x.hidden; }); // tslint:disable-line:align
};
/**
 * @hidden
 */
var resizableColumns = function (columns) { return columns.filter(function (column) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["g" /* isTruthy */])(column.resizable); }); };


/***/ }),
/* 28 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__popup_service__ = __webpack_require__(399);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__popup_service__["a"]; });
/* unused harmony reexport POPUP_CONTAINER */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__popup_component__ = __webpack_require__(208);
/* unused harmony reexport PopupComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__popup_module__ = __webpack_require__(627);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__popup_module__["a"]; });





/***/ }),
/* 29 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__size__ = __webpack_require__(140);





var Rect = (function (Class) {
    function Rect(origin, size) {
        if ( origin === void 0 ) origin = new __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */]();
        if ( size === void 0 ) size = new __WEBPACK_IMPORTED_MODULE_3__size__["a" /* default */]();

        Class.call(this);

        this.setOrigin(origin);
        this.setSize(size);
    }

    if ( Class ) Rect.__proto__ = Class;
    Rect.prototype = Object.create( Class && Class.prototype );
    Rect.prototype.constructor = Rect;

    Rect.prototype.clone = function clone () {
        return new Rect(
            this.origin.clone(),
            this.size.clone()
        );
    };

    Rect.prototype.equals = function equals (other) {
        return other &&
               other.origin.equals(this.origin) &&
               other.size.equals(this.size);
    };

    Rect.prototype.setOrigin = function setOrigin (value) {
        this._observerField("origin", __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].create(value));
        this.geometryChange();
        return this;
    };

    Rect.prototype.getOrigin = function getOrigin () {
        return this.origin;
    };

    Rect.prototype.setSize = function setSize (value) {
        this._observerField("size", __WEBPACK_IMPORTED_MODULE_3__size__["a" /* default */].create(value));
        this.geometryChange();
        return this;
    };

    Rect.prototype.getSize = function getSize () {
        return this.size;
    };

    Rect.prototype.width = function width () {
        return this.size.width;
    };

    Rect.prototype.height = function height () {
        return this.size.height;
    };

    Rect.prototype.topLeft = function topLeft () {
        return this.origin.clone();
    };

    Rect.prototype.bottomRight = function bottomRight () {
        return this.origin.clone().translate(this.width(), this.height());
    };

    Rect.prototype.topRight = function topRight () {
        return this.origin.clone().translate(this.width(), 0);
    };

    Rect.prototype.bottomLeft = function bottomLeft () {
        return this.origin.clone().translate(0, this.height());
    };

    Rect.prototype.center = function center () {
        return this.origin.clone().translate(this.width() / 2, this.height() / 2);
    };

    Rect.prototype.bbox = function bbox (matrix) {
        var tl = this.topLeft().transformCopy(matrix);
        var tr = this.topRight().transformCopy(matrix);
        var br = this.bottomRight().transformCopy(matrix);
        var bl = this.bottomLeft().transformCopy(matrix);

        return Rect.fromPoints(tl, tr, br, bl);
    };

    Rect.prototype.transformCopy = function transformCopy (m) {
        return Rect.fromPoints(
            this.topLeft().transform(m),
            this.bottomRight().transform(m)
        );
    };

    Rect.prototype.expand = function expand (x, y) {
        if ( y === void 0 ) y = x;


        this.size.width += 2 * x;
        this.size.height += 2 * y;

        this.origin.translate(-x, -y);

        return this;
    };

    Rect.prototype.expandCopy = function expandCopy (x, y) {
        return this.clone().expand(x, y);
    };

    Rect.prototype.containsPoint = function containsPoint (point) {
        var origin = this.origin;
        var bottomRight = this.bottomRight();
        return !(point.x < origin.x || point.y < origin.y || bottomRight.x < point.x || bottomRight.y < point.y);
    };

    Rect.prototype._isOnPath = function _isOnPath (point, width) {
        var rectOuter = this.expandCopy(width, width);
        var rectInner = this.expandCopy(-width, -width);

        return rectOuter.containsPoint(point) && !rectInner.containsPoint(point);
    };

    Rect.fromPoints = function fromPoints () {
        var topLeft = __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].min.apply(null, arguments);
        var bottomRight = __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].max.apply(null, arguments);
        var size = new __WEBPACK_IMPORTED_MODULE_3__size__["a" /* default */](
            bottomRight.x - topLeft.x,
            bottomRight.y - topLeft.y
        );

        return new Rect(topLeft, size);
    };

    Rect.union = function union (a, b) {
        return Rect.fromPoints(
            __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].min(a.topLeft(), b.topLeft()),
            __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].max(a.bottomRight(), b.bottomRight())
        );
    };

    Rect.intersect = function intersect (a, b) {
        var rect1 = {
            left: a.topLeft().x,
            top: a.topLeft().y,
            right: a.bottomRight().x,
            bottom: a.bottomRight().y
        };

        var rect2 = {
            left: b.topLeft().x,
            top: b.topLeft().y,
            right: b.bottomRight().x,
            bottom: b.bottomRight().y
        };

        if (rect1.left <= rect2.right &&
            rect2.left <= rect1.right &&
            rect1.top <= rect2.bottom &&
            rect2.top <= rect1.bottom) {
            return Rect.fromPoints(
                new __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */](Math.max(rect1.left, rect2.left), Math.max(rect1.top, rect2.top)),
                new __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */](Math.min(rect1.right, rect2.right), Math.min(rect1.bottom, rect2.bottom))
            );
        }
    };

    return Rect;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

__WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__["a" /* default */].extend(Rect.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Rect);
//# sourceMappingURL=rect.js.map


/***/ }),
/* 30 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cldr; });
/* harmony export (immutable) */ __webpack_exports__["a"] = getLocaleInfo;
/* harmony export (immutable) */ __webpack_exports__["c"] = localeInfo;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__default_data__ = __webpack_require__(764);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_is_string__ = __webpack_require__(237);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__errors__ = __webpack_require__(79);




function availableLocaleInfo(fullName, suffixes) {
    var parts = fullName.split("-");
    var language = parts[0];
    var script = parts[1];
    var territory = parts[2];

    return cldr[fullName] || (suffixes.indexOf(territory) !== -1 && cldr[language + "-" + territory]) || (suffixes.indexOf(script) !== -1 && cldr[language + "-" + script]) || cldr[language];
}

function localeFullName(language, suffixes) {
    var likelySubtags = cldr.supplemental.likelySubtags;

    for (var idx = 0; idx < suffixes.length; idx++) {
        var name = likelySubtags[language + "-" + suffixes[idx ]];
        if (name) {
            return name;
        }
    }

    if (likelySubtags[language]) {
        return likelySubtags[language];
    }
}

var cldr = __WEBPACK_IMPORTED_MODULE_0__default_data__["a" /* default */];

function getLocaleInfo(locale) {
    var info;
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_is_string__["a" /* default */])(locale)) {
        info = localeInfo(locale);
    } else {
        info = locale;
    }
    return info;
}

function localeInfo(locale) {
    if (cldr[locale]) {
        return cldr[locale];
    }

    var likelySubtags = cldr.supplemental.likelySubtags;
    if (likelySubtags) {
        var parts = locale.split("-");
        var language = parts[0];
        var suffixes = parts.slice(1);
        var fullName = localeFullName(language, suffixes);
        var info = fullName ? availableLocaleInfo(fullName, suffixes) : null;
        if (info) {
            return info;
        }
    }

    throw __WEBPACK_IMPORTED_MODULE_2__errors__["a" /* errors */].NoLocale.error(locale);
}

//# sourceMappingURL=info.js.map


/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var filter_1 = __webpack_require__(527);
Observable_1.Observable.prototype.filter = filter_1.filter;
//# sourceMappingURL=filter.js.map

/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var map_1 = __webpack_require__(249);
Observable_1.Observable.prototype.map = map_1.map;
//# sourceMappingURL=map.js.map

/***/ }),
/* 33 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__);

/**
 * Represent a service to set the filter descriptor.
 */
var FilterService = (function () {
    function FilterService() {
        /**
         * Fires when the filter descriptors is set.
         */
        this.changes = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__["Subject"]();
    }
    /**
     * Sets the filter descriptor.
     *
     * @param {CompositeFilterDescriptor} value - The filter descriptor that will be set.
     */
    FilterService.prototype.filter = function (value) {
        this.changes.next(value);
    };
    return FilterService;
}());



/***/ }),
/* 34 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GridComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_event_emitter__ = __webpack_require__(563);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_merge__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_groupBy__ = __webpack_require__(494);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_groupBy___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_groupBy__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_switchMap__ = __webpack_require__(106);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_switchMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_switchMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_do__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_do__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__columns_column_component__ = __webpack_require__(49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__columns_column_group_component__ = __webpack_require__(90);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__rendering_details_detail_template_directive__ = __webpack_require__(195);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__layout_browser_support_service__ = __webpack_require__(340);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__data_data_collection__ = __webpack_require__(565);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__selection_selection_service__ = __webpack_require__(91);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__selection_selection_default__ = __webpack_require__(368);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__editing_edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__rendering_details_details_service__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__grouping_groups_service__ = __webpack_require__(125);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__columns_columns_container__ = __webpack_require__(300);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__grouping_group_info_service__ = __webpack_require__(190);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__grouping_group_connection_service__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__data_change_notification_service__ = __webpack_require__(174);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__rendering_no_records_template_directive__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__columns_column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__layout_row_sync__ = __webpack_require__(342);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__rendering_common_cell_context__ = __webpack_require__(69);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__filtering_filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__pager_pager_template_directive__ = __webpack_require__(351);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pager_pager_context_service__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__pdf_pdf_service__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__pdf_pdf_export_event__ = __webpack_require__(599);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__scrolling_suspend_service__ = __webpack_require__(201);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__layout_responsive_service__ = __webpack_require__(593);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__excel_excel_service__ = __webpack_require__(177);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__columns_column_list__ = __webpack_require__(299);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__rendering_toolbar_toolbar_template_directive__ = __webpack_require__(200);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__columns_column_common__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__scrolling_scroll_sync_service__ = __webpack_require__(367);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__layout_resize_service__ = __webpack_require__(191);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__editing_local_data_changes_service__ = __webpack_require__(66);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__common_dom_events_service__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__column_resizing_column_resizing_service__ = __webpack_require__(171);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__filtering_menu_single_popup_service__ = __webpack_require__(122);
















































var createControl = function (source) { return function (acc, key) {
    acc[key] = new __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormControl"](source[key]);
    return acc;
}; };
var validateColumnsField = function (columns) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_39__columns_column_common__["a" /* expandColumns */])(columns.toArray())
        .filter(__WEBPACK_IMPORTED_MODULE_10__columns_column_component__["a" /* isColumnComponent */])
        .filter(function (_a) {
        var field = _a.field;
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_39__columns_column_common__["b" /* isValidFieldName */])(field);
    })
        .forEach(function (_a) {
        var field = _a.field;
        return console.warn("\n                Grid column field name '" + field + "' does not look like a valid JavaScript identifier.\n                Identifiers can contain only alphanumeric characters (including \"$\" or \"_\"), and may not start with a digit.\n                Please use only valid identifier names to ensure error-free operation.\n            ");
    });
};
var handleExpandCollapseService = function (service, expandEmitter, collapseEmitter, map) { return (service.changes.filter(function (_a) {
    var dataItem = _a.dataItem;
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["b" /* isPresent */])(dataItem);
})
    .subscribe(function (x) { return x.expand ? expandEmitter.emit(map(x)) : collapseEmitter.emit(map(x)); })); };
/**
 * Represents the Kendo UI Grid component for Angular.
 *
 * @example
 * ```ts-preview
 * _@Component({
 *    selector: 'my-app',
 *    template: `
 *        <kendo-grid [data]="gridData">
 *        </kendo-grid>
 *    `
 * })
 * class AppComponent {
 *    public gridData: any[] = products;
 * }
 *
 * const products = [{
 *    "ProductID": 1,
 *    "ProductName": "Chai",
 *    "UnitPrice": 18.0000,
 *    "Discontinued": true
 *  }, {
 *    "ProductID": 2,
 *    "ProductName": "Chang",
 *    "UnitPrice": 19.0000,
 *    "Discontinued": false
 *  }
 * ];
 * ```
 */
var GridComponent = (function () {
    function GridComponent(supportService, selectionService, wrapper, groupInfoService, groupsService, changeNotification, detailsService, editService, filterService, pdfService, responsiveService, renderer, excelService, ngZone, scrollSyncService, domEvents, rtl, columnResizingService, changeDetectorRef) {
        var _this = this;
        this.selectionService = selectionService;
        this.wrapper = wrapper;
        this.groupInfoService = groupInfoService;
        this.groupsService = groupsService;
        this.changeNotification = changeNotification;
        this.detailsService = detailsService;
        this.editService = editService;
        this.filterService = filterService;
        this.pdfService = pdfService;
        this.responsiveService = responsiveService;
        this.renderer = renderer;
        this.excelService = excelService;
        this.ngZone = ngZone;
        this.scrollSyncService = scrollSyncService;
        this.domEvents = domEvents;
        this.rtl = rtl;
        this.columnResizingService = columnResizingService;
        this.changeDetectorRef = changeDetectorRef;
        /**
         * Sets the data of the Grid. If an array is provided, the Grid automatically gets the total count.
         */
        this.data = [];
        /**
         * Defines the number of records to be skipped by the pager.
         * Required by the [paging]({% slug paging_grid %}) functionality.
         */
        this.skip = 0;
        /**
         * Defines the scroll mode used by the Grid.
         *
         * The available options are:
         *  - `none`&mdash;Renders no scrollbar.
         *  - `scrollable`&mdash;This is the default scroll mode. It requires the setting of the `height` option.
         *  - `virtual`&mdash;Displays no pager and renders a portion of the data (optimized rendering) while the user is scrolling the content.
         */
        this.scrollable = 'scrollable';
        /**
         * Enables the single-row [selection]({% slug selection_grid %}) of the Grid.
         */
        this.selectable = false;
        /**
         * Enables the [filtering]({% slug filtering_grid %}) of the Grid columns that have their `field` option set.
         */
        this.filterable = false;
        /**
         * Enables the [sorting]({% slug sorting_grid %}) of the Grid columns that have their `field` option set.
         */
        this.sortable = false;
        /**
         * Configures the pager of the Grid.
         *
         * The available options are:
         *
         * - `buttonCount: Number`&mdash;Sets the maximum numeric buttons count before the buttons are collapsed.
         * - `info: Boolean`&mdash;Toggles the information about the current page and the total number of records.
         * - `type: PagerType`&mdash;Accepts the `numeric` (buttons with numbers) and `input` (input for typing the page number) values.
         * - `pageSizes: Boolean` or `Array<number>`&mdash;Shows a menu for selecting the page size.
         * - `previousNext: Boolean`&mdash;Toggles the **Previous** and **Next** buttons.
         */
        this.pageable = false;
        /**
         * If set to `true`, the user can group the Grid by dragging the column header cells.
         * By default, grouping is disabled.
         */
        this.groupable = false;
        /**
         * If set to `true`, the user can resize columns by dragging the edges (resize handles) of their header cells.
         * @default false
         */
        this.resizable = false;
        /**
         * Fires when the Grid filter is modified through the UI.
         * You have to handle the event yourself and filter the data.
         */
        this.filterChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the page of the Grid is changed.
         * You have to handle the event yourself and page the data.
         */
        this.pageChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the grouping of the Grid is changed.
         * You have to handle the event yourself and group the data.
         */
        this.groupChange = new __WEBPACK_IMPORTED_MODULE_1__common_event_emitter__["a" /* ZoneAwareEventEmitter */](this.ngZone);
        /**
         * Fires when the sorting of the Grid is changed.
         * You have to handle the event yourself and sort the data.
         */
        this.sortChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user selects a Grid row.
         * Emits the [`SelectionEvent`]({% slug api_grid_selectionevent %}#toc-selectionchange).
         */
        this.selectionChange = new __WEBPACK_IMPORTED_MODULE_1__common_event_emitter__["a" /* ZoneAwareEventEmitter */](this.ngZone);
        /**
         * Fires when the data state of the Grid is changed.
         */
        this.dataStateChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user expands a group header.
         */
        this.groupExpand = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user collapses a group header.
         */
        this.groupCollapse = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user expands a master row.
         */
        this.detailExpand = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user collapses a master row.
         */
        this.detailCollapse = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks the **Edit** command button to edit a row.
         */
        this.edit = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks the **Cancel** command button to close a row.
         */
        this.cancel = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks the **Save** command button to save changes in a row.
         */
        this.save = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks the **Remove** command button to remove a row.
         */
        this.remove = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks the **Add** command button to add a new row.
         */
        this.add = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user leaves an edited cell.
         */
        this.cellClose = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks a cell.
         */
        this.cellClick = new __WEBPACK_IMPORTED_MODULE_1__common_event_emitter__["a" /* ZoneAwareEventEmitter */](this.ngZone);
        /**
         * Fires when the user clicks the **Export to PDF** command button.
         */
        this.pdfExport = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user clicks the **Export to Excel** command button.
         */
        this.excelExport = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the user completes the resizing of the column.
         */
        this.columnResize = new __WEBPACK_IMPORTED_MODULE_1__common_event_emitter__["a" /* ZoneAwareEventEmitter */](this.ngZone);
        this.columns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.footer = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.selectionDirective = false;
        this.columnsContainer = new __WEBPACK_IMPORTED_MODULE_21__columns_columns_container__["a" /* ColumnsContainer */](function () { return _this.columnList.filter(function (column) { return !_this.isHidden(column) && _this.matchesMedia(column); }); });
        this.view = new __WEBPACK_IMPORTED_MODULE_15__data_data_collection__["a" /* DataCollection */](function () { return new __WEBPACK_IMPORTED_MODULE_15__data_data_collection__["b" /* DataResultIterator */](_this.data, _this.skip, _this.showGroupFooters); });
        this.shouldGenerateColumns = true;
        this._sort = new Array();
        this._group = new Array();
        this.cachedWindowWidth = 0;
        this._rowSelected = null;
        this.columnResizingInProgress = false;
        this._rowClass = function () { return null; };
        this.direction = rtl ? 'rtl' : 'ltr';
        this.scrollbarWidth = supportService.scrollbarWidth;
        this.groupInfoService.registerColumnsContainer(function () { return _this.columnList; });
        if (selectionService) {
            this.selectionSubscription = selectionService.changes.subscribe(function (event) {
                _this.changeDetectorRef.markForCheck();
                _this.selectionChange.emit(event);
            });
        }
        this.groupExpandCollapseSubscription = handleExpandCollapseService(groupsService, this.groupExpand, this.groupCollapse, function (_a) {
            var group = _a.dataItem, index = _a.index;
            return ({ group: group, groupIndex: index });
        });
        this.detailsServiceSubscription = handleExpandCollapseService(detailsService, this.detailExpand, this.detailCollapse, function (_a) {
            var dataItem = _a.dataItem, index = _a.index;
            return ({ dataItem: dataItem, index: index });
        });
        this.filterSubscription = this.filterService.changes.subscribe(function (x) {
            _this.filterChange.emit(x);
        });
        this.attachStateChangesEmitter();
        this.attachEditHandlers();
        this.attachDomEventHandlers();
        this.pdfSubscription = this.pdfService.exportClick.subscribe(this.emitPDFExportEvent.bind(this));
        this.excelSubscription = this.excelService.exportClick.subscribe(this.saveAsExcel.bind(this));
        this.columnsContainerChange();
        this.columnResizingSubscription = this.columnResizingService
            .changes
            .do(function (e) { return _this.columnResizingInProgress = e.type !== 'end'; })
            .filter(function (e) { return e.type === 'end'; })
            .subscribe(this.notifyResize.bind(this));
        this.columnList = new __WEBPACK_IMPORTED_MODULE_37__columns_column_list__["a" /* ColumnList */](this.columns);
    }
    Object.defineProperty(GridComponent.prototype, "sort", {
        /**
         */
        get: function () {
            return this._sort;
        },
        /**
         * The descriptors by which the data will be sorted.
         */
        set: function (value) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["a" /* isArray */])(value)) {
                this._sort = value;
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "group", {
        /**
         */
        get: function () {
            return this._group;
        },
        /**
         * The descriptors by which the data will to be grouped.
         */
        set: function (value) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["a" /* isArray */])(value)) {
                this._group = value;
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "showTopToolbar", {
        /**
         * @hidden
         */
        get: function () {
            return this.toolbarTemplate && ['top', 'both'].indexOf(this.toolbarTemplate.position) > -1;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "showBottomToolbar", {
        /**
         * @hidden
         */
        get: function () {
            return this.toolbarTemplate && ['bottom', 'both'].indexOf(this.toolbarTemplate.position) > -1;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "isLocked", {
        /**
         * @hidden
         */
        get: function () {
            return this.lockedLeafColumns.length > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "showPager", {
        /**
         * @hidden
         */
        get: function () {
            return !this.isVirtual && this.pageable !== false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "showGroupPanel", {
        /**
         * @hidden
         */
        get: function () {
            return this.groupable && this.groupable.enabled !== false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "rowClass", {
        get: function () {
            return this._rowClass;
        },
        /**
         * Defines a function that is executed for every data row in the component.
         *
         * @example
         * ```ts-preview
         * import { Component, ViewEncapsulation } from '@angular/core';
         * import { RowClassArgs } from '@progress/kendo-angular-grid';
         *
         * _@Component({
         *    selector: 'my-app',
         *    encapsulation: ViewEncapsulation.None,
         *    styles: [`
         *        .k-grid tr.even { background-color: #f45c42; }
         *        .k-grid tr.odd { background-color: #41f4df; }
         *    `],
         *    template: `
         *        <kendo-grid [data]="gridData" [rowClass]="rowCallback">
         *        </kendo-grid>
         *    `
         * })
         * class AppComponent {
         *    public gridData: any[] = products;
         *
         *    public rowCallback(context: RowClassArgs) {
         *        const isEven = context.index % 2 == 0;
         *        return {
         *            even: isEven,
         *            odd: !isEven
         *        };
         *    }
         * }
         *
         * const products = [{
         *    "ProductID": 1,
         *    "ProductName": "Chai",
         *    "UnitPrice": 18.0000,
         *    "Discontinued": true
         *  }, {
         *    "ProductID": 2,
         *    "ProductName": "Chang",
         *    "UnitPrice": 19.0000,
         *    "Discontinued": false
         *  }
         * ];
         * ```
         */
        set: function (fn) {
            if (typeof fn !== 'function') {
                throw new Error("rowClass must be a function, but received " + JSON.stringify(fn) + ".");
            }
            this._rowClass = fn;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "rowSelected", {
        get: function () {
            return this._rowSelected;
        },
        /**
         * Defines a Boolean function that is executed for each data row in the component.
         * It determines whether the row will be selected.
         */
        set: function (fn) {
            if (typeof fn !== 'function') {
                throw new Error("rowSelected must be a function, but received " + JSON.stringify(fn) + ".");
            }
            this._rowSelected = fn;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "dir", {
        get: function () {
            return this.direction;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "hostClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "lockedClasses", {
        get: function () {
            return this.lockedLeafColumns.length > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "virtualClasses", {
        get: function () {
            return this.isVirtual;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "columnResizing", {
        get: function () {
            return this.columnResizingInProgress;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "noScrollbarClass", {
        get: function () {
            return this.scrollbarWidth === 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "headerPadding", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["c" /* isUniversal */])()) {
                return "";
            }
            var padding = Math.max(0, this.scrollbarWidth - 1) + 'px';
            var right = this.rtl ? 0 : padding;
            var left = this.rtl ? padding : 0;
            return "0 " + right + " 0 " + left;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "showGroupFooters", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_39__columns_column_common__["c" /* columnsToRender */])(this.columnList.toArray()).filter(function (column) { return column.groupFooterTemplateRef; }).length > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "showFooter", {
        get: function () {
            return this.columnList.filter(function (column) { return column.footerTemplateRef; }).length > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "isVirtual", {
        get: function () {
            return this.scrollable === 'virtual';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "isScrollable", {
        get: function () {
            return this.scrollable !== 'none';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "visibleColumns", {
        get: function () {
            return this.columnsContainer.allColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "lockedColumns", {
        get: function () {
            return this.columnsContainer.lockedColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "nonLockedColumns", {
        get: function () {
            return this.columnsContainer.nonLockedColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "lockedLeafColumns", {
        get: function () {
            return this.columnsContainer.lockedLeafColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "nonLockedLeafColumns", {
        get: function () {
            return this.columnsContainer.nonLockedLeafColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "leafColumns", {
        get: function () {
            return this.columnsContainer.leafColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "totalColumnLevels", {
        get: function () {
            return this.columnsContainer.totalLevels;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "lockedWidth", {
        get: function () {
            var groupCellsWidth = this.group.length * 30; // this should be the value of group-cell inside the theme!
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_39__columns_column_common__["a" /* expandColumns */])(this.lockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, groupCellsWidth);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "nonLockedWidth", {
        get: function () {
            if (this.lockedLeafColumns.length) {
                return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_39__columns_column_common__["a" /* expandColumns */])(this.nonLockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, 0);
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridComponent.prototype, "selectableSettings", {
        get: function () {
            if (this.selectionService) {
                return this.selectionService.options;
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Expands the specified master row.
     *
     * @param {number} index - The absolute index of the master row.
     */
    GridComponent.prototype.expandRow = function (index) {
        if (!this.detailsService.isExpanded(index)) {
            this.detailsService.toggleRow(index, null);
        }
    };
    /**
     * Collapses the specified master row.
     *
     * @param {number} index - The absolute index of the master row.
     */
    GridComponent.prototype.collapseRow = function (index) {
        if (this.detailsService.isExpanded(index)) {
            this.detailsService.toggleRow(index, null);
        }
    };
    /**
     * Expands a group header item for the given index.
     * For example, `0_1` expands the second inner group of the first master group.
     *
     * @param {string} index - The underscore separated hierarchical index of the group.
     */
    GridComponent.prototype.expandGroup = function (index) {
        if (!this.groupsService.isExpanded(index)) {
            this.groupsService.toggleRow(index, null);
        }
    };
    /**
     * Collapses a group header item for the given index.
     * For example, `0_1` collapses the second inner group of the first master group.
     *
     * @param {string} index - The underscore separated hierarchical index of the group.
     */
    GridComponent.prototype.collapseGroup = function (index) {
        if (this.groupsService.isExpanded(index)) {
            this.groupsService.toggleRow(index, null);
        }
    };
    /**
     * @hidden
     */
    GridComponent.prototype.resetGroupsState = function () {
        this.groupsService.reset();
    };
    /**
     * @hidden
     */
    GridComponent.prototype.expandGroupChildren = function (groupIndex) {
        this.groupsService.expandChildren(groupIndex);
    };
    /**
     * @hidden
     */
    GridComponent.prototype.onDataChange = function () {
        this.autoGenerateColumns();
        this.changeNotification.notify();
        this.pdfService.dataChanged.emit();
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["b" /* isPresent */])(this.defaultSelection)) {
            this.defaultSelection.reset();
        }
        this.initSelectionService();
    };
    GridComponent.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["d" /* isChanged */])("data", changes)) {
            this.onDataChange();
        }
        if (this.lockedLeafColumns.length && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["e" /* anyChanged */])(["pageSize", "skip", "sort", "group"], changes)) {
            this.changeNotification.notify();
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["d" /* isChanged */])("height", changes, false)) {
            this.renderer.setStyle(this.wrapper.nativeElement, 'height', this.height + "px");
        }
    };
    GridComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.attachScrollSync();
        this.ngZone.runOutsideAngular(function () {
            var resizeCheck = _this.resizeCheck.bind(_this);
            _this.resizeSubscription = _this.renderer.listen('window', 'resize', resizeCheck);
            _this.orientationSubscription = _this.renderer.listen('window', 'orientationchange', resizeCheck);
            _this.documentClickSubscription = _this.renderer.listen('document', 'click', function (args) {
                if (_this.editService.shouldCloseCell() &&
                    !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["a" /* closest */])(args.target, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["b" /* matchesClasses */])('k-animation-container k-grid-ignore-click'))) {
                    _this.editService.closeCell(args);
                }
            });
            _this.windowBlurSubscription = _this.renderer.listen('window', 'blur', function (args) {
                var activeElement = document.activeElement;
                if (!(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["c" /* matchesNodeName */])('input')(activeElement) && activeElement.type === 'file' &&
                    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["a" /* closest */])(activeElement, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["b" /* matchesClasses */])('k-grid-edit-cell')) &&
                    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["a" /* closest */])(activeElement, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["c" /* matchesNodeName */])('kendo-grid')) === _this.wrapper.nativeElement)) {
                    _this.editService.closeCell(args);
                }
            });
        });
    };
    GridComponent.prototype.ngAfterContentChecked = function () {
        this.columnsContainer.refresh();
        this.verifySettings();
        this.initSelectionService();
    };
    GridComponent.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.shouldGenerateColumns = !this.columns.length;
        this.autoGenerateColumns();
        this.columnList = new __WEBPACK_IMPORTED_MODULE_37__columns_column_list__["a" /* ColumnList */](this.columns);
        this.columnsChangeSubscription = this.columns.changes.subscribe(function () { return _this.verifySettings(); });
    };
    GridComponent.prototype.ngOnDestroy = function () {
        if (this.selectionSubscription) {
            this.selectionSubscription.unsubscribe();
        }
        if (this.stateChangeSubscription) {
            this.stateChangeSubscription.unsubscribe();
        }
        if (this.groupExpandCollapseSubscription) {
            this.groupExpandCollapseSubscription.unsubscribe();
        }
        if (this.detailsServiceSubscription) {
            this.detailsServiceSubscription.unsubscribe();
        }
        if (this.editServiceSubscription) {
            this.editServiceSubscription.unsubscribe();
        }
        if (this.pdfSubscription) {
            this.pdfSubscription.unsubscribe();
        }
        if (this.filterSubscription) {
            this.filterSubscription.unsubscribe();
        }
        if (this.columnsChangeSubscription) {
            this.columnsChangeSubscription.unsubscribe();
        }
        if (this.resizeSubscription) {
            this.resizeSubscription();
        }
        if (this.orientationSubscription) {
            this.orientationSubscription();
        }
        if (this.excelSubscription) {
            this.excelSubscription.unsubscribe();
        }
        if (this.columnsContainerChangeSubscription) {
            this.columnsContainerChangeSubscription.unsubscribe();
        }
        if (this.scrollSyncService) {
            this.scrollSyncService.destroy();
        }
        if (this.documentClickSubscription) {
            this.documentClickSubscription();
        }
        if (this.windowBlurSubscription) {
            this.windowBlurSubscription();
        }
        if (this.defaultSelection) {
            this.defaultSelection.destroy();
        }
        if (this.cellClickSubscription) {
            this.cellClickSubscription.unsubscribe();
        }
        if (this.footerChangeSubscription) {
            this.footerChangeSubscription.unsubscribe();
        }
        this.ngZone = null;
        if (this.columnResizingSubscription) {
            this.columnResizingSubscription.unsubscribe();
        }
    };
    /**
     * @hidden
     */
    GridComponent.prototype.attachScrollSync = function () {
        var _this = this;
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["c" /* isUniversal */])()) {
            return;
        }
        if (this.header) {
            this.scrollSyncService.registerEmitter(this.header.nativeElement, "header");
        }
        if (this.footer) {
            this.footerChangeSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["f" /* observe */])(this.footer)
                .subscribe(function (footers) {
                return footers
                    .map(function (footer) { return footer.nativeElement; })
                    .filter(__WEBPACK_IMPORTED_MODULE_13__utils__["b" /* isPresent */])
                    .forEach(function (element) {
                    return _this.scrollSyncService.registerEmitter(element, "footer");
                });
            });
        }
    };
    /**
     * Switches the specified table row in the edit mode.
     *
     * @param {number} index - The row index that will be switched in the edit mode.
     * @param {FormGroup} group - The [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html)
     * that describes the edit form.
     */
    GridComponent.prototype.editRow = function (index, group) {
        this.editService.editRow(index, group);
        this.focusEditElement("tr[data-kendo-grid-item-index=\"" + index + "\"]");
    };
    /**
     * Closes the editor for a given row.
     *
     * @param {number} index - The row index that will be switched out of the edit mode. If no index is provided, it is assumed
     * that the new item editor will be closed.
     */
    GridComponent.prototype.closeRow = function (index) {
        this.editService.close(index);
    };
    /**
     * Creates a new row editor.
     *
     * @param {FormGroup} group - The [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html) that describes
     * the edit form. If called with a data item, it will build the `FormGroup` from the data item fields.
     */
    GridComponent.prototype.addRow = function (group) {
        var isFormGroup = group instanceof __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormGroup"];
        if (!isFormGroup) {
            var fields = Object.keys(group).reduce(createControl(group), {}); // FormBuilder?
            group = new __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormGroup"](fields);
        }
        this.editService.addRow(group);
        this.focusEditElement('.k-grid-add-row');
    };
    /**
     * Puts the cell that is specified by the table row and column in edit mode.
     *
     * @param {number} rowIndex - The row index that will be switched in the edit mode.
     * @param {number|string|any} column - The leaf column index, or the field name or the column instance that should be edited.
     * @param {FormGroup} group - The [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html)
     * that describes the edit form.
     */
    GridComponent.prototype.editCell = function (rowIndex, column, group) {
        var instance = this.columnInstance(column);
        this.editService.editCell(rowIndex, instance, group);
        this.focusEditElement('.k-grid-edit-cell');
    };
    /**
     * Closes the current cell in edit mode and fires the `cellClose` event.
     */
    GridComponent.prototype.closeCell = function () {
        this.editService.closeCell();
    };
    /**
     * Closes the current cell in edit mode.
     */
    GridComponent.prototype.cancelCell = function () {
        this.editService.cancelCell();
    };
    /**
     * Initiates the PDF export.
     */
    GridComponent.prototype.saveAsPDF = function () {
        this.pdfService.save(this);
    };
    /**
     * Initiates the Excel export.
     */
    GridComponent.prototype.saveAsExcel = function () {
        this.excelService.save(this);
    };
    /**
     * Applies the minimum possible width for the specified column,
     * so that the whole text fits without wrapping.
     *
     * It makes sense to execute this method only
     * after the Grid is already populated with data.
     *
     * @example
     * ```ts-preview
     * _@Component({
     *    selector: 'my-app',
     *    template: `
     *        <kendo-grid
     *            #grid
     *            [data]="gridData"
     *            [resizable]="true"
     *            style="height: 300px">
     *            <ng-template kendoGridToolbarTemplate>
     *                 <button class="k-button" (click)="grid.autoFitColumn(groupColumn)">
     *                     Auto-fit the group column
     *                 </button>
     *            </ng-template>
     *            <kendo-grid-column-group #groupColumn title="Product Info">
     *                <kendo-grid-column
     *                    field="ProductID"
     *                    [width]="50"
     *                    [minResizableWidth]="30"
     *                    title="ID">
     *                </kendo-grid-column>
     *
     *                <kendo-grid-column
     *                    field="ProductName"
     *                    title="Product Name">
     *                </kendo-grid-column>
     *            </kendo-grid-column-group>
     *
     *            <kendo-grid-column
     *                field="UnitPrice"
     *                title="Unit Price"
     *                [width]="180"
     *                filter="numeric"
     *                format="{0:c}">
     *            </kendo-grid-column>
     *        </kendo-grid>
     *    `
     * })
     * class AppComponent {
     *    public gridData: any[] = products;
     * }
     *
     * const products = [{
     *    "ProductID": 1,
     *    "ProductName": "Chai",
     *    "UnitPrice": 18.0000,
     *    "Discontinued": true
     *  }, {
     *    "ProductID": 2,
     *    "ProductName": "Chang",
     *    "UnitPrice": 19.0000,
     *    "Discontinued": false
     *  }
     * ];
     * ```
     */
    GridComponent.prototype.autoFitColumn = function (column) {
        this.columnResizingService.autoFit(column);
    };
    /**
     * Applies the minimum possible width for the specified columns,
     * so that the whole text fits without wrapping.
     * If no argument is supplied, `autoFitColumns` auto-fits
     * the content of current Grid columns.
     *
     * It makes sense to execute this method only
     * after the Grid is already populated with data.
     *
     * @example
     * ```ts-preview
     * _@Component({
     *    selector: 'my-app',
     *    template: `
     *      <kendo-grid
     *          #grid
     *          [data]="gridData"
     *          [resizable]="true"
     *          style="height: 300px">
     *          <ng-template kendoGridToolbarTemplate>
     *              <button class="k-button" (click)="grid.autoFitColumns([firstColumn, lastColumn])">
     *                  Auto-fit the first and last column
     *              </button>
     *              <button class="k-button" (click)="grid.autoFitColumns()">
     *                  Auto-fit all columns
     *              </button>
     *          </ng-template>
     *          <kendo-grid-column-group title="Product Info">
     *              <kendo-grid-column
     *                  #firstColumn
     *                  field="ProductID"
     *                  [width]="50"
     *                  [minResizableWidth]="30"
     *                  title="ID">
     *              </kendo-grid-column>
     *
     *              <kendo-grid-column
     *                  field="ProductName"
     *                  title="Product Name"
     *                  >
     *              </kendo-grid-column>
     *          </kendo-grid-column-group>
     *
     *          <kendo-grid-column
     *              #lastColumn
     *              field="UnitPrice"
     *              title="Unit Price"
     *              [width]="180"
     *              filter="numeric"
     *              format="{0:c}">
     *          </kendo-grid-column>
     *      </kendo-grid>
     *    `
     * })
     * class AppComponent {
     *    public gridData: any[] = products;
     * }
     *
     * const products = [{
     *    "ProductID": 1,
     *    "ProductName": "Chai",
     *    "UnitPrice": 18.0000,
     *    "Discontinued": true
     *  }, {
     *    "ProductID": 2,
     *    "ProductName": "Chang",
     *    "UnitPrice": 19.0000,
     *    "Discontinued": false
     *  }
     * ];
     * ```
     */
    GridComponent.prototype.autoFitColumns = function (columns) {
        if (columns === void 0) { columns = this.columns; }
        columns.forEach(this.autoFitColumn.bind(this));
    };
    /**
     * @hidden
     */
    GridComponent.prototype.notifyPageChange = function (source, event) {
        if (source === "list" && !this.isVirtual) {
            return;
        }
        this.pageChange.emit(event);
    };
    /**
     * @hidden
     */
    GridComponent.prototype.focusEditElement = function (containerSelector) {
        var _this = this;
        this.ngZone.runOutsideAngular(function () {
            _this.ngZone.onStable.asObservable().take(1).subscribe(function () {
                var wrapper = _this.wrapper.nativeElement;
                if (!_this.setEditFocus(wrapper.querySelector(containerSelector)) && _this.isLocked) {
                    _this.setEditFocus(wrapper.querySelector(".k-grid-content " + containerSelector));
                }
            });
        });
    };
    GridComponent.prototype.initSelectionService = function () {
        if (!this.selectionDirective && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["b" /* isPresent */])(this.defaultSelection)) {
            this.defaultSelection = new __WEBPACK_IMPORTED_MODULE_17__selection_selection_default__["a" /* Selection */](this);
        }
        this.selectionService.init({
            rowSelected: this.rowSelected,
            selectable: this.selectable,
            view: this.view
        });
        if (!this.selectionDirective && !this.selectableSettings.enabled) {
            this.defaultSelection.reset();
        }
    };
    GridComponent.prototype.setEditFocus = function (element) {
        if (element) {
            var focusable = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_42__rendering_common_dom_queries__["d" /* findFocusable */])(element);
            if (focusable) {
                focusable.focus();
                return true;
            }
        }
    };
    GridComponent.prototype.columnInstance = function (column) {
        var instance;
        if (typeof column === 'number') {
            instance = this.columnList.filter(function (item) { return !item.isColumnGroup && !item.hidden; })[column];
        }
        else if (typeof column === 'string') {
            instance = this.columnList.filter(function (item) { return item.field === column; })[0];
        }
        else {
            instance = column;
        }
        if (!instance && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            throw new Error("Invalid column " + column);
        }
        return instance;
    };
    GridComponent.prototype.verifySettings = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            if (this.lockedLeafColumns.length && this.detailTemplate) {
                throw new Error('Having both detail template and locked columns is not supported');
            }
            if (this.lockedLeafColumns.length && !this.nonLockedLeafColumns.length) {
                throw new Error('There should be at least one non locked column');
            }
            if (this.lockedLeafColumns.length && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_39__columns_column_common__["a" /* expandColumns */])(this.columnList.toArray()).filter(function (x) { return !x.width; }).length) {
                throw new Error('Locked columns feature requires all columns to have width set');
            }
            if (this.lockedLeafColumns.length && !this.isScrollable) {
                throw new Error('Locked columns are only supported when scrolling is enabled');
            }
            if (this.columnList.filter(__WEBPACK_IMPORTED_MODULE_11__columns_column_group_component__["a" /* isColumnGroupComponent */]).filter(function (x) { return x.children.length < 2; }).length) {
                throw new Error('ColumnGroupComponent should contain ColumnComponent or CommandColumnComponent');
            }
            if (this.columnList.filter(function (x) { return x.locked && x.parent && !x.parent.isLocked; }).length) {
                throw new Error('Locked child columns require their parent columns to be locked.');
            }
            if ((this.rowHeight || this.detailRowHeight) && !this.isVirtual) {
                throw new Error('Row height and detail row height settings requires virtual scrolling mode to be enabled.');
            }
            validateColumnsField(this.columnList);
        }
    };
    GridComponent.prototype.autoGenerateColumns = function () {
        if (this.shouldGenerateColumns && !this.columns.length && this.view.length) {
            this.columns.reset(Object.keys(this.view.at(0)).map(function (field) {
                var column = new __WEBPACK_IMPORTED_MODULE_10__columns_column_component__["b" /* ColumnComponent */]();
                column.field = field;
                return column;
            }));
        }
    };
    GridComponent.prototype.attachStateChangesEmitter = function () {
        var _this = this;
        this.stateChangeSubscription =
            this.pageChange.map(function (x) { return ({
                filter: _this.filter, group: _this.group, skip: x.skip, sort: _this.sort, take: x.take
            }); })
                .merge(this.sortChange.map(function (sort) { return ({
                filter: _this.filter, group: _this.group, skip: _this.skip, sort: sort, take: _this.pageSize
            }); }))
                .merge(this.groupChange.map(function (group) { return ({
                filter: _this.filter, group: group, skip: _this.skip, sort: _this.sort, take: _this.pageSize
            }); }))
                .merge(this.filterChange.map(function (filter) { return ({
                filter: filter, group: _this.group, skip: 0, sort: _this.sort, take: _this.pageSize
            }); }))
                .subscribe(function (x) {
                _this.closeCell();
                _this.cancelCell();
                _this.dataStateChange.emit(x);
            });
    };
    GridComponent.prototype.attachEditHandlers = function () {
        if (!this.editService) {
            return;
        }
        this.editServiceSubscription = this.editService
            .changes.subscribe(this.emitCRUDEvent.bind(this));
    };
    GridComponent.prototype.emitCRUDEvent = function (args) {
        var action = args.action, rowIndex = args.rowIndex, formGroup = args.formGroup;
        var dataItem = this.view.at(rowIndex - this.skip);
        if (action !== 'add' && !dataItem) {
            dataItem = formGroup.value;
        }
        this.closeCell();
        Object.assign(args, {
            dataItem: dataItem,
            sender: this
        });
        switch (action) {
            case 'add':
                this.add.emit(args);
                break;
            case 'cancel':
                this.cancel.emit(args);
                break;
            case 'edit':
                this.edit.emit(args);
                break;
            case 'remove':
                this.remove.emit(args);
                break;
            case 'save':
                this.save.emit(args);
                break;
            case 'cellClose':
                this.cellClose.emit(args);
                break;
            default: break;
        }
    };
    GridComponent.prototype.attachDomEventHandlers = function () {
        var _this = this;
        this.cellClickSubscription = this.domEvents.cellClick.subscribe(function (args) {
            _this.cellClick.emit(Object.assign({ sender: _this }, args));
        });
    };
    GridComponent.prototype.isHidden = function (c) {
        return c.hidden || (c.parent && this.isHidden(c.parent));
    };
    GridComponent.prototype.matchesMedia = function (c) {
        var matches = this.responsiveService.matchesMedia(c.media);
        return matches && (!c.parent || this.matchesMedia(c.parent));
    };
    GridComponent.prototype.resizeCheck = function () {
        var _this = this;
        if (window.innerWidth !== this.cachedWindowWidth && this.columnsContainer.refresh()) {
            this.ngZone.run(function () {
                _this.cachedWindowWidth = window.innerWidth;
                _this.verifySettings();
            });
        }
    };
    GridComponent.prototype.emitPDFExportEvent = function () {
        var args = new __WEBPACK_IMPORTED_MODULE_33__pdf_pdf_export_event__["a" /* PDFExportEvent */]();
        this.pdfExport.emit(args);
        if (!args.isDefaultPrevented()) {
            this.saveAsPDF();
        }
    };
    GridComponent.prototype.columnsContainerChange = function () {
        var _this = this;
        this.columnsContainerChangeSubscription = this.columnsContainer.changes
            .filter(function () { return _this.lockedColumns.length > 0; })
            .switchMap(function () { return _this.ngZone.onStable.asObservable().take(1); })
            .filter(function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["b" /* isPresent */])(_this.lockedHeader); })
            .subscribe(function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_27__layout_row_sync__["a" /* syncRowsHeight */])(_this.lockedHeader.nativeElement.children[0], _this.header.nativeElement.children[0]);
        });
    };
    GridComponent.prototype.notifyResize = function (e) {
        var args = e.resizedColumns
            .filter(function (item) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__utils__["g" /* isTruthy */])(item.column.resizable) && !item.column.isColumnGroup; })
            .map(function (item) { return ({
            column: item.column,
            newWidth: item.column.width,
            oldWidth: item.oldWidth
        }); });
        this.columnResize.emit(args);
    };
    return GridComponent;
}());

GridComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoGrid',
                providers: [
                    __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    __WEBPACK_IMPORTED_MODULE_14__layout_browser_support_service__["a" /* BrowserSupportService */],
                    __WEBPACK_IMPORTED_MODULE_16__selection_selection_service__["a" /* SelectionService */],
                    __WEBPACK_IMPORTED_MODULE_19__rendering_details_details_service__["a" /* DetailsService */],
                    __WEBPACK_IMPORTED_MODULE_20__grouping_groups_service__["a" /* GroupsService */],
                    __WEBPACK_IMPORTED_MODULE_22__grouping_group_info_service__["a" /* GroupInfoService */],
                    __WEBPACK_IMPORTED_MODULE_23__grouping_group_connection_service__["a" /* GroupConnectionService */],
                    __WEBPACK_IMPORTED_MODULE_24__data_change_notification_service__["a" /* ChangeNotificationService */],
                    __WEBPACK_IMPORTED_MODULE_18__editing_edit_service__["a" /* EditService */],
                    __WEBPACK_IMPORTED_MODULE_32__pdf_pdf_service__["a" /* PDFService */],
                    __WEBPACK_IMPORTED_MODULE_34__scrolling_suspend_service__["a" /* SuspendService */],
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_28__rendering_common_cell_context__["a" /* CELL_CONTEXT */],
                        useValue: __WEBPACK_IMPORTED_MODULE_28__rendering_common_cell_context__["b" /* EMPTY_CELL_CONTEXT */]
                    },
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */],
                        useValue: 'kendo.grid'
                    },
                    __WEBPACK_IMPORTED_MODULE_29__filtering_filter_service__["a" /* FilterService */],
                    __WEBPACK_IMPORTED_MODULE_35__layout_responsive_service__["a" /* ResponsiveService */],
                    __WEBPACK_IMPORTED_MODULE_31__pager_pager_context_service__["a" /* PagerContextService */],
                    __WEBPACK_IMPORTED_MODULE_36__excel_excel_service__["a" /* ExcelService */],
                    __WEBPACK_IMPORTED_MODULE_40__scrolling_scroll_sync_service__["a" /* ScrollSyncService */],
                    __WEBPACK_IMPORTED_MODULE_41__layout_resize_service__["a" /* ResizeService */],
                    __WEBPACK_IMPORTED_MODULE_43__editing_local_data_changes_service__["a" /* LocalDataChangesService */],
                    __WEBPACK_IMPORTED_MODULE_44__common_dom_events_service__["a" /* DomEventsService */],
                    __WEBPACK_IMPORTED_MODULE_45__column_resizing_column_resizing_service__["a" /* ColumnResizingService */],
                    __WEBPACK_IMPORTED_MODULE_46__filtering_menu_single_popup_service__["a" /* SinglePopupService */]
                ],
                selector: 'kendo-grid',
                template: "\n        <ng-container kendoGridLocalizedMessages\n            i18n-groupPanelEmpty=\"kendo.grid.groupPanelEmpty|The label visible in the Grid group panel when it is empty\"\n            groupPanelEmpty=\"Drag a column header and drop it here to group by that column\"\n\n            i18n-noRecords=\"kendo.grid.noRecords|The label visible in the Grid when there are no records\"\n            noRecords=\"No records available.\"\n\n            i18n-pagerFirstPage=\"kendo.grid.pagerFirstPage|The label for the first page button in Grid pager\"\n            pagerFirstPage=\"Go to the first page\"\n\n            i18n-pagerPreviousPage=\"kendo.grid.pagerPreviousPage|The label for the previous page button in Grid pager\"\n            pagerPreviousPage=\"Go to the previous page\"\n\n            i18n-pagerNextPage=\"kendo.grid.pagerNextPage|The label for the next page button in Grid pager\"\n            pagerNextPage=\"Go to the next page\"\n\n            i18n-pagerLastPage=\"kendo.grid.pagerLastPage|The label for the last page button in Grid pager\"\n            pagerLastPage=\"Go to the last page\"\n\n            i18n-pagerPage=\"kendo.grid.pagerPage|The label before the current page number in the Grid pager\"\n            pagerPage=\"Page\"\n\n            i18n-pagerOf=\"kendo.grid.pagerOf|The label before the total pages number in the Grid pager\"\n            pagerOf=\"of\"\n\n            i18n-pagerItems=\"kendo.grid.pagerItems|The label after the total pages number in the Grid pager\"\n            pagerItems=\"items\"\n\n            i18n-pagerItemsPerPage=\"kendo.grid.pagerItemsPerPage|The label for the page size chooser in the Grid pager\"\n            pagerItemsPerPage=\"items per page\"\n\n            i18n-filterEqOperator=\"kendo.grid.filterEqOperator|The text of the equal filter operator\"\n            filterEqOperator=\"Is equal to\"\n\n            i18n-filterNotEqOperator=\"kendo.grid.filterNotEqOperator|The text of the not equal filter operator\"\n            filterNotEqOperator=\"Is not equal to\"\n\n            i18n-filterIsNullOperator=\"kendo.grid.filterIsNullOperator|The text of the is null filter operator\"\n            filterIsNullOperator=\"Is null\"\n\n            i18n-filterIsNotNullOperator=\"kendo.grid.filterIsNotNullOperator|The text of the is not null filter operator\"\n            filterIsNotNullOperator=\"Is not null\"\n\n            i18n-filterIsEmptyOperator=\"kendo.grid.filterIsEmptyOperator|The text of the is empty filter operator\"\n            filterIsEmptyOperator=\"Is empty\"\n\n            i18n-filterIsNotEmptyOperator=\"kendo.grid.filterIsNotEmptyOperator|The text of the is not empty filter operator\"\n            filterIsNotEmptyOperator=\"Is not empty\"\n\n            i18n-filterStartsWithOperator=\"kendo.grid.filterStartsWithOperator|The text of the starts with filter operator\"\n            filterStartsWithOperator=\"Starts with\"\n\n            i18n-filterContainsOperator=\"kendo.grid.filterContainsOperator|The text of the contains filter operator\"\n            filterContainsOperator=\"Contains\"\n\n            i18n-filterNotContainsOperator=\"kendo.grid.filterNotContainsOperator|The text of the does not contain filter operator\"\n            filterNotContainsOperator=\"Does not contain\"\n\n            i18n-filterEndsWithOperator=\"kendo.grid.filterEndsWithOperator|The text of the ends with filter operator\"\n            filterEndsWithOperator=\"Ends with\"\n\n            i18n-filterGteOperator=\"kendo.grid.filterGteOperator|The text of the greater than or equal filter operator\"\n            filterGteOperator=\"Is greater than or equal to\"\n\n            i18n-filterGtOperator=\"kendo.grid.filterGtOperator|The text of the greater than filter operator\"\n            filterGtOperator=\"Is greater than\"\n\n            i18n-filterLteOperator=\"kendo.grid.filterLteOperator|The text of the less than or equal filter operator\"\n            filterLteOperator=\"Is less than or equal to\"\n\n            i18n-filterLtOperator=\"kendo.grid.filterLtOperator|The text of the less than filter operator\"\n            filterLtOperator=\"Is less than\"\n\n            i18n-filterIsTrue=\"kendo.grid.filterIsTrue|The text of the IsTrue boolean filter option\"\n            filterIsTrue=\"Is True\"\n\n            i18n-filterIsFalse=\"kendo.grid.filterIsFalse|The text of the IsFalse boolean filter option\"\n            filterIsFalse=\"Is False\"\n\n            i18n-filterBooleanAll=\"kendo.grid.filterBooleanAll|The text of the (All) boolean filter option\"\n            filterBooleanAll=\"(All)\"\n\n            i18n-filterAfterOrEqualOperator=\"kendo.grid.filterAfterOrEqualOperator|The text of the after or equal date filter operator\"\n            filterAfterOrEqualOperator=\"Is after or equal to\"\n\n            i18n-filterAfterOperator=\"kendo.grid.filterAfterOperator|The text of the after date filter operator\"\n            filterAfterOperator=\"Is after\"\n\n            i18n-filterBeforeOperator=\"kendo.grid.filterBeforeOperator|The text of the before date filter operator\"\n            filterBeforeOperator=\"Is before\"\n\n            i18n-filterBeforeOrEqualOperator=\"kendo.grid.filterBeforeOrEqualOperator|The text of the before or equal date filter operator\"\n            filterBeforeOrEqualOperator=\"Is before or equal to\"\n        >\n        </ng-container>\n        <kendo-grid-toolbar *ngIf=\"showTopToolbar\"></kendo-grid-toolbar>\n        <kendo-grid-group-panel\n            *ngIf=\"showGroupPanel\"\n            [text]=\"groupable.emptyText\"\n            [groups]=\"group\"\n            (change)=\"groupChange.emit($event)\">\n        </kendo-grid-group-panel>\n        <ng-template [ngIf]=\"isScrollable\">\n            <div\n                class=\"k-grid-header\"\n                [style.padding]=\"headerPadding\">\n                <div class=\"k-grid-header-locked\" #lockedHeader\n                    *ngIf=\"isLocked\"\n                     [style.width.px]=\"lockedWidth\">\n                    <table [locked]=\"true\">\n                        <colgroup kendoGridColGroup\n                            [columns]=\"lockedLeafColumns\"\n                            [groups]=\"group\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </colgroup>\n                        <thead kendoGridHeader\n                            [resizable]=\"resizable\"\n                            [scrollable]=\"true\"\n                            [columns]=\"lockedColumns\"\n                            [totalColumnLevels]=\"totalColumnLevels\"\n                            [sort]=\"sort\"\n                            [groups]=\"group\"\n                            [filter]=\"filter\"\n                            [filterable]=\"filterable\"\n                            [groupable]=\"showGroupPanel\"\n                            [sortable]=\"sortable\"\n                            (sortChange)=\"sortChange.emit($event)\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </thead>\n                    </table>\n                </div><div class=\"k-grid-header-wrap\" #header\n                    [kendoGridResizableContainer]=\"lockedLeafColumns.length\"\n                    [lockedWidth]=\"lockedWidth + scrollbarWidth + 2\">\n                    <table [style.width.px]=\"nonLockedWidth\">\n                        <colgroup kendoGridColGroup\n                            [columns]=\"nonLockedLeafColumns\"\n                            [groups]=\"isLocked ? [] : group\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </colgroup>\n                        <thead kendoGridHeader\n                            [resizable]=\"resizable\"\n                            [scrollable]=\"true\"\n                            [columns]=\"nonLockedColumns\"\n                            [totalColumnLevels]=\"totalColumnLevels\"\n                            [sort]=\"sort\"\n                            [filter]=\"filter\"\n                            [filterable]=\"filterable\"\n                            [groupable]=\"showGroupPanel\"\n                            [groups]=\"isLocked ? [] : group\"\n                            [sortable]=\"sortable\"\n                            [lockedColumnsCount]=\"lockedLeafColumns.length\"\n                            (sortChange)=\"sortChange.emit($event)\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </thead>\n                    </table>\n                </div>\n            </div>\n            <kendo-grid-list\n                [data]=\"view\"\n                [rowHeight]=\"rowHeight\"\n                [detailRowHeight]=\"detailRowHeight\"\n                [total]=\"isVirtual ? view.total : pageSize\"\n                [take]=\"pageSize\"\n                [groups]=\"group\"\n                [groupable]=\"groupable\"\n                [skip]=\"skip\"\n                [columns]=\"columnsContainer\"\n                [selectable]=\"selectable\"\n                [detailTemplate]=\"detailTemplate\"\n                [noRecordsTemplate]=\"noRecordsTemplate\"\n                (pageChange)=\"notifyPageChange('list', $event)\"\n                [rowClass]=\"rowClass\">\n            </kendo-grid-list>\n            <div\n                *ngIf=\"showFooter\"\n                class=\"k-grid-footer\"\n                [style.padding]=\"headerPadding\">\n                <div\n                    *ngIf=\"lockedLeafColumns.length\"\n                    class=\"k-grid-footer-locked\"\n                    [style.width.px]=\"lockedWidth\">\n                    <table [locked]=\"true\">\n                        <colgroup kendoGridColGroup\n                            [columns]=\"lockedLeafColumns\"\n                            [groups]=\"group\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </colgroup>\n                        <tfoot kendoGridFooter\n                            [scrollable]=\"true\"\n                            [groups]=\"group\"\n                            [columns]=\"lockedLeafColumns\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </tfoot>\n                    </table>\n                </div><div #footer\n                    class=\"k-grid-footer-wrap\"\n                    [kendoGridResizableContainer]=\"lockedLeafColumns.length\"\n                    [lockedWidth]=\"lockedWidth + scrollbarWidth + 3\">\n                    <table [style.width.px]=\"nonLockedWidth\">\n                        <colgroup kendoGridColGroup\n                            [columns]=\"nonLockedLeafColumns\"\n                            [groups]=\"isLocked ? [] : group\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </colgroup>\n                        <tfoot kendoGridFooter\n                            [scrollable]=\"true\"\n                            [groups]=\"isLocked ? [] : group\"\n                            [columns]=\"nonLockedLeafColumns\"\n                            [lockedColumnsCount]=\"lockedLeafColumns.length\"\n                            [detailTemplate]=\"detailTemplate\">\n                        </tfoot>\n                    </table>\n                </div>\n            </div>\n        </ng-template>\n        <ng-template [ngIf]=\"!isScrollable\">\n            <table>\n                <colgroup kendoGridColGroup\n                    [columns]=\"leafColumns\"\n                    [groups]=\"group\"\n                    [detailTemplate]=\"detailTemplate\">\n                </colgroup>\n                <thead kendoGridHeader\n                    [resizable]=\"resizable\"\n                    [scrollable]=\"false\"\n                    [columns]=\"visibleColumns\"\n                    [totalColumnLevels]=\"totalColumnLevels\"\n                    [groups]=\"group\"\n                    [groupable]=\"showGroupPanel\"\n                    [sort]=\"sort\"\n                    [sortable]=\"sortable\"\n                    [filter]=\"filter\"\n                    [filterable]=\"filterable\"\n                    (sortChange)=\"sortChange.emit($event)\"\n                    [detailTemplate]=\"detailTemplate\">\n                </thead>\n                <tbody kendoGridTableBody\n                    [groups]=\"group\"\n                    [data]=\"view\"\n                    [skip]=\"skip\"\n                    [columns]=\"leafColumns\"\n                    [selectable]=\"selectable\"\n                    [noRecordsTemplate]=\"noRecordsTemplate\"\n                    [detailTemplate]=\"detailTemplate\"\n                    [rowClass]=\"rowClass\">\n                </tbody>\n                <tfoot kendoGridFooter\n                    *ngIf=\"showFooter\"\n                    [scrollable]=\"false\"\n                    [groups]=\"group\"\n                    [columns]=\"leafColumns\"\n                    [detailTemplate]=\"detailTemplate\">\n                </tfoot>\n            </table>\n        </ng-template>\n        <kendo-pager\n            *ngIf=\"showPager\"\n            [template]=\"pagerTemplate\"\n            [pageSize]=\"pageSize\"\n            [total]=\"view.total\"\n            [skip]=\"skip\"\n            [options]=\"pageable\"\n            (pageChange)=\"notifyPageChange('pager', $event)\">\n        </kendo-pager>\n        <kendo-grid-toolbar *ngIf=\"showBottomToolbar\"></kendo-grid-toolbar>\n    "
            },] },
];
/** @nocollapse */
GridComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_14__layout_browser_support_service__["a" /* BrowserSupportService */], },
    { type: __WEBPACK_IMPORTED_MODULE_16__selection_selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_22__grouping_group_info_service__["a" /* GroupInfoService */], },
    { type: __WEBPACK_IMPORTED_MODULE_20__grouping_groups_service__["a" /* GroupsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_24__data_change_notification_service__["a" /* ChangeNotificationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_19__rendering_details_details_service__["a" /* DetailsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_18__editing_edit_service__["a" /* EditService */], },
    { type: __WEBPACK_IMPORTED_MODULE_29__filtering_filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_32__pdf_pdf_service__["a" /* PDFService */], },
    { type: __WEBPACK_IMPORTED_MODULE_35__layout_responsive_service__["a" /* ResponsiveService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_36__excel_excel_service__["a" /* ExcelService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_40__scrolling_scroll_sync_service__["a" /* ScrollSyncService */], },
    { type: __WEBPACK_IMPORTED_MODULE_44__common_dom_events_service__["a" /* DomEventsService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_45__column_resizing_column_resizing_service__["a" /* ColumnResizingService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
]; };
GridComponent.propDecorators = {
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageSize': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'height': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailRowHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skip': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'scrollable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selectable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'sort': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'group': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'sortable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groupable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowSelected': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'resizable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'pageChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'groupChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'sortChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'selectionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'dataStateChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'groupExpand': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'groupCollapse': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'detailExpand': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'detailCollapse': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'edit': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'cancel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'save': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'remove': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'add': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'cellClose': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'cellClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'pdfExport': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'excelExport': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'columnResize': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_26__columns_column_base__["a" /* ColumnBase */],] },],
    'dir': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid',] },],
    'lockedClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-lockedcolumns',] },],
    'virtualClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-virtual',] },],
    'columnResizing': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-column-resizing',] },],
    'noScrollbarClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-no-scrollbar',] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_12__rendering_details_detail_template_directive__["a" /* DetailTemplateDirective */],] },],
    'noRecordsTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_25__rendering_no_records_template_directive__["a" /* NoRecordsTemplateDirective */],] },],
    'pagerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_30__pager_pager_template_directive__["a" /* PagerTemplateDirective */],] },],
    'toolbarTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_38__rendering_toolbar_toolbar_template_directive__["a" /* ToolbarTemplateDirective */],] },],
    'lockedHeader': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["lockedHeader",] },],
    'header': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["header",] },],
    'footer': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: ["footer",] },],
};


/***/ }),
/* 35 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isSpanColumn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isCheckboxColumn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnBase; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__rendering_header_header_template_directive__ = __webpack_require__(198);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_footer_footer_template_directive__ = __webpack_require__(197);



/**
 * @hidden
 */
var isSpanColumn = function (column) { return column.isSpanColumn; };
/**
 * @hidden
 */
var isCheckboxColumn = function (column) { return column.isCheckboxColumn; };
var isColumnContainer = function (column) { return column.isColumnGroup || isSpanColumn(column); };
/**
 * @hidden
 */
var ColumnBase = (function () {
    function ColumnBase(parent) {
        this.parent = parent;
        /**
         * @hidden
         */
        this.isColumnGroup = false;
        /**
         * @hidden
         */
        this.isSpanColumn = false;
        /**
         * Indicates whether the column is resizable or not.
         * @default true
         */
        this.resizable = true;
        /**
         * The width (in pixels) below which the user is not able to resize the column by using the UI.
         */
        this.minResizableWidth = 10;
        /**
         * @hidden
         */
        this.headerTemplates = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        if (parent && !isColumnContainer(parent)) {
            throw new Error('Columns can be nested only inside ColumnGroupComponent');
        }
    }
    Object.defineProperty(ColumnBase.prototype, "width", {
        get: function () { return this._width; },
        /**
         * The width of the column (in pixels).
         */
        set: function (value) {
            this._width = parseInt(value, 10);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnBase.prototype, "level", {
        /**
         * @hidden
         */
        get: function () {
            if (this.parent && isSpanColumn(this.parent)) {
                return this.parent.level;
            }
            return this.parent ? this.parent.level + 1 : 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnBase.prototype, "isLocked", {
        /**
         * @hidden
         */
        get: function () {
            return this.parent ? this.parent.isLocked : this.locked;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnBase.prototype, "colspan", {
        /**
         * @hidden
         */
        get: function () {
            return 1;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    ColumnBase.prototype.rowspan = function (totalColumnLevels) {
        return this.level < totalColumnLevels ? (totalColumnLevels - this.level) + 1 : 1;
    };
    Object.defineProperty(ColumnBase.prototype, "headerTemplateRef", {
        /**
         * @hidden
         */
        get: function () {
            var template = this.headerTemplates.first;
            return template ? template.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnBase.prototype, "footerTemplateRef", {
        /**
         * @hidden
         */
        get: function () {
            return this.footerTemplate ? this.footerTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnBase.prototype, "displayTitle", {
        get: function () {
            return this.title;
        },
        enumerable: true,
        configurable: true
    });
    return ColumnBase;
}());

ColumnBase.propDecorators = {
    'resizable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'minResizableWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'width': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'locked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'hidden': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'media': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'style': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'headerStyle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'footerStyle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'cssClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ['class',] },],
    'headerClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'footerClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'headerTemplates': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_1__rendering_header_header_template_directive__["a" /* HeaderTemplateDirective */], { descendants: false },] },],
    'footerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_footer_footer_template_directive__["a" /* FooterTemplateDirective */],] },],
};


/***/ }),
/* 36 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EditService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cell_close_event__ = __webpack_require__(570);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_debounceTime__ = __webpack_require__(244);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_debounceTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_debounceTime__);





/**
 * @hidden
 */
var isEqual = function (index) { return function (item) { return item.index === index; }; };
/**
 * @hidden
 */
var isNotEqual = function (index) { return function (item) { return item.index !== index; }; };
/**
 * @hidden
 */
var isNewRow = function (index) { return index === -1 || index === undefined; };
/**
 * @hidden
 */
var EditService = (function () {
    function EditService(ngZone) {
        this.ngZone = ngZone;
        this.changes = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.editedIndices = [];
        this.keepEditCell = false;
        this.closingCell = false;
        this.changedSource = new __WEBPACK_IMPORTED_MODULE_3_rxjs_Subject__["Subject"]();
        this.changed = this.changedSource.asObservable().debounceTime(0);
    }
    EditService.prototype.editRow = function (index, group) {
        if (group === void 0) { group = undefined; }
        this.editedIndices.push({ index: index, group: group });
        this.onChanged();
    };
    EditService.prototype.addRow = function (group) {
        this.newItemGroup = { group: group };
        this.onChanged();
    };
    EditService.prototype.editCell = function (rowIndex, column, group) {
        if (isNewRow(rowIndex) || column.editable === false || !(column.editTemplate || column.field)) {
            return;
        }
        this.preventCellClose();
        if (!this.closeCell()) {
            this.editRow(rowIndex, group);
            this.column = column;
            this.onChanged();
        }
    };
    Object.defineProperty(EditService.prototype, "hasNewItem", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.newItemGroup);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(EditService.prototype, "newDataItem", {
        get: function () {
            if (this.hasNewItem) {
                return this.newItemGroup.group.value;
            }
            return {};
        },
        enumerable: true,
        configurable: true
    });
    EditService.prototype.close = function (index) {
        if (isNewRow(index)) {
            this.newItemGroup = undefined;
            return;
        }
        this.editedIndices = this.editedIndices.filter(isNotEqual(index));
        delete this.column;
        this.onChanged();
    };
    EditService.prototype.closeCell = function (originalEvent) {
        var _this = this;
        if (this.column && !this.closingCell) {
            return this.ngZone.run(function () {
                var _a = _this.editedIndices[0], index = _a.index, group = _a.group;
                var args = new __WEBPACK_IMPORTED_MODULE_2__cell_close_event__["a" /* CellCloseEvent */]({
                    column: _this.column,
                    formGroup: group,
                    originalEvent: originalEvent,
                    rowIndex: index
                });
                _this.closingCell = true;
                _this.changes.emit(args);
                _this.closingCell = false;
                if (!args.isDefaultPrevented()) {
                    _this.cancelCell();
                }
                return args.isDefaultPrevented();
            });
        }
    };
    EditService.prototype.cancelCell = function () {
        if (this.column) {
            this.editedIndices = [];
            delete this.column;
            this.onChanged();
        }
    };
    EditService.prototype.shouldCloseCell = function () {
        return this.column && !this.keepEditCell;
    };
    EditService.prototype.preventCellClose = function () {
        var _this = this;
        this.ngZone.runOutsideAngular(function () {
            window.clearTimeout(_this.keepCellTimeout);
            _this.keepEditCell = true;
            _this.keepCellTimeout = window.setTimeout(function () {
                _this.keepEditCell = false;
            }, 0); // tslint:disable-line:align
        });
    };
    EditService.prototype.context = function (index) {
        if (isNewRow(index)) {
            return this.newItemGroup;
        }
        return this.findByIndex(index);
    };
    EditService.prototype.columnContext = function (index, column) {
        if (isNewRow(index)) {
            return this.newItemGroup;
        }
        if (!this.column || column === this.column) {
            return this.findByIndex(index);
        }
    };
    EditService.prototype.isEdited = function (index) {
        if (isNewRow(index) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.newItemGroup)) {
            return true;
        }
        return !this.column && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.findByIndex(index));
    };
    EditService.prototype.hasEdited = function (index) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.context(index));
    };
    EditService.prototype.isEditedColumn = function (index, column) {
        if (this.column && this.column === column) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.findByIndex(index));
        }
        return false;
    };
    EditService.prototype.beginEdit = function (rowIndex) {
        this.changes.emit({ action: 'edit', rowIndex: rowIndex });
    };
    EditService.prototype.beginAdd = function () {
        this.changes.emit({ action: 'add' });
    };
    EditService.prototype.endEdit = function (rowIndex) {
        var formGroup = this.context(rowIndex).group;
        this.changes.emit({ action: 'cancel', rowIndex: rowIndex, formGroup: formGroup, isNew: isNewRow(rowIndex) });
    };
    EditService.prototype.save = function (rowIndex) {
        var formGroup = this.context(rowIndex).group;
        this.changes.emit({ action: 'save', rowIndex: rowIndex, formGroup: formGroup, isNew: isNewRow(rowIndex) });
    };
    EditService.prototype.remove = function (rowIndex) {
        this.changes.emit({ action: 'remove', rowIndex: rowIndex });
    };
    EditService.prototype.findByIndex = function (index) {
        return this.editedIndices.find(isEqual(index));
    };
    EditService.prototype.onChanged = function () {
        var _this = this;
        this.ngZone.runOutsideAngular(function () {
            _this.changedSource.next();
        });
    };
    return EditService;
}());

EditService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
EditService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 37 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export flatten */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return filtersByField; });
/* unused harmony export filterByField */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return localizeOperators; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BaseFilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__ = __webpack_require__(75);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_filter_operator_base__ = __webpack_require__(18);




/**
 * @hidden
 */
var flatten = function (filter) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(filter.filters)) {
        return filter.filters.reduce(function (acc, curr) {
            return acc.concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["c" /* isCompositeFilterDescriptor */])(curr) ? flatten(curr) : [curr]);
        }, []);
    }
    return [];
};
var trimFilterByField = function (filter, field) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(filter.filters)) {
        filter.filters = filter.filters.filter(function (x) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["c" /* isCompositeFilterDescriptor */])(x)) {
                trimFilterByField(x, field);
                return x.filters.length;
            }
            else {
                return x.field !== field;
            }
        });
    }
};
/**
 * @hidden
 */
var filtersByField = function (filter, field) {
    return flatten(filter || {}).filter(function (x) { return x.field === field; });
};
/**
 * @hidden
 */
var filterByField = function (filter, field) {
    var currentFilter = filtersByField(filter, field)[0];
    return currentFilter;
};
/**
 * @hidden
 */
var removeFilter = function (filter, field) {
    trimFilterByField(filter, field);
    return filter;
};
/**
 * @hidden
 */
var localizeOperators = function (operators) { return function (localization) { return Object.keys(operators).map(function (key) { return ({
    text: localization.get(key),
    value: operators[key]
}); }); }; };
/**
 * An abstract base class for the filter-cell component.
 */
var BaseFilterCellComponent = (function () {
    function BaseFilterCellComponent(filterService) {
        this.filterService = filterService;
        this.operatorList = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
    }
    Object.defineProperty(BaseFilterCellComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseFilterCellComponent.prototype, "operators", {
        get: function () {
            return this._operators.length ? this._operators : this.defaultOperators;
        },
        set: function (values) {
            this._operators = values;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    BaseFilterCellComponent.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.operationListSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["f" /* observe */])(this.operatorList)
            .map(__WEBPACK_IMPORTED_MODULE_3__operators_filter_operator_base__["b" /* toJSON */])
            .subscribe(function (x) {
            _this.operators = x;
        });
    };
    BaseFilterCellComponent.prototype.ngOnDestroy = function () {
        if (this.operationListSubscription) {
            this.operationListSubscription.unsubscribe();
        }
    };
    BaseFilterCellComponent.prototype.filterByField = function (field) {
        return filterByField(this.filter, field);
    };
    BaseFilterCellComponent.prototype.filtersByField = function (field) {
        return filtersByField(this.filter, field);
    };
    BaseFilterCellComponent.prototype.removeFilter = function (field) {
        return removeFilter(this.filter, field);
    };
    BaseFilterCellComponent.prototype.updateFilter = function (filter) {
        var root = this.filter || {
            filters: [],
            logic: "and"
        };
        var currentFilter = flatten(root).filter(function (x) { return x.field === filter.field; })[0];
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(currentFilter)) {
            root.filters.push(filter);
        }
        else {
            Object.assign(currentFilter, filter);
        }
        return root;
    };
    BaseFilterCellComponent.prototype.applyFilter = function (filter) {
        this.filterService.filter(filter);
    };
    return BaseFilterCellComponent;
}());

BaseFilterCellComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-filtercell',] },],
    'operatorList': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_3__operators_filter_operator_base__["a" /* FilterOperatorBase */],] },],
};


/***/ }),
/* 38 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var NODE_MAP = {};

/* harmony default export */ __webpack_exports__["a"] = (NODE_MAP);
//# sourceMappingURL=node-map.js.map


/***/ }),
/* 39 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = transform;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__transformation__ = __webpack_require__(431);


function transform(matrix) {
    if (matrix === null) {
        return null;
    }

    if (matrix instanceof __WEBPACK_IMPORTED_MODULE_0__transformation__["a" /* default */]) {
        return matrix;
    }

    return new __WEBPACK_IMPORTED_MODULE_0__transformation__["a" /* default */](matrix);
}
//# sourceMappingURL=transform.js.map


/***/ }),
/* 40 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_options_store__ = __webpack_require__(219);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry_rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__geometry_matrix__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry_transform__ = __webpack_require__(39);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__geometry_to_matrix__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(5);









var Element = (function (Class) {
    function Element(options) {
        Class.call(this);

        this._initOptions(options);
    }

    if ( Class ) Element.__proto__ = Class;
    Element.prototype = Object.create( Class && Class.prototype );
    Element.prototype.constructor = Element;

    Element.prototype._initOptions = function _initOptions (options) {
        if ( options === void 0 ) options = {};

        var clip = options.clip;
        var transform = options.transform;

        if (transform) {
            options.transform = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__geometry_transform__["a" /* default */])(transform);
        }

        if (clip && !clip.id) {
            clip.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["j" /* definitionId */])();
        }

        this.options = new __WEBPACK_IMPORTED_MODULE_0__core_options_store__["a" /* default */](options);
        this.options.addObserver(this);
    };

    Element.prototype.transform = function transform (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["e" /* defined */])(value)) {
            this.options.set("transform", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__geometry_transform__["a" /* default */])(value));
        } else {
            return this.options.get("transform");
        }
    };

    Element.prototype.parentTransform = function parentTransform () {
        var element = this;
        var parentMatrix;

        while (element.parent) {
            element = element.parent;
            var transformation = element.transform();
            if (transformation) {
                parentMatrix = transformation.matrix().multiplyCopy(parentMatrix || __WEBPACK_IMPORTED_MODULE_3__geometry_matrix__["a" /* default */].unit());
            }
        }

        if (parentMatrix) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__geometry_transform__["a" /* default */])(parentMatrix);
        }
    };

    Element.prototype.currentTransform = function currentTransform (parentTransform) {
        if ( parentTransform === void 0 ) parentTransform = this.parentTransform();

        var elementTransform = this.transform();
        var elementMatrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__geometry_to_matrix__["a" /* default */])(elementTransform);

        var parentMatrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__geometry_to_matrix__["a" /* default */])(parentTransform);
        var combinedMatrix;

        if (elementMatrix && parentMatrix) {
            combinedMatrix = parentMatrix.multiplyCopy(elementMatrix);
        } else {
            combinedMatrix = elementMatrix || parentMatrix;
        }

        if (combinedMatrix) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__geometry_transform__["a" /* default */])(combinedMatrix);
        }
    };

    Element.prototype.visible = function visible (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["e" /* defined */])(value)) {
            this.options.set("visible", value);
            return this;
        }

        return this.options.get("visible") !== false;
    };

    Element.prototype.clip = function clip (value) {
        var options = this.options;
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["e" /* defined */])(value)) {
            if (value && !value.id) {
                value.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["j" /* definitionId */])();
            }
            options.set("clip", value);
            return this;
        }

        return options.get("clip");
    };

    Element.prototype.opacity = function opacity (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["e" /* defined */])(value)) {
            this.options.set("opacity", value);
            return this;
        }

        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["s" /* valueOrDefault */])(this.options.get("opacity"), 1);
    };

    Element.prototype.clippedBBox = function clippedBBox (transformation) {
        var bbox = this._clippedBBox(transformation);
        if (bbox) {
            var clip = this.clip();
            return clip ? __WEBPACK_IMPORTED_MODULE_2__geometry_rect__["a" /* default */].intersect(bbox, clip.bbox(transformation)) : bbox;
        }
    };

    Element.prototype.containsPoint = function containsPoint (point, parentTransform) {
        if (this.visible()) {
            var transform = this.currentTransform(parentTransform);
            var transformedPoint = point;
            if (transform) {
                transformedPoint = point.transformCopy(transform.matrix().invert());
            }
            return (this._hasFill() && this._containsPoint(transformedPoint)) || (this._isOnPath && this._hasStroke() && this._isOnPath(transformedPoint));
        }
        return false;
    };

    Element.prototype._hasFill = function _hasFill () {
        var fill = this.options.fill;
        return fill && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["t" /* isTransparent */])(fill.color);
    };

    Element.prototype._hasStroke = function _hasStroke () {
        var stroke = this.options.stroke;
        return stroke && stroke.width > 0 && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["t" /* isTransparent */])(stroke.color);
    };

    Element.prototype._clippedBBox = function _clippedBBox (transformation) {
        return this.bbox(transformation);
    };

    return Element;
}(__WEBPACK_IMPORTED_MODULE_6__common__["d" /* Class */]));

Element.prototype.nodeType = "Element";

__WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__["a" /* default */].extend(Element.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Element);

//# sourceMappingURL=element.js.map


/***/ }),
/* 41 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var NODE_MAP = {};

/* harmony default export */ __webpack_exports__["a"] = (NODE_MAP);
//# sourceMappingURL=node-map.js.map


/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(5);

/***/ }),
/* 43 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isPresent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return isChanged; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return guid; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return combineStr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isDocumentAvailable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isArray; });
/* unused harmony export isObject */
/* unused harmony export resolveValuesInArray */
/* unused harmony export validateComplexValues */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return resolveAllValues; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isObjectArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return selectedIndices; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return resolveValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return sameCharsOnly; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return shuffleData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return matchText; });
/* tslint:disable:no-null-keyword */
/* tslint:disable:no-bitwise */
/* tslint:disable:align */
/**
 * @hidden
 */
var isPresent = function (value) { return value !== null && value !== undefined; };
/**
 * @hidden
 */
var isNumber = function (value) { return !isNaN(value); };
/**
 * @hidden
 */
var isChanged = function (propertyName, changes) { return (changes[propertyName] && !changes[propertyName].isFirstChange() &&
    changes[propertyName].previousValue !== changes[propertyName].currentValue); };
/**
 * @hidden
 */
var guid = function () {
    var id = "";
    var i;
    var random;
    for (i = 0; i < 32; i++) {
        random = Math.random() * 16 | 0;
        if (i === 8 || i === 12 || i === 16 || i === 20) {
            id += "-";
        }
        id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
    }
    return id;
};
/**
 * @hidden
 */
var combineStr = function (begin, end) {
    return begin.concat(end.substr(end.toLowerCase().indexOf(begin.toLowerCase()) + begin.length));
};
/**
 * @hidden
 */
var isDocumentAvailable = function () { return typeof document !== 'undefined'; };
/**
 * @hidden
 */
var isArray = function (value) { return Array.isArray(value); };
/**
 * @hidden
 */
var isObject = function (value) { return typeof value === 'object'; };
/**
 * @hidden
 */
var resolveValuesInArray = function (values, data, valueField) {
    if (data === void 0) { data = []; }
    return data.filter(function (curr) {
        return values.some(function (item) { return item === curr[valueField]; });
    });
};
/**
 * @hidden
 */
var validateComplexValues = function (values, valueField) {
    return isArray(values) && values.filter(function (item) {
        return isObject(item) && item[valueField];
    });
};
/**
 * @hidden
 */
var resolveAllValues = function (value, data, valueField) {
    var customValues = validateComplexValues(value, valueField) || [];
    var resolvedValues = resolveValuesInArray(value, data, valueField) || [];
    return resolvedValues.concat(customValues);
};
/**
 * @hidden
 */
var isObjectArray = function (values) {
    return isArray(values) && values.some(function (item) { return isObject(item); });
};
/**
 * @hidden
 */
var selectedIndices = function (values, data, valueField) {
    var extractedValues = data.map(function (item) {
        return isPresent(item[valueField]) ? item[valueField] : item;
    });
    return values.reduce(function (arr, item) {
        var value = isPresent(item[valueField]) ? item[valueField] : item;
        var index = extractedValues.indexOf(value);
        if (index !== -1) {
            arr.push(index);
        }
        return arr;
    }, []);
};
/**
 * @hidden
 */
var getter = function (dataItem, field, usePrimitive) {
    if (usePrimitive === void 0) { usePrimitive = false; }
    if (isPresent(dataItem)) {
        if (usePrimitive) {
            return field && isPresent(dataItem[field]) ? dataItem[field] : dataItem;
        }
        else {
            return field ? dataItem[field] : dataItem;
        }
    }
};
/**
 * @hidden
 */
var resolveValue = function (args) {
    var dataItem;
    if (isPresent(args.value)) {
        dataItem = args.data.find(function (element) { return getter(element, args.valueField) === args.value; });
        return {
            dataItem: dataItem,
            focused: args.data.indexOf(dataItem),
            selected: args.data.indexOf(dataItem)
        };
    }
    else if (args.index) {
        dataItem = args.data[args.index];
        return {
            dataItem: args.data[args.index],
            focused: args.index,
            selected: args.index
        };
    }
    return {
        dataItem: args.defaultItem,
        focused: -1,
        selected: -1
    };
};
/**
 * @hidden
 */
var sameCharsOnly = function (word, character) {
    for (var idx = 0; idx < word.length; idx++) {
        if (word.charAt(idx) !== character) {
            return false;
        }
    }
    return true;
};
/**
 * @hidden
 */
var shuffleData = function (data, splitIndex, defaultItem) {
    var result = data;
    if (defaultItem) {
        result = [defaultItem].concat(result);
    }
    return result.slice(splitIndex).concat(result.slice(0, splitIndex));
};
/**
 * @hidden
 */
var matchText = function (text, word, ignoreCase) {
    if (!isPresent(text)) {
        return false;
    }
    var temp = String(text);
    if (ignoreCase) {
        temp = temp.toLowerCase();
    }
    return temp.indexOf(word) === 0;
};


/***/ }),
/* 44 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerContextService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__);

/**
 * @hidden
 */
var PagerContextService = (function () {
    function PagerContextService() {
        this.changes = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__["Subject"]();
        this.pageChange = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__["Subject"]();
    }
    PagerContextService.prototype.notifyChanges = function (changes) {
        this.total = changes.total;
        this.pageSize = changes.pageSize;
        this.skip = changes.skip;
        this.changes.next(changes);
    };
    PagerContextService.prototype.changePage = function (page) {
        this.pageChange.next({ skip: page * this.pageSize, take: this.pageSize });
    };
    PagerContextService.prototype.changePageSize = function (value) {
        this.pageChange.next({ skip: 0, take: value });
    };
    return PagerContextService;
}());



/***/ }),
/* 45 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_base_node__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_render_all_attributes__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_render_attribute__ = __webpack_require__(100);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_render_style__ = __webpack_require__(451);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__node_map__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_render_svg__ = __webpack_require__(452);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(99);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util__ = __webpack_require__(5);










var TRANSFORM = "transform";
var DefinitionMap = {
    clip: "clip-path",
    fill: "fill"
};

function isDefinition(type, value) {
    return type === "clip" || (type === "fill" && (!value || value.nodeType === "Gradient"));
}

function baseUrl() {
    var base = document.getElementsByTagName("base")[0];
    var href = document.location.href;
    var hashIndex = href.indexOf("#");
    var url = "";

    if (base && !__WEBPACK_IMPORTED_MODULE_7__common__["a" /* support */].browser.msie) {
        if (hashIndex !== -1) {
            href = href.substring(0, hashIndex);
        }

        url = href;
    }

    return url;
}

function refUrl(id, skipBaseHref) {
    var base = skipBaseHref ? '' : baseUrl();
    return ("url(" + base + "#" + id + ")");
}

var Node = (function (BaseNode) {
    function Node(srcElement, options) {
        BaseNode.call(this, srcElement);
        this.definitions = {};

        this.options = options;
    }

    if ( BaseNode ) Node.__proto__ = BaseNode;
    Node.prototype = Object.create( BaseNode && BaseNode.prototype );
    Node.prototype.constructor = Node;

    Node.prototype.destroy = function destroy () {
        if (this.element) {
            this.element._kendoNode = null;
            this.element = null;
        }

        this.clearDefinitions();
        BaseNode.prototype.destroy.call(this);
    };

    Node.prototype.load = function load (elements, pos) {
        var this$1 = this;

        for (var i = 0; i < elements.length; i++) {
            var srcElement = elements[i];
            var children = srcElement.children;

            var childNode = new __WEBPACK_IMPORTED_MODULE_4__node_map__["a" /* default */][srcElement.nodeType](srcElement, this$1.options);

            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["e" /* defined */])(pos)) {
                this$1.insertAt(childNode, pos);
            } else {
                this$1.append(childNode);
            }

            childNode.createDefinitions();

            if (children && children.length > 0) {
                childNode.load(children);
            }

            var element = this$1.element;
            if (element) {
                childNode.attachTo(element, pos);
            }
        }
    };

    Node.prototype.root = function root () {
        var root = this;

        while (root.parent) {
            root = root.parent;
        }

        return root;
    };

    Node.prototype.attachTo = function attachTo (domElement, pos) {
        var container = document.createElement("div");
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_render_svg__["a" /* default */])(container,
            "<svg xmlns='" + __WEBPACK_IMPORTED_MODULE_6__constants__["a" /* SVG_NS */] + "' version='1.1'>" +
                this.render() +
            "</svg>"
        );

        var element = container.firstChild.firstChild;
        if (element) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["e" /* defined */])(pos)) {
                domElement.insertBefore(element, domElement.childNodes[pos] || null);
            } else {
                domElement.appendChild(element);
            }
            this.setElement(element);
        }
    };

    Node.prototype.setElement = function setElement (element) {
        if (this.element) {
            this.element._kendoNode = null;
        }

        this.element = element;
        this.element._kendoNode = this;

        var nodes = this.childNodes;
        for (var i = 0; i < nodes.length; i++) {
            var childElement = element.childNodes[i];
            nodes[i].setElement(childElement);
        }
    };

    Node.prototype.clear = function clear () {
        this.clearDefinitions();

        if (this.element) {
            this.element.innerHTML = "";
        }

        var children = this.childNodes;
        for (var i = 0; i < children.length; i++) {
            children[i].destroy();
        }

        this.childNodes = [];
    };

    Node.prototype.removeSelf = function removeSelf () {
        if (this.element) {
            var parentNode = this.element.parentNode;
            if (parentNode) {
                parentNode.removeChild(this.element);
            }
            this.element = null;
        }

        BaseNode.prototype.removeSelf.call(this);
    };

    Node.prototype.template = function template () {
        return this.renderChildren();
    };

    Node.prototype.render = function render () {
        return this.template();
    };

    Node.prototype.renderChildren = function renderChildren () {
        var nodes = this.childNodes;
        var output = "";

        for (var i = 0; i < nodes.length; i++) {
            output += nodes[i].render();
        }

        return output;
    };

    Node.prototype.optionsChange = function optionsChange (e) {
        var field = e.field;
        var value = e.value;

        if (field === "visible") {
            this.css("display", value ? "" : __WEBPACK_IMPORTED_MODULE_6__constants__["b" /* NONE */]);
        } else if (DefinitionMap[field] && isDefinition(field, value)) {
            this.updateDefinition(field, value);
        } else if (field === "opacity") {
            this.attr("opacity", value);
        } else if (field === "cursor") {
            this.css("cursor", value);
        } else if (field === "id") {
            if (value) {
                this.attr("id", value);
            } else {
                this.removeAttr("id");
            }
        }

        BaseNode.prototype.optionsChange.call(this, e);
    };

    Node.prototype.attr = function attr (name, value) {
        if (this.element) {
            this.element.setAttribute(name, value);
        }
    };

    Node.prototype.allAttr = function allAttr (attrs) {
        var this$1 = this;

        for (var i = 0; i < attrs.length; i++) {
            this$1.attr(attrs[i][0], attrs[i][1]);
        }
    };

    Node.prototype.css = function css (name, value) {
        if (this.element) {
            this.element.style[name] = value;
        }
    };

    Node.prototype.allCss = function allCss (styles) {
        var this$1 = this;

        for (var i = 0; i < styles.length; i++) {
            this$1.css(styles[i][0], styles[i][1]);
        }
    };

    Node.prototype.removeAttr = function removeAttr (name) {
        if (this.element) {
            this.element.removeAttribute(name);
        }
    };

    Node.prototype.mapTransform = function mapTransform (transform) {
        var attrs = [];
        if (transform) {
            attrs.push([
                TRANSFORM,
                "matrix(" + transform.matrix().toString(6) + ")"
            ]);
        }

        return attrs;
    };

    Node.prototype.renderTransform = function renderTransform () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_render_all_attributes__["a" /* default */])(
            this.mapTransform(this.srcElement.transform())
        );
    };

    Node.prototype.transformChange = function transformChange (value) {
        if (value) {
            this.allAttr(this.mapTransform(value));
        } else {
            this.removeAttr(TRANSFORM);
        }
    };

    Node.prototype.mapStyle = function mapStyle () {
        var options = this.srcElement.options;
        var style = [ [ "cursor", options.cursor ] ];

        if (options.visible === false) {
            style.push([ "display", __WEBPACK_IMPORTED_MODULE_6__constants__["b" /* NONE */] ]);
        }

        return style;
    };

    Node.prototype.renderStyle = function renderStyle$1 () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_attribute__["a" /* default */])("style", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_render_style__["a" /* default */])(this.mapStyle(true)));
    };

    Node.prototype.renderOpacity = function renderOpacity () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_attribute__["a" /* default */])("opacity", this.srcElement.options.opacity);
    };

    Node.prototype.renderId = function renderId () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_attribute__["a" /* default */])("id", this.srcElement.options.id);
    };

    Node.prototype.createDefinitions = function createDefinitions () {
        var srcElement = this.srcElement;
        var definitions = this.definitions;
        if (srcElement) {
            var options = srcElement.options;
            var hasDefinitions;

            for (var field in DefinitionMap) {
                var definition = options.get(field);
                if (definition && isDefinition(field, definition)) {
                    definitions[field] = definition;
                    hasDefinitions = true;
                }
            }
            if (hasDefinitions) {
                this.definitionChange({
                    action: "add",
                    definitions: definitions
                });
            }
        }
    };

    Node.prototype.definitionChange = function definitionChange (e) {
        if (this.parent) {
            this.parent.definitionChange(e);
        }
    };

    Node.prototype.updateDefinition = function updateDefinition (type, value) {
        var definitions = this.definitions;
        var current = definitions[type];
        var attr = DefinitionMap[type];
        var definition = {};
        if (current) {
            definition[type] = current;
            this.definitionChange({
                action: "remove",
                definitions: definition
            });
            delete definitions[type];
        }

        if (!value) {
            if (current) {
                this.removeAttr(attr);
            }
        } else {
            definition[type] = value;
            this.definitionChange({
                action: "add",
                definitions: definition
            });
            definitions[type] = value;
            this.attr(attr, this.refUrl(value.id));
        }
    };

    Node.prototype.clearDefinitions = function clearDefinitions () {
        var definitions = this.definitions;

        this.definitionChange({
            action: "remove",
            definitions: definitions
        });
        this.definitions = {};
    };

    Node.prototype.renderDefinitions = function renderDefinitions () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_render_all_attributes__["a" /* default */])(this.mapDefinitions());
    };

    Node.prototype.mapDefinitions = function mapDefinitions () {
        var this$1 = this;

        var definitions = this.definitions;
        var attrs = [];

        for (var field in definitions) {
            attrs.push([ DefinitionMap[field], this$1.refUrl(definitions[field].id) ]);
        }

        return attrs;
    };

    Node.prototype.refUrl = function refUrl$1 (id) {
        var skipBaseHref = (this.options || {}).skipBaseHref;
        return refUrl(id, skipBaseHref);
    };

    return Node;
}(__WEBPACK_IMPORTED_MODULE_0__core_base_node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (Node);
//# sourceMappingURL=node.js.map


/***/ }),
/* 46 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cldr_load__ = __webpack_require__(768);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_0__cldr_load__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cldr_set_data__ = __webpack_require__(771);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__cldr_set_data__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cldr_date_field_name__ = __webpack_require__(763);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr_date_field_name__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__cldr_date_format_names__ = __webpack_require__(473);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__cldr_date_format_names__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__cldr_info__ = __webpack_require__(30);
/* unused harmony reexport cldr */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_4__cldr_info__["c"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__cldr_currency__ = __webpack_require__(762);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_5__cldr_currency__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_5__cldr_currency__["c"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_5__cldr_currency__["d"]; });
/* unused harmony reexport territoryCurrencyCode */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_5__cldr_currency__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__cldr_first_day__ = __webpack_require__(765);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_6__cldr_first_day__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__cldr_number_symbols__ = __webpack_require__(769);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_7__cldr_number_symbols__["a"]; });










//# sourceMappingURL=cldr.js.map


/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var fromEvent_1 = __webpack_require__(934);
Observable_1.Observable.fromEvent = fromEvent_1.fromEvent;
//# sourceMappingURL=fromEvent.js.map

/***/ }),
/* 48 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BusViewService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_century_view_service__ = __webpack_require__(257);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_decade_view_service__ = __webpack_require__(258);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_month_view_service__ = __webpack_require__(259);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_year_view_service__ = __webpack_require__(261);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__models_view_enum__ = __webpack_require__(58);






var services = (_a = {},
    _a[__WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */].month] = __WEBPACK_IMPORTED_MODULE_3__services_month_view_service__["a" /* MonthViewService */],
    _a[__WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */].year] = __WEBPACK_IMPORTED_MODULE_4__services_year_view_service__["a" /* YearViewService */],
    _a[__WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */].decade] = __WEBPACK_IMPORTED_MODULE_2__services_decade_view_service__["a" /* DecadeViewService */],
    _a[__WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */].century] = __WEBPACK_IMPORTED_MODULE_1__services_century_view_service__["a" /* CenturyViewService */],
    _a);
var viewOffset = function (view, offset) {
    var candidate = __WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */][view + offset]];
    return candidate !== undefined ? candidate : view;
};
/**
 * @hidden
 */
var BusViewService = (function () {
    function BusViewService(injector) {
        this.injector = injector;
        this.viewChanged = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.bottom = __WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */].month;
        this.top = __WEBPACK_IMPORTED_MODULE_5__models_view_enum__["a" /* CalendarViewEnum */].century;
    }
    BusViewService.prototype.configure = function (bottom, top) {
        this.bottom = bottom;
        this.top = top;
    };
    BusViewService.prototype.service = function (view) {
        var serviceType = services[view];
        return serviceType ? this.injector.get(serviceType) : null;
    };
    BusViewService.prototype.moveDown = function (view) {
        this.move(view, -1);
    };
    BusViewService.prototype.moveUp = function (view) {
        this.move(view, 1);
    };
    BusViewService.prototype.moveToBottom = function (activeView) {
        if (activeView === this.bottom) {
            return;
        }
        this.viewChanged.emit({ view: this.bottom });
    };
    BusViewService.prototype.canMoveDown = function (view) {
        return this.bottom < view;
    };
    BusViewService.prototype.canMoveUp = function (view) {
        return view < this.top;
    };
    BusViewService.prototype.clamp = function (view) {
        if (view < this.bottom) {
            return this.bottom;
        }
        if (view > this.top) {
            return this.top;
        }
        return view;
    };
    BusViewService.prototype.move = function (view, offset) {
        var candidate = this.clamp(viewOffset(view, offset));
        if (candidate === view) {
            return;
        }
        this.viewChanged.emit({ view: candidate });
    };
    return BusViewService;
}());

BusViewService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
BusViewService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injector"], },
]; };
var _a;


/***/ }),
/* 49 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isColumnComponent;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ColumnComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_cell_template_directive__ = __webpack_require__(68);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grouping_group_header_template_directive__ = __webpack_require__(189);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__editing_edit_template_directive__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__grouping_group_footer_template_directive__ = __webpack_require__(188);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__filtering_cell_filter_cell_template_directive__ = __webpack_require__(179);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__filtering_menu_filter_menu_template_directive__ = __webpack_require__(184);










/**
 * @hidden
 */
function isColumnComponent(column) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__utils__["b" /* isPresent */])(column.field);
}
/**
 * Represents the columns of the Grid.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *    selector: 'my-app',
 *    template: `
 *        <kendo-grid [data]="gridData">
 *          <kendo-grid-column field="ProductID" title="Product ID" width="120">
 *          </kendo-grid-column>
 *          <kendo-grid-column field="ProductName" title="Product Name">
 *          </kendo-grid-column>
 *          <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
 *          </kendo-grid-column>
 *          <kendo-grid-column field="Discontinued" width="120">
 *              <ng-template kendoGridCellTemplate let-dataItem>
 *                  <input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
 *              </ng-template>
 *          </kendo-grid-column>
 *        </kendo-grid>
 *    `
 * })
 *
 * class AppComponent {
 *    public gridData: any[];
 *
 *    constructor() {
 *        this.gridData = products;
 *    }
 * }
 *
 * const products = [{
 *    "ProductID": 1,
 *    "ProductName": "Chai",
 *    "UnitPrice": 18.0000,
 *    "Discontinued": true
 *  }, {
 *    "ProductID": 2,
 *    "ProductName": "Chang",
 *    "UnitPrice": 19.0000,
 *    "Discontinued": false
 *  }
 * ];
 *
 * ```
 */
var ColumnComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ColumnComponent, _super);
    function ColumnComponent(parent) {
        var _this = _super.call(this, parent) || this;
        /**
         * Allows the column headers to be clicked and the `sortChange` event emitted.
         * You have to handle the `sortChange` event yourself and sort the data.
         */
        _this.sortable = true;
        /**
         * Defines the editor type. Used when the column enters the edit mode. The default editor type is `text`.
         *
         * @example
         * ```ts-no-run
         * <kendo-grid>
         *    <kendo-grid-column field="UnitPrice" [editor]="'numeric'">
         *    </kendo-grid-column>
         * </kendo-grid>
         * ```
         */
        _this.editor = 'text';
        /**
         * Defines the filter type that is displayed inside the filter row. The default value is `text`.
         *
         * @example
         * ```ts-no-run
         * <kendo-grid>
         *    <kendo-grid-column field="UnitPrice" [filter]="'numeric'">
         *    </kendo-grid-column>
         * </kendo-grid>
         * ```
         */
        _this.filter = 'text';
        /**
         * Defines if a filter UI will be displayed for this column. The default value is `true`.
         *
         * @example
         * ```ts-no-run
         * <kendo-grid>
         *    <kendo-grid-column field="UnitPrice" [filterable]="false">
         *    </kendo-grid-column>
         * </kendo-grid>
         * ```
         */
        _this.filterable = true;
        /**
         * Defines whether the column is editable. The default value is `true`.
         *
         * @example
         * ```ts-no-run
         * <kendo-grid>
         *    <kendo-grid-column field="UnitPrice" [editable]="false">
         *    </kendo-grid-column>
         * </kendo-grid>
         * ```
         */
        _this.editable = true;
        return _this;
    }
    Object.defineProperty(ColumnComponent.prototype, "templateRef", {
        get: function () {
            return this.template ? this.template.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnComponent.prototype, "groupHeaderTemplateRef", {
        get: function () {
            return this.groupHeaderTemplate ? this.groupHeaderTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnComponent.prototype, "groupFooterTemplateRef", {
        get: function () {
            return this.groupFooterTemplate ? this.groupFooterTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnComponent.prototype, "editTemplateRef", {
        get: function () {
            return this.editTemplate ? this.editTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnComponent.prototype, "filterCellTemplateRef", {
        get: function () {
            return this.filterCellTemplate ? this.filterCellTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnComponent.prototype, "filterMenuTemplateRef", {
        get: function () {
            return this.filterMenuTemplate ? this.filterMenuTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnComponent.prototype, "displayTitle", {
        get: function () {
            return this.title === undefined ? this.field : this.title;
        },
        enumerable: true,
        configurable: true
    });
    return ColumnComponent;
}(__WEBPACK_IMPORTED_MODULE_6__column_base__["a" /* ColumnBase */]));

ColumnComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_6__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return ColumnComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-grid-column',
                template: ""
            },] },
];
/** @nocollapse */
ColumnComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_6__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };
ColumnComponent.propDecorators = {
    'field': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'sortable': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'editor': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'editable': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_cell_template_directive__["a" /* CellTemplateDirective */],] },],
    'groupHeaderTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__grouping_group_header_template_directive__["a" /* GroupHeaderTemplateDirective */],] },],
    'groupFooterTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_5__grouping_group_footer_template_directive__["a" /* GroupFooterTemplateDirective */],] },],
    'editTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_4__editing_edit_template_directive__["a" /* EditTemplateDirective */],] },],
    'filterCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_8__filtering_cell_filter_cell_template_directive__["a" /* FilterCellTemplateDirective */],] },],
    'filterMenuTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_9__filtering_menu_filter_menu_template_directive__["a" /* FilterMenuTemplateDirective */],] },],
};


/***/ }),
/* 50 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SharedModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_column_component__ = __webpack_require__(49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_span_column_component__ = __webpack_require__(172);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_column_group_component__ = __webpack_require__(90);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rendering_footer_footer_template_directive__ = __webpack_require__(197);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rendering_common_col_group_component__ = __webpack_require__(358);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__layout_resizable_directive__ = __webpack_require__(341);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__rendering_common_template_context_directive__ = __webpack_require__(359);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__rendering_details_detail_template_directive__ = __webpack_require__(195);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__common_draggable_directive__ = __webpack_require__(119);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__rendering_common_field_accessor_pipe__ = __webpack_require__(602);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__column_resizing_table_directive__ = __webpack_require__(560);













var exportedModules = [
    __WEBPACK_IMPORTED_MODULE_10__common_draggable_directive__["a" /* DraggableDirective */],
    __WEBPACK_IMPORTED_MODULE_2__columns_column_component__["b" /* ColumnComponent */],
    __WEBPACK_IMPORTED_MODULE_4__columns_column_group_component__["b" /* ColumnGroupComponent */],
    __WEBPACK_IMPORTED_MODULE_5__rendering_footer_footer_template_directive__["a" /* FooterTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_6__rendering_common_col_group_component__["a" /* ColGroupComponent */],
    __WEBPACK_IMPORTED_MODULE_7__layout_resizable_directive__["a" /* ResizableContainerDirective */],
    __WEBPACK_IMPORTED_MODULE_8__rendering_common_template_context_directive__["a" /* TemplateContextDirective */],
    __WEBPACK_IMPORTED_MODULE_11__rendering_common_field_accessor_pipe__["a" /* FieldAccessorPipe */],
    __WEBPACK_IMPORTED_MODULE_9__rendering_details_detail_template_directive__["a" /* DetailTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_3__columns_span_column_component__["b" /* SpanColumnComponent */],
    __WEBPACK_IMPORTED_MODULE_12__column_resizing_table_directive__["a" /* TableDirective */]
];
/**
 * @hidden
 */
var SharedModule = (function () {
    function SharedModule() {
    }
    SharedModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_2__columns_column_component__["b" /* ColumnComponent */],
            __WEBPACK_IMPORTED_MODULE_3__columns_span_column_component__["b" /* SpanColumnComponent */],
            __WEBPACK_IMPORTED_MODULE_4__columns_column_group_component__["b" /* ColumnGroupComponent */],
            __WEBPACK_IMPORTED_MODULE_5__rendering_footer_footer_template_directive__["a" /* FooterTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_9__rendering_details_detail_template_directive__["a" /* DetailTemplateDirective */]
        ];
    };
    return SharedModule;
}());

SharedModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [exportedModules],
                exports: [exportedModules],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"]]
            },] },
];
/** @nocollapse */
SharedModule.ctorParameters = function () { return []; };


/***/ }),
/* 51 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createDate; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adjust_dst__ = __webpack_require__(76);

/**
 * A function which returns a new `Date` instance.
 *
 * @param year - The year value.
 * @param month - The month value.
 * @param day - The day value.
 * @param hours - The hours value.
 * @param minutes - The minutes value.
 * @param seconds - The seconds value.
 * @param milliseconds - milliseconds value.
 * @returns The date instance.
 *
 * @example
 * ```ts-no-run
 * createDate(2016, 0, 15); // 2016-01-15 00:00:00
 * createDate(2016, 0, 15, 22, 22, 20); // 2016-01-15 22:22:20
 * ```
 */
var createDate = function (year, month, day, hours, minutes, seconds, milliseconds) {
    if (hours === void 0) { hours = 0; }
    if (minutes === void 0) { minutes = 0; }
    if (seconds === void 0) { seconds = 0; }
    if (milliseconds === void 0) { milliseconds = 0; }
    var date = new Date(year, month, day, hours, minutes, seconds, milliseconds);
    if (year > -1 && year < 100) {
        date.setFullYear(date.getFullYear() - 1900);
    }
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__adjust_dst__["a" /* adjustDST */])(date, hours);
};


/***/ }),
/* 52 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node__ = __webpack_require__(218);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gradients_linear_gradient__ = __webpack_require__(224);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__gradients_radial_gradient__ = __webpack_require__(225);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__core_constants__ = __webpack_require__(423);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_render_path__ = __webpack_require__(136);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__node_map__ = __webpack_require__(38);









function addGradientStops(gradient, stops) {
    for (var idx = 0; idx < stops.length; idx++) {
        var stop = stops[idx];
        var color = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common__["c" /* parseColor */])(stop.color());

        color.a *= stop.opacity();

        gradient.addColorStop(stop.offset(), color.toCssRgba());
    }
}

var PathNode = (function (Node) {
    function PathNode () {
        Node.apply(this, arguments);
    }

    if ( Node ) PathNode.__proto__ = Node;
    PathNode.prototype = Object.create( Node && Node.prototype );
    PathNode.prototype.constructor = PathNode;

    PathNode.prototype.renderTo = function renderTo (ctx) {
        ctx.save();

        this.setTransform(ctx);
        this.setClip(ctx);
        this.setOpacity(ctx);

        ctx.beginPath();

        this.renderPoints(ctx, this.srcElement);

        this.setLineDash(ctx);
        this.setLineCap(ctx);
        this.setLineJoin(ctx);

        this.setFill(ctx);
        this.setStroke(ctx);

        ctx.restore();
    };

    PathNode.prototype.setFill = function setFill (ctx) {
        var fill = this.srcElement.options.fill;
        var hasFill = false;

        if (fill) {
            if (fill.nodeType === "Gradient") {
                this.setGradientFill(ctx, fill);
                hasFill = true;
            } else if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["t" /* isTransparent */])(fill.color)) {
                ctx.fillStyle = fill.color;

                ctx.save();
                this.globalAlpha(ctx, fill.opacity);
                ctx.fill();
                ctx.restore();

                hasFill = true;
            }
        }

        return hasFill;
    };

    PathNode.prototype.setGradientFill = function setGradientFill (ctx, fill) {
        var bbox = this.srcElement.rawBBox();
        var gradient;

        if (fill instanceof __WEBPACK_IMPORTED_MODULE_3__gradients_linear_gradient__["a" /* default */]) {
            var start = fill.start();
            var end = fill.end();
            gradient = ctx.createLinearGradient(start.x, start.y, end.x, end.y);
        } else if (fill instanceof __WEBPACK_IMPORTED_MODULE_4__gradients_radial_gradient__["a" /* default */]) {
            var center = fill.center();
            gradient = ctx.createRadialGradient(center.x, center.y, 0, center.x, center.y, fill.radius());
        }

        addGradientStops(gradient, fill.stops);

        ctx.save();

        if (!fill.userSpace()) {
            ctx.transform(bbox.width(), 0, 0, bbox.height(), bbox.origin.x, bbox.origin.y);
        }
        ctx.fillStyle = gradient;
        ctx.fill();

        ctx.restore();
    };

    PathNode.prototype.setStroke = function setStroke (ctx) {
        var stroke = this.srcElement.options.stroke;
        if (stroke && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["t" /* isTransparent */])(stroke.color) && stroke.width > 0) {
            ctx.strokeStyle = stroke.color;
            ctx.lineWidth = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["s" /* valueOrDefault */])(stroke.width, 1);

            ctx.save();
            this.globalAlpha(ctx, stroke.opacity);
            ctx.stroke();
            ctx.restore();

            return true;
        }
    };

    PathNode.prototype.dashType = function dashType () {
        var stroke = this.srcElement.options.stroke;
        if (stroke && stroke.dashType) {
            return stroke.dashType.toLowerCase();
        }
    };

    PathNode.prototype.setLineDash = function setLineDash (ctx) {
        var dashType = this.dashType();
        if (dashType && dashType !== __WEBPACK_IMPORTED_MODULE_5__core_constants__["a" /* SOLID */]) {
            var dashArray = __WEBPACK_IMPORTED_MODULE_5__core_constants__["b" /* DASH_ARRAYS */][dashType];
            if (ctx.setLineDash) {
                ctx.setLineDash(dashArray);
            } else {
                ctx.mozDash = dashArray;
                ctx.webkitLineDash = dashArray;
            }
        }
    };

    PathNode.prototype.setLineCap = function setLineCap (ctx) {
        var dashType = this.dashType();
        var stroke = this.srcElement.options.stroke;
        if (dashType && dashType !== __WEBPACK_IMPORTED_MODULE_5__core_constants__["a" /* SOLID */]) {
            ctx.lineCap = __WEBPACK_IMPORTED_MODULE_5__core_constants__["c" /* BUTT */];
        } else if (stroke && stroke.lineCap) {
            ctx.lineCap = stroke.lineCap;
        }
    };

    PathNode.prototype.setLineJoin = function setLineJoin (ctx) {
        var stroke = this.srcElement.options.stroke;
        if (stroke && stroke.lineJoin) {
            ctx.lineJoin = stroke.lineJoin;
        }
    };

    PathNode.prototype.renderPoints = function renderPoints (ctx, path) {
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__utils_render_path__["a" /* default */])(ctx, path);
    };

    return PathNode;
}(__WEBPACK_IMPORTED_MODULE_0__node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_7__node_map__["a" /* default */].Path = PathNode;

/* harmony default export */ __webpack_exports__["a"] = (PathNode);

//# sourceMappingURL=path-node.js.map


/***/ }),
/* 53 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_circle__ = __webpack_require__(424);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__geometry_circle__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_arc__ = __webpack_require__(221);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__geometry_arc__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry_rect__ = __webpack_require__(29);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__geometry_rect__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__geometry_point__ = __webpack_require__(19);
/* unused harmony reexport Point */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry_segment__ = __webpack_require__(430);
/* unused harmony reexport Segment */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__geometry_matrix__ = __webpack_require__(96);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_5__geometry_matrix__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__geometry_size__ = __webpack_require__(140);
/* unused harmony reexport Size */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__geometry_to_matrix__ = __webpack_require__(54);
/* unused harmony reexport toMatrix */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__geometry_transformation__ = __webpack_require__(431);
/* unused harmony reexport Transformation */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__geometry_transform__ = __webpack_require__(39);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_9__geometry_transform__["a"]; });











//# sourceMappingURL=geometry.js.map


/***/ }),
/* 54 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = toMatrix;
function toMatrix(transformation) {
    if (transformation && typeof transformation.matrix === "function") {
        return transformation.matrix();
    }

    return transformation;
}
//# sourceMappingURL=to-matrix.js.map


/***/ }),
/* 55 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__core_constants__ = __webpack_require__(423);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(99);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_render_all_attributes__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_render_attribute__ = __webpack_require__(100);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__node_map__ = __webpack_require__(41);








var ATTRIBUTE_MAP = {
    "fill.opacity": "fill-opacity",
    "stroke.color": "stroke",
    "stroke.width": "stroke-width",
    "stroke.opacity": "stroke-opacity"
};
var SPACE = " ";

var PathNode = (function (Node) {
    function PathNode () {
        Node.apply(this, arguments);
    }

    if ( Node ) PathNode.__proto__ = Node;
    PathNode.prototype = Object.create( Node && Node.prototype );
    PathNode.prototype.constructor = PathNode;

    PathNode.prototype.geometryChange = function geometryChange () {
        this.attr("d", this.renderData());
        this.invalidate();
    };

    PathNode.prototype.optionsChange = function optionsChange (e) {
        switch (e.field) {
            case "fill":
                if (e.value) {
                    this.allAttr(this.mapFill(e.value));
                } else {
                    this.removeAttr("fill");
                }
                break;

            case "fill.color":
                this.allAttr(this.mapFill({ color: e.value }));
                break;

            case "stroke":
                if (e.value) {
                    this.allAttr(this.mapStroke(e.value));
                } else {
                    this.removeAttr("stroke");
                }
                break;

            case "transform":
                this.transformChange(e.value);
                break;

            default:
                var name = ATTRIBUTE_MAP[e.field];
                if (name) {
                    this.attr(name, e.value);
                }
                break;
        }

        Node.prototype.optionsChange.call(this, e);
    };

    PathNode.prototype.content = function content () {
        if (this.element) {
            this.element.textContent = this.srcElement.content();
        }
    };

    PathNode.prototype.renderData = function renderData () {
        return this.printPath(this.srcElement);
    };

    PathNode.prototype.printPath = function printPath (path) {
        var this$1 = this;

        var segments = path.segments;
        var length = segments.length;
        if (length > 0) {
            var parts = [];
            var output, currentType;

            for (var i = 1; i < length; i++) {
                var segmentType = this$1.segmentType(segments[i - 1], segments[i]);
                if (segmentType !== currentType) {
                    currentType = segmentType;
                    parts.push(segmentType);
                }

                if (segmentType === "L") {
                    parts.push(this$1.printPoints(segments[i].anchor()));
                } else {
                    parts.push(this$1.printPoints(segments[i - 1].controlOut(), segments[i].controlIn(), segments[i].anchor()));
                }
            }

            output = "M" + this.printPoints(segments[0].anchor()) + SPACE + parts.join(SPACE);
            if (path.options.closed) {
                output += "Z";
            }

            return output;
        }
    };

    PathNode.prototype.printPoints = function printPoints () {
        var points = arguments;
        var length = points.length;
        var result = [];

        for (var i = 0; i < length; i++) {
            result.push(points[i].toString(3));
        }

        return result.join(" ");
    };

    PathNode.prototype.segmentType = function segmentType (segmentStart, segmentEnd) {
        return segmentStart.controlOut() && segmentEnd.controlIn() ? "C" : "L";
    };

    PathNode.prototype.mapStroke = function mapStroke (stroke) {
        var attrs = [];

        if (stroke && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["t" /* isTransparent */])(stroke.color)) {
            attrs.push([ "stroke", stroke.color ]);
            attrs.push([ "stroke-width", stroke.width ]);
            attrs.push([ "stroke-linecap", this.renderLinecap(stroke) ]);
            attrs.push([ "stroke-linejoin", stroke.lineJoin ]);

            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* defined */])(stroke.opacity)) {
                attrs.push([ "stroke-opacity", stroke.opacity ]);
            }

            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* defined */])(stroke.dashType)) {
                attrs.push([ "stroke-dasharray", this.renderDashType(stroke) ]);
            }
        } else {
            attrs.push([ "stroke", __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* NONE */] ]);
        }

        return attrs;
    };

    PathNode.prototype.renderStroke = function renderStroke () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils_render_all_attributes__["a" /* default */])(
            this.mapStroke(this.srcElement.options.stroke)
        );
    };

    PathNode.prototype.renderDashType = function renderDashType (stroke) {
        var dashType = stroke.dashType;
        var width = stroke.width; if ( width === void 0 ) width = 1;

        if (dashType && dashType !== __WEBPACK_IMPORTED_MODULE_2__core_constants__["a" /* SOLID */]) {
            var dashArray = __WEBPACK_IMPORTED_MODULE_2__core_constants__["b" /* DASH_ARRAYS */][dashType.toLowerCase()];
            var result = [];

            for (var i = 0; i < dashArray.length; i++) {
                result.push(dashArray[i] * width);
            }

            return result.join(" ");
        }
    };

    PathNode.prototype.renderLinecap = function renderLinecap (stroke) {
        var dashType = stroke.dashType;
        var lineCap = stroke.lineCap;

        return (dashType && dashType !== "solid") ? __WEBPACK_IMPORTED_MODULE_2__core_constants__["c" /* BUTT */] : lineCap;
    };

    PathNode.prototype.mapFill = function mapFill (fill) {
        var attrs = [];
        if (!(fill && fill.nodeType === "Gradient")) {
            if (fill && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["t" /* isTransparent */])(fill.color)) {
                attrs.push([ "fill", fill.color ]);

                if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* defined */])(fill.opacity)) {
                    attrs.push([ "fill-opacity", fill.opacity ]);
                }
            } else {
                attrs.push([ "fill", __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* NONE */] ]);
            }
        }

        return attrs;
    };

    PathNode.prototype.renderFill = function renderFill () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils_render_all_attributes__["a" /* default */])(
            this.mapFill(this.srcElement.options.fill)
        );
    };

    PathNode.prototype.template = function template () {
        return "<path " + (this.renderId()) + " " + (this.renderStyle()) + " " + (this.renderOpacity()) + " " + (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_render_attribute__["a" /* default */])('d', this.renderData())) +
                    "" + (this.renderStroke()) + (this.renderFill()) + (this.renderDefinitions()) + (this.renderTransform()) + "></path>";
    };

    return PathNode;
}(__WEBPACK_IMPORTED_MODULE_0__node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_6__node_map__["a" /* default */].Path = PathNode;

/* harmony default export */ __webpack_exports__["a"] = (PathNode);
//# sourceMappingURL=path-node.js.map


/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var do_1 = __webpack_require__(963);
Observable_1.Observable.prototype.do = do_1._do;
Observable_1.Observable.prototype._do = do_1._do;
//# sourceMappingURL=do.js.map

/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(36);

/***/ }),
/* 58 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CalendarViewEnum; });
/**
 * @hidden
 *
 * The Enum which defines all possible view types.
 */
var CalendarViewEnum;
(function (CalendarViewEnum) {
    CalendarViewEnum[CalendarViewEnum["month"] = 0] = "month";
    CalendarViewEnum[CalendarViewEnum["year"] = 1] = "year";
    CalendarViewEnum[CalendarViewEnum["decade"] = 2] = "decade";
    CalendarViewEnum[CalendarViewEnum["century"] = 3] = "century";
})(CalendarViewEnum || (CalendarViewEnum = {}));


/***/ }),
/* 59 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Keys; });
/**
 * @hidden
 */
var Keys;
(function (Keys) {
    Keys[Keys["backspace"] = 8] = "backspace";
    Keys[Keys["tab"] = 9] = "tab";
    Keys[Keys["enter"] = 13] = "enter";
    Keys[Keys["shift"] = 16] = "shift";
    Keys[Keys["ctrl"] = 17] = "ctrl";
    Keys[Keys["alt"] = 18] = "alt";
    Keys[Keys["pause/break"] = 19] = "pause/break";
    Keys[Keys["caps lock"] = 20] = "caps lock";
    Keys[Keys["esc"] = 27] = "esc";
    Keys[Keys["space"] = 32] = "space";
    Keys[Keys["page up"] = 33] = "page up";
    Keys[Keys["page down"] = 34] = "page down";
    Keys[Keys["end"] = 35] = "end";
    Keys[Keys["home"] = 36] = "home";
    Keys[Keys["left"] = 37] = "left";
    Keys[Keys["up"] = 38] = "up";
    Keys[Keys["right"] = 39] = "right";
    Keys[Keys["down"] = 40] = "down";
    Keys[Keys["insert"] = 45] = "insert";
    Keys[Keys["delete"] = 46] = "delete";
    Keys[Keys["command"] = 91] = "command";
    Keys[Keys["left command"] = 91] = "left command";
    Keys[Keys["right command"] = 93] = "right command";
    Keys[Keys["numpad *"] = 106] = "numpad *";
    Keys[Keys["numpad +"] = 107] = "numpad +";
    Keys[Keys["numpad -"] = 109] = "numpad -";
    Keys[Keys["numpad ."] = 110] = "numpad .";
    Keys[Keys["numpad /"] = 111] = "numpad /";
    Keys[Keys["num lock"] = 144] = "num lock";
    Keys[Keys["scroll lock"] = 145] = "scroll lock";
    Keys[Keys["my computer"] = 182] = "my computer";
    Keys[Keys["my calculator"] = 183] = "my calculator";
    Keys[Keys[";"] = 186] = ";";
    Keys[Keys["="] = 187] = "=";
    Keys[Keys[","] = 188] = ",";
    Keys[Keys["-"] = 189] = "-";
    Keys[Keys["."] = 190] = ".";
    Keys[Keys["/"] = 191] = "/";
    Keys[Keys["`"] = 192] = "`";
    Keys[Keys["["] = 219] = "[";
    Keys[Keys["\\"] = 220] = "\\";
    Keys[Keys["]"] = 221] = "]";
    Keys[Keys["'"] = 222] = "'";
})(Keys || (Keys = {}));


/***/ }),
/* 60 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PreventableEvent; });
/**
 * @hidden
 */
var PreventableEvent = (function () {
    function PreventableEvent() {
        this.prevented = false;
    }
    /**
     * Prevents the default action for a specified event.
     * In this way, the source component suppresses the built-in behavior that follows the event.
     */
    PreventableEvent.prototype.preventDefault = function () {
        this.prevented = true;
    };
    /**
     * If the event is prevented by any of its subscribers, returns `true`.
     *
     * @returns `true` if the default action was prevented. Otherwise, returns `false`.
     */
    PreventableEvent.prototype.isDefaultPrevented = function () {
        return this.prevented;
    };
    return PreventableEvent;
}());



/***/ }),
/* 61 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectionService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(43);


/**
 * @hidden
 */
var SelectionService = (function () {
    function SelectionService() {
        this.onSelect = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.onChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.selectedIndices = [];
    }
    SelectionService.prototype.isSelected = function (index) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["b" /* isPresent */])(this.selectedIndices.find(function (current) { return current === index; }));
    };
    SelectionService.prototype.isFocused = function (index) {
        return index === this.focused;
    };
    SelectionService.prototype.focus = function (index) {
        if (this.isFocused(index)) {
            return;
        }
        this.focused = index;
        this.onFocus.emit(index);
    };
    SelectionService.prototype.select = function (index) {
        if (this.isSelected(index)) {
            return;
        }
        this.selectedIndices = [index];
        this.focused = index;
        this.onSelect.emit({
            indices: this.selectedIndices.slice()
        });
    };
    SelectionService.prototype.add = function (index) {
        if (this.isSelected(index)) {
            return;
        }
        this.selectedIndices.push(index);
        this.focused = index;
        this.onChange.emit({
            added: index,
            indices: this.selectedIndices.slice()
        });
    };
    SelectionService.prototype.unselect = function (index) {
        if (!this.isSelected(index)) {
            return;
        }
        var position = this.selectedIndices.indexOf(index);
        this.selectedIndices.splice(position, 1);
        this.focused = index;
        this.onChange.emit({
            indices: this.selectedIndices.slice(),
            removed: index
        });
    };
    SelectionService.prototype.change = function (index) {
        this.selectedIndices = [index];
        this.focused = index;
        this.onChange.emit({
            indices: this.selectedIndices.slice()
        });
    };
    SelectionService.prototype.resetSelection = function (index) {
        this.selectedIndices = index instanceof Array ? index : [index];
        this.focused = this.selectedIndices[this.selectedIndices.length - 1];
    };
    Object.defineProperty(SelectionService.prototype, "selected", {
        get: function () {
            return this.selectedIndices.slice();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SelectionService.prototype, "focused", {
        get: function () {
            return this.focusedIndex;
        },
        set: function (index) {
            if (this.focusedIndex !== index) {
                this.focusedIndex = index;
                this.onFocus.emit(index);
            }
        },
        enumerable: true,
        configurable: true
    });
    return SelectionService;
}());

SelectionService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
SelectionService.ctorParameters = function () { return []; };


/***/ }),
/* 62 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SharedDirectivesModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__templates_item_template_directive__ = __webpack_require__(65);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templates_header_template_directive__ = __webpack_require__(64);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templates_footer_template_directive__ = __webpack_require__(63);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__templates_no_data_template_directive__ = __webpack_require__(89);





var SHARED_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_2__templates_header_template_directive__["a" /* HeaderTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_3__templates_footer_template_directive__["a" /* FooterTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_1__templates_item_template_directive__["a" /* ItemTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_4__templates_no_data_template_directive__["a" /* NoDataTemplateDirective */]
];
/**
 * @hidden
 *
 * The exported package module.
 *
 * The package exports:
 * - `ItemTemplateDirective`&mdash;The item template directive.
 * - `HeaderTemplateDirective`&mdash;The header template directive.
 * - `FooterTemplateDirective`&mdash;The footer template directive.
 * - `NoDataTemplateDirective`&mdash;The noData template directive.
 */
var SharedDirectivesModule = (function () {
    function SharedDirectivesModule() {
    }
    return SharedDirectivesModule;
}());

SharedDirectivesModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [SHARED_DIRECTIVES],
                exports: [SHARED_DIRECTIVES]
            },] },
];
/** @nocollapse */
SharedDirectivesModule.ctorParameters = function () { return []; };


/***/ }),
/* 63 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FooterTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering the footer content of the list.
 *
 * To define the footer template, nest a `<ng-template>` tag with the `kendo<ComponentName>FooterTemplate` directive inside the component tag.
 *
 * You can use:
 * - The `kendoAutoCompleteFooterTemplate` directive for the AutoComplete.
 * - The `kendoComboBoxFooterTemplate` directive for the ComboBox.
 * - The `kendoDropDownListFooterTemplate` directive for the DropDownList.
 * - The `kendoMultiSelectFooterTemplate` directive for the MultiSelect.
 *
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-combobox [data]="listItems">
 *    <ng-template kendoComboBoxFooterTemplate>
 *      <h4>Footer template</h4>
 *    </ng-template>
 *  </kendo-combobox>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 *
 * For more examples, refer to the article on [templates]({% slug templates_ddl %}).
 */
var FooterTemplateDirective = (function () {
    function FooterTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return FooterTemplateDirective;
}());

FooterTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDropDownListFooterTemplate],[kendoComboBoxFooterTemplate],[kendoAutoCompleteFooterTemplate],[kendoMultiSelectFooterTemplate]'
            },] },
];
/** @nocollapse */
FooterTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 64 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HeaderTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering the header content of the list.
 *
 * To define the header template, nest a `<ng-template>` tag with the `kendo<ComponentName>HeaderTemplate` directive inside the component tag.
 *
 * You can use:
 * - The `kendoAutoCompleteHeaderTemplate` directive for the AutoComplete.
 * - The `kendoComboBoxHeaderTemplate` directive for the ComboBox.
 * - The `kendoDropDownListHeaderTemplate` directive for the DropDownList.
 * - The `kendoMultiSelectHeaderTemplate` directive for the MultiSelect.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-combobox [data]="listItems">
 *    <ng-template kendoComboBoxHeaderTemplate>
 *      <h4>Header template</h4>
 *    </ng-template>
 *  </kendo-combobox>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 * For more examples, refer to the article on [templates]({% slug templates_ddl %}).
 */
var HeaderTemplateDirective = (function () {
    function HeaderTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return HeaderTemplateDirective;
}());

HeaderTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDropDownListHeaderTemplate],[kendoComboBoxHeaderTemplate],[kendoAutoCompleteHeaderTemplate],[kendoMultiSelectHeaderTemplate]'
            },] },
];
/** @nocollapse */
HeaderTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 65 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering the list item content.
 *
 * To define the item template, nest a `<ng-template>` tag with the `kendo<ComponentName>ItemTemplate` directive inside the component tag.
 *
 * You can use:
 * - The `kendoAutoCompleteItemTemplate` directive for the AutoComplete.
 * - The `kendoComboBoxItemTemplate` directive for the ComboBox.
 * - The `kendoDropDownListItemTemplate` directive for the DropDownList.
 * - The `kendoMultiSelectItemTemplate` directive for the MultiSelect.
 *
 * The template context is set to the current component. To get a reference to the current data item, use the `let-dataItem` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-combobox [data]="listItems">
 *    <ng-template kendoComboBoxItemTemplate let-dataItem>
 *      <span>{{dataItem}} option</span>
 *    </ng-template>
 *  </kendo-combobox>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 *
 * For more examples, refer to the article on [templates]({% slug templates_ddl %}).
 */
var ItemTemplateDirective = (function () {
    function ItemTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return ItemTemplateDirective;
}());

ItemTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]'
            },] },
];
/** @nocollapse */
ItemTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 66 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalDataChangesService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var LocalDataChangesService = (function () {
    function LocalDataChangesService() {
        this.changes = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    return LocalDataChangesService;
}());

LocalDataChangesService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
LocalDataChangesService.ctorParameters = function () { return []; };


/***/ }),
/* 67 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerElementComponent; });
/**
 * @hidden
 */
var PagerElementComponent = (function () {
    function PagerElementComponent(localization, pagerContext) {
        this.localization = localization;
        this.pagerContext = pagerContext;
        this.total = this.pagerContext.total;
        this.skip = this.pagerContext.skip;
        this.pageSize = this.pagerContext.pageSize;
    }
    Object.defineProperty(PagerElementComponent.prototype, "currentPage", {
        /**
         * @hidden
         *
         * @readonly
         * @type {number}
         * @memberOf PagerElementComponent
         */
        get: function () {
            return Math.floor((this.skip || 0) / this.pageSize) + 1;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerElementComponent.prototype, "totalPages", {
        /**
         * @hidden
         *
         * @readonly
         * @type {number}
         * @memberOf PagerElementComponent
         */
        get: function () {
            return Math.ceil((this.total || 0) / this.pageSize);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     *
     * @param {string} key
     * @returns {string}
     *
     * @memberOf PagerElementComponent
     */
    PagerElementComponent.prototype.textFor = function (key) {
        return this.localization.get(key);
    };
    /**
     * @hidden
     *
     * @param {number} page
     *
     * @memberOf PagerElementComponent
     */
    PagerElementComponent.prototype.changePage = function (page) {
        this.pagerContext.changePage(page);
        return false;
    };
    /**
     * @hidden
     *
     * @memberOf PagerElementComponent
     */
    PagerElementComponent.prototype.ngOnInit = function () {
        this.changesSubscription = this.pagerContext.changes.subscribe(this.onChanges.bind(this));
    };
    PagerElementComponent.prototype.ngOnDestroy = function () {
        if (this.changesSubscription) {
            this.changesSubscription.unsubscribe();
        }
    };
    return PagerElementComponent;
}());



/***/ }),
/* 68 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column cell template of the Grid.
 * It helps to customize the content of the cells.
 *
 * To define the cell template, nest a `<ng-template>` tag with the `kendoGridCellTemplate` directive inside
 * a `<kendo-grid-column>` tag.
 *
 * The template context is set to the current data item and the following additional fields are passed:
 * - `columnIndex`&mdash;The current column index.
 * - `rowIndex`&mdash;The current row index.
 * - `dataItem`&mdash;The current data item.
 * - `column`&mdash;The current column instance.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *         <kendo-grid [data]="gridData">
 *             <kendo-grid-column field="ProductName">
 *                 <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
 *                     Row: {{rowIndex}} /
 *                     <strong>{{dataItem.ProductName}}</strong>
 *                     ({{dataItem.Discontinued ? "discontinued" : "active"}})
 *                 </ng-template>
 *             </kendo-grid-column>
 *         </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public gridData = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ];
 * }
 *
 * ```
 */
var CellTemplateDirective = (function () {
    function CellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return CellTemplateDirective;
}());

CellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridCellTemplate]'
            },] },
];
/** @nocollapse */
CellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 69 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CELL_CONTEXT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return EMPTY_CELL_CONTEXT; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var CELL_CONTEXT = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]('grid-cell-context');
/**
 * @hidden
 */
var EMPTY_CELL_CONTEXT = {};


/***/ }),
/* 70 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["b"] = invokeElementMethod;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return guid; });
/**
 * @hidden
 */
function invokeElementMethod(element, name) {
    var args = [];
    for (var _i = 2; _i < arguments.length; _i++) {
        args[_i - 2] = arguments[_i];
    }
    if (element && element.nativeElement) {
        return element.nativeElement[name].apply(element.nativeElement, args);
    }
}
var w = function () { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); };
/**
 * @hidden
 */
var guid = function () { return "" + w() + w() + "-" + w() + "-" + w() + "-" + w() + "-" + w() + w() + w(); };


/***/ }),
/* 71 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return eitherRect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return replaceOffset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return removeStackingOffset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDifferentOffset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isDocumentAvailable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isWindowAvailable; });
/* unused harmony export hasBoundingRect */
/* unused harmony export OVERFLOW_REGEXP */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return scrollableParents; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return FRAME_DURATION; });
/* unused harmony export hasRelativeStackingContext */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return HAS_RELATIVE_STACKING_CONTEXT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return zIndex; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__progress_kendo_popup_common__ = __webpack_require__(464);

/**
 * @hidden
 */
var eitherRect = function (rect, offset) {
    if (!rect) {
        return { height: 0, left: offset.left, top: offset.top, width: 0 };
    }
    return rect;
};
/**
 * @hidden
 */
var replaceOffset = function (rect, offset) {
    if (!offset) {
        return rect;
    }
    var result = {
        height: rect.height,
        left: offset.left,
        top: offset.top,
        width: rect.width
    };
    return result;
};
/**
 * @hidden
 */
var removeStackingOffset = function (rect, stackingOffset) {
    if (!stackingOffset) {
        return rect;
    }
    var result = {
        height: rect.height,
        left: rect.left - stackingOffset.left,
        top: rect.top - stackingOffset.top,
        width: rect.width
    };
    return result;
};
/**
 * @hidden
 */
var isDifferentOffset = function (oldOffset, newOffset) {
    var oldLeft = oldOffset.left, oldTop = oldOffset.top;
    var newLeft = newOffset.left, newTop = newOffset.top;
    return Math.abs(oldLeft - newLeft) >= 1 || Math.abs(oldTop - newTop) >= 1;
};
/**
 * @hidden
 */
var isDocumentAvailable = function () {
    return typeof document !== 'undefined' && !!document.body;
};
/**
 * @hidden
 */
var isWindowAvailable = function () {
    return typeof window !== 'undefined';
};
/**
 * @hidden
 */
var hasBoundingRect = function (elem) { return !!elem.getBoundingClientRect; };
/**
 * @hidden
 */
var OVERFLOW_REGEXP = /auto|scroll/;
var overflowStyle = function (element) {
    var styles = window.getComputedStyle(element);
    return "" + styles.overflow + styles.overflowX + styles.overflowY;
};
/**
 * @hidden
 */
var scrollableParents = function (element) {
    var parentElements = [];
    if (!isDocumentAvailable() || !isWindowAvailable()) {
        return parentElements;
    }
    var parent = element.parentElement;
    while (parent) {
        if (OVERFLOW_REGEXP.test(overflowStyle(parent))) {
            parentElements.push(parent);
        }
        parent = parent.parentElement;
    }
    parentElements.push(window);
    return parentElements;
};
/**
 * @hidden
 */
var FRAME_DURATION = 1000 / 60; //1000ms divided by 60fps
/**
 * @hidden
 */
//1000ms divided by 60fps
var hasRelativeStackingContext = function () {
    if (!isDocumentAvailable()) {
        return false;
    }
    var top = 10;
    var parent = document.createElement("div");
    parent.style.transform = "matrix(10, 0, 0, 10, 0, 0)";
    parent.innerHTML = "<div style=\"position: fixed; top: " + top + "px;\">child</div>";
    document.body.appendChild(parent);
    var isDifferent = parent.children[0].getBoundingClientRect().top !== top;
    document.body.removeChild(parent);
    return isDifferent;
};
/**
 * @hidden
 */
var HAS_RELATIVE_STACKING_CONTEXT = hasRelativeStackingContext();
/**
 * @hidden
 */
var zIndex = function (anchor, container) {
    if (!anchor || !isDocumentAvailable() || !isWindowAvailable()) {
        return null;
    }
    var sibling = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_popup_common__["a" /* siblingContainer */])(anchor, container);
    if (!sibling) {
        return null;
    }
    var result = [anchor].concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_popup_common__["b" /* parents */])(anchor, sibling)).reduce(function (index, p) {
        var zIndexStyle = p.style.zIndex || window.getComputedStyle(p).zIndex;
        var current = parseInt(zIndexStyle, 10);
        return current > index ? current : index;
    }, 0);
    return result ? (result + 1) : null;
};


/***/ }),
/* 72 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__resize_sensor_component__ = __webpack_require__(400);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__resize_sensor_component__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__resize_sensor_module__ = __webpack_require__(632);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__resize_sensor_module__["a"]; });




/***/ }),
/* 73 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getter; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);

var getterCache = {};
var FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
// tslint:disable-next-line:no-string-literal
getterCache['undefined'] = function (obj) { return obj; };
/**
 * @hidden
 */
var getter = function (field, safe) {
    var key = field + safe;
    if (getterCache[key]) {
        return getterCache[key];
    }
    var fields = [];
    field.replace(FIELD_REGEX, function (_, index, indexAccessor, field) {
        fields.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(index) ? index : (indexAccessor || field));
        return undefined;
    });
    getterCache[key] = function (obj) {
        var result = obj;
        for (var idx = 0; idx < fields.length; idx++) {
            result = result[fields[idx]];
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(result) && safe) {
                return result;
            }
        }
        return result;
    };
    return getterCache[key];
};


/***/ }),
/* 74 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isCompositeFilterDescriptor; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);

/**
 * @hidden
 * Type guard for `CompositeFilterDescriptor`.
 */
var isCompositeFilterDescriptor = function (source) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(source.filters);
};


/***/ }),
/* 75 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filtering_filter_descriptor_interface__ = __webpack_require__(74);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__filtering_filter_descriptor_interface__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__odata_operators__ = __webpack_require__(638);
/* unused harmony reexport toODataString */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mvc_operators__ = __webpack_require__(636);
/* unused harmony reexport toDataSourceRequestString */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mvc_deserialization__ = __webpack_require__(635);
/* unused harmony reexport translateDataSourceResultGroups */
/* unused harmony reexport translateAggregateResults */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__array_operators__ = __webpack_require__(633);
/* unused harmony reexport orderBy */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_4__array_operators__["a"]; });
/* unused harmony reexport distinct */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__accessor__ = __webpack_require__(73);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_5__accessor__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__filtering_filter_expression_factory__ = __webpack_require__(209);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_6__filtering_filter_expression_factory__["a"]; });
/* unused harmony reexport compileFilter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__grouping_group_operators__ = __webpack_require__(211);
/* unused harmony reexport groupBy */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__sorting_sort_array_operator__ = __webpack_require__(403);
/* unused harmony reexport composeSortDescriptors */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__filtering_filter_operators__ = __webpack_require__(210);
/* unused harmony reexport normalizeFilters */
/* unused harmony reexport normalizeGroups */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__grouping_aggregate_operators__ = __webpack_require__(402);
/* unused harmony reexport aggregateBy */














/***/ }),
/* 76 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return adjustDST; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__clone_date__ = __webpack_require__(77);

/**
 * @hidden
 */
var adjustDST = function (date, hour) {
    var newDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__clone_date__["a" /* cloneDate */])(date);
    if (hour === 0 && newDate.getHours() === 23) {
        newDate.setHours(newDate.getHours() + 2);
    }
    return newDate;
};


/***/ }),
/* 77 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cloneDate; });
/**
 * A function that clones the passed date. The parameter could be `null`.
 *
 * @param date - The initial date value.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * cloneDate(new Date(2016, 0, 1)); // returns new Date(2016, 0, 1);
 * cloneDate(null); // returns null
 * ```
 */
var cloneDate = function (date) { return date ? new Date(date.getTime()) : date; };


/***/ }),
/* 78 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);


var GRADIENT = "Gradient";

var Paintable = {
    extend: function(proto) {
        proto.fill = this.fill;
        proto.stroke = this.stroke;
    },

    fill: function(color, opacity) {
        var options = this.options;

        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(color)) {
            if (color && color.nodeType !== GRADIENT) {
                var newFill = {
                    color: color
                };
                if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(opacity)) {
                    newFill.opacity = opacity;
                }
                options.set("fill", newFill);
            } else {
                options.set("fill", color);
            }

            return this;
        }

        return options.get("fill");
    },

    stroke: function(color, width, opacity) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(color)) {
            this.options.set("stroke.color", color);

            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(width)) {
                this.options.set("stroke.width", width);
            }

            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(opacity)) {
                this.options.set("stroke.opacity", opacity);
            }

            return this;
        }

        return this.options.get("stroke");
    }
};

/* harmony default export */ __webpack_exports__["a"] = (Paintable);
//# sourceMappingURL=paintable.js.map


/***/ }),
/* 79 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errors; });
/* unused harmony export IntlError */
/* unused harmony export toIntlErrors */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__error_details__ = __webpack_require__(776);


var formatRegExp = /\{(\d+)}?\}/g;

var IntlError = function IntlError(ref) {
    var name = ref.name;
    var message = ref.message;

    if (!name || !message) {
        throw new Error("{ name: string, message: string } object is required!");
    }

    this.name = name;
    this.message = message;
};

IntlError.prototype.formatMessage = function formatMessage () {
        var values = [], len = arguments.length;
        while ( len-- ) values[ len ] = arguments[ len ];

    var flattenValues = flatten(values);

    var formattedMessage = this.message.replace(formatRegExp, function(match, index) {
        return flattenValues[parseInt(index, 10)];
    });

    return ((this.name) + ": " + formattedMessage);
};

IntlError.prototype.error = function error () {
        var values = [], len = arguments.length;
        while ( len-- ) values[ len ] = arguments[ len ];

    return new Error(this.formatMessage(values));
};

var flatten = function(arr) {
    return arr.reduce(function (a, b) { return a.concat(b); }, []);
};

var toIntlErrors = function(errors) {
    var predicate = function(prev, name) {
        prev[name] = new IntlError({ name: name, message: errors[name] });
        return prev;
    };

    return Object.keys(errors).reduce(predicate, {});
};

var errors = toIntlErrors(__WEBPACK_IMPORTED_MODULE_0__error_details__["a" /* default */]);



//# sourceMappingURL=errors.js.map


/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var merge_1 = __webpack_require__(1068);
Observable_1.Observable.prototype.merge = merge_1.merge;
//# sourceMappingURL=merge.js.map

/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var take_1 = __webpack_require__(1005);
Observable_1.Observable.prototype.take = take_1.take;
//# sourceMappingURL=take.js.map

/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(13);

/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(20);

/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(82);

/***/ }),
/* 85 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Action; });
/**
 * @hidden
 */
var Action;
(function (Action) {
    Action[Action["Left"] = 0] = "Left";
    Action[Action["Right"] = 1] = "Right";
    Action[Action["Up"] = 2] = "Up";
    Action[Action["Down"] = 3] = "Down";
    Action[Action["PrevView"] = 4] = "PrevView";
    Action[Action["NextView"] = 5] = "NextView";
    Action[Action["FirstInView"] = 6] = "FirstInView";
    Action[Action["LastInView"] = 7] = "LastInView";
    Action[Action["LowerView"] = 8] = "LowerView";
    Action[Action["UpperView"] = 9] = "UpperView";
})(Action || (Action = {}));


/***/ }),
/* 86 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DOMService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_view_enum__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(14);



var div = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('div');
var ul = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('ul');
var li = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('li');
var td = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('td');
var th = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('th');
var tr = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('tr');
var tbody = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('tbody');
var thead = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('thead');
var table = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* domContainerFactory */])('table');
var monthHeader = function () { return (div("\n            <span class=\"k-calendar-title\">March 2017</span>\n            <span class=\"k-calendar-today\">TODAY</span>\n        ", 'k-calendar-header')); };
var monthWeekHeader = function () { return (table([
    thead([
        tr([th('MO')])
    ])
], 'k-calendar-weekdays')); };
var content = function (rows) { return (table([
    tbody([
        tr([th('1')])
    ].concat((new Array(rows).fill('1').map(function (v) { return tr([td("<span class=\"k-link\">" + v + "</span>")]); }))))
])); };
var scrollable = function (children) { return div(children, 'k-content k-scrollable'); };
var view = function (contentElement, className) { return (div([
    monthHeader(),
    monthWeekHeader(),
    scrollable([contentElement])
], className, { left: '-10000px', position: 'absolute' })); };
var navigationList = (function () {
    var navElement;
    return function () {
        if (!__WEBPACK_IMPORTED_MODULE_2__util__["f" /* isDocumentAvailable */]) {
            return null;
        }
        if (!navElement) {
            navElement = div([scrollable([ul([li('<span>FEB</span>')])])], 'k-calendar-navigation', { left: '-10000px', position: 'absolute' });
        }
        return navElement;
    };
})();
var viewFactory = function (rows, className) {
    var viewElement;
    return function () {
        if (!__WEBPACK_IMPORTED_MODULE_2__util__["f" /* isDocumentAvailable */]) {
            return null;
        }
        if (!viewElement) {
            viewElement = view(content(rows), className);
        }
        return viewElement;
    };
};
var monthView = viewFactory(6, 'k-calendar-view k-calendar-monthview');
var yearView = viewFactory(3, 'k-calendar-view k-calendar-yearview');
var decadeView = viewFactory(2, 'k-calendar-view k-calendar-decadeview');
var height = function (element) { return (parseFloat(window.getComputedStyle(element).height) || element.offsetHeight); };
/**
 * @hidden
 */
var DOMService = (function () {
    function DOMService() {
    }
    DOMService.prototype.ensureHeights = function () {
        if (this.calendarHeight !== undefined) {
            return;
        }
        this.calculateHeights();
    };
    DOMService.prototype.calculateHeights = function (container) {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["f" /* isDocumentAvailable */])()) {
            return;
        }
        this.hostContainer = container;
        this.batch(monthView(), function (contentElement) {
            var viewElement = contentElement.querySelector('tbody');
            _this.calendarHeight = height(contentElement);
            _this.monthViewHeight = height(viewElement);
            _this.headerHeight = height(viewElement.children[0]);
            _this.scrollableContentHeight = height(contentElement.querySelector('.k-scrollable'));
        });
        this.batch(yearView(), function (contentElement) {
            _this.yearViewHeight = height(contentElement.querySelector('tbody'));
            _this.scrollableYearContentHeight = height(contentElement.querySelector('.k-scrollable')) + _this.headerHeight;
        });
        this.batch(decadeView(), function (contentElement) {
            _this.decadeViewHeight = height(contentElement.querySelector('tbody'));
            _this.centuryViewHeight = _this.decadeViewHeight;
        });
        this.batch(navigationList(), function (contentElement) {
            _this.navigationItemHeight = height(contentElement.querySelector('li'));
        });
    };
    DOMService.prototype.viewHeight = function (viewType) {
        switch (viewType) {
            case __WEBPACK_IMPORTED_MODULE_1__models_view_enum__["a" /* CalendarViewEnum */].month:
                return this.monthViewHeight;
            case __WEBPACK_IMPORTED_MODULE_1__models_view_enum__["a" /* CalendarViewEnum */].year:
                return this.yearViewHeight;
            case __WEBPACK_IMPORTED_MODULE_1__models_view_enum__["a" /* CalendarViewEnum */].decade:
                return this.decadeViewHeight;
            case __WEBPACK_IMPORTED_MODULE_1__models_view_enum__["a" /* CalendarViewEnum */].century:
                return this.centuryViewHeight;
            default:
                return 1;
        }
    };
    DOMService.prototype.batch = function (contentElement, action) {
        var hostContainer = this.hostContainer || document.body;
        var appendedContent = hostContainer.appendChild(contentElement);
        action(appendedContent);
        hostContainer.removeChild(appendedContent);
    };
    return DOMService;
}());

DOMService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
DOMService.ctorParameters = function () { return []; };


/***/ }),
/* 87 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavigationAction; });
/**
 * @hidden
 */
var NavigationAction;
(function (NavigationAction) {
    NavigationAction[NavigationAction["Undefined"] = 0] = "Undefined";
    NavigationAction[NavigationAction["Open"] = 1] = "Open";
    NavigationAction[NavigationAction["Close"] = 2] = "Close";
    NavigationAction[NavigationAction["Enter"] = 3] = "Enter";
    NavigationAction[NavigationAction["Tab"] = 4] = "Tab";
    NavigationAction[NavigationAction["Esc"] = 5] = "Esc";
    NavigationAction[NavigationAction["Delete"] = 6] = "Delete";
    NavigationAction[NavigationAction["Backspace"] = 7] = "Backspace";
    NavigationAction[NavigationAction["Home"] = 8] = "Home";
    NavigationAction[NavigationAction["End"] = 9] = "End";
    NavigationAction[NavigationAction["Up"] = 10] = "Up";
    NavigationAction[NavigationAction["Down"] = 11] = "Down";
    NavigationAction[NavigationAction["Left"] = 12] = "Left";
    NavigationAction[NavigationAction["Right"] = 13] = "Right";
})(NavigationAction || (NavigationAction = {}));


/***/ }),
/* 88 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SharedModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__list_component__ = __webpack_require__(286);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__searchbar_component__ = __webpack_require__(117);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_resize_sensor__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__shared_directives_module__ = __webpack_require__(62);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__list_item_directive__ = __webpack_require__(285);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__selectable_directive__ = __webpack_require__(288);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__templates_template_context_directive__ = __webpack_require__(293);











var INTERNAL_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_3__list_component__["a" /* ListComponent */],
    __WEBPACK_IMPORTED_MODULE_8__list_item_directive__["a" /* ListItemDirective */],
    __WEBPACK_IMPORTED_MODULE_9__selectable_directive__["a" /* SelectableDirective */],
    __WEBPACK_IMPORTED_MODULE_4__searchbar_component__["a" /* SearchBarComponent */],
    __WEBPACK_IMPORTED_MODULE_10__templates_template_context_directive__["a" /* TemplateContextDirective */]
];
/**
 * @hidden
 */
var SharedModule = (function () {
    function SharedModule() {
    }
    return SharedModule;
}());

SharedModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [INTERNAL_DIRECTIVES],
                exports: [INTERNAL_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormsModule"], __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_popup__["b" /* PopupModule */], __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_resize_sensor__["b" /* ResizeSensorModule */], __WEBPACK_IMPORTED_MODULE_7__shared_directives_module__["a" /* SharedDirectivesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormsModule"], __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_popup__["b" /* PopupModule */], __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_resize_sensor__["b" /* ResizeSensorModule */], __WEBPACK_IMPORTED_MODULE_7__shared_directives_module__["a" /* SharedDirectivesModule */]]
            },] },
];
/** @nocollapse */
SharedModule.ctorParameters = function () { return []; };


/***/ }),
/* 89 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NoDataTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering content when there is no data present.
 *
 * To define the no-data template, nest a `<ng-template>` tag with the `kendo<ComponentName>NoDataTemplate` directive inside the component tag.
 *
 * You can use:
 * - The `kendoAutoCompleteNoDataTemplate` directive for the AutoComplete.
 * - The `kendoComboBoxNoDataTemplate` directive for the ComboBox.
 * - The `kendoDropDownListNoDataTemplate` directive for the DropDownList.
 * - The `kendoMultiSelectNoDataTemplate` directive for the MultiSelect.
 *
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-combobox [data]="listItems">
 *    <ng-template kendoComboBoxNoDataTemplate>
 *      <h4>No data!</h4>
 *    </ng-template>
 *  </kendo-combobox>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = [];
 * }
 * ```
 *
 * For more examples, refer to the article on [templates]({% slug templates_ddl %}).
 */
var NoDataTemplateDirective = (function () {
    function NoDataTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return NoDataTemplateDirective;
}());

NoDataTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDropDownListNoDataTemplate],[kendoComboBoxNoDataTemplate],[kendoAutoCompleteNoDataTemplate],[kendoMultiSelectNoDataTemplate]'
            },] },
];
/** @nocollapse */
NoDataTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 90 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isColumnGroupComponent;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ColumnGroupComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__column_common__ = __webpack_require__(27);




/**
 * @hidden
 */
function isColumnGroupComponent(column) {
    return column.isColumnGroup;
}
/**
 * Represents the column-group header of the Grid.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *    selector: 'my-app',
 *    template: `
 *     <kendo-grid [data]="gridData">
 *       <kendo-grid-column-group title="Product Info">
 *         <ng-template kendoGridHeaderTemplate let-columnIndex="columnIndex" let-column="column">
 *               Column index: {{columnIndex}} / column title: {{column.title}}
 *         </ng-template>
 *         <kendo-grid-column field="ProductID" title="Product ID" width="120">
 *         </kendo-grid-column>
 *         <kendo-grid-column field="ProductName" title="Product Name">
 *         </kendo-grid-column>
 *       </kendo-grid-column-group>
 *       <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
 *       </kendo-grid-column>
 *       <kendo-grid-column field="Discontinued" width="120">
 *           <ng-template kendoGridCellTemplate let-dataItem>
 *               <input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
 *           </ng-template>
 *       </kendo-grid-column>
 *     </kendo-grid>
 *    `
 * })
 *
 * class AppComponent {
 *    public gridData: any[];
 *
 *    constructor() {
 *        this.gridData = products;
 *    }
 * }
 *
 * const products = [{
 *    "ProductID": 1,
 *    "ProductName": "Chai",
 *    "UnitPrice": 18.0000,
 *    "Discontinued": true
 *  }, {
 *    "ProductID": 2,
 *    "ProductName": "Chang",
 *    "UnitPrice": 19.0000,
 *    "Discontinued": false
 *  }
 * ];
 *
 * ```
 */
var ColumnGroupComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ColumnGroupComponent, _super);
    function ColumnGroupComponent(parent) {
        var _this = _super.call(this, parent) || this;
        _this.parent = parent;
        /**
         * @hidden
         */
        _this.isColumnGroup = true;
        /**
         * @hidden
         */
        _this.minResizableWidth = 10;
        if (parent && parent.isSpanColumn) {
            throw new Error('ColumnGroupComponent cannot be nested inside SpanColumnComponent');
        }
        return _this;
    }
    /**
     * @hidden
     */
    ColumnGroupComponent.prototype.rowspan = function () {
        return 1;
    };
    Object.defineProperty(ColumnGroupComponent.prototype, "colspan", {
        /**
         * @hidden
         */
        get: function () {
            var _this = this;
            if (!this.children || this.children.length === 1) {
                return 1;
            }
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__column_common__["e" /* columnsSpan */])(this.children
                .filter(function (child) { return child !== _this && !child.hidden; }));
        },
        enumerable: true,
        configurable: true
    });
    return ColumnGroupComponent;
}(__WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */]));

ColumnGroupComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return ColumnGroupComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-grid-column-group',
                template: ""
            },] },
];
/** @nocollapse */
ColumnGroupComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };
ColumnGroupComponent.propDecorators = {
    'children': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */],] },],
};


/***/ }),
/* 91 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectionService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__ = __webpack_require__(112);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_dom_events_service__ = __webpack_require__(173);




/**
 * @hidden
 */
var nextId = 0;
/**
 * @hidden
 */
var SelectionService = (function () {
    function SelectionService(domEvents) {
        var _this = this;
        this.changes = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.lastSelectionStartIndex = 0;
        this.currentSelection = [];
        this.selectAllChecked = false;
        this.cellClickSubscription = domEvents.cellClick.subscribe(function (args) {
            if (_this.options.enabled && !_this.options.checkboxOnly && args.type !== 'contextmenu') {
                _this.handleClick({ index: args.rowIndex, data: args.dataItem }, args.originalEvent);
            }
        });
        this.mousedownSubscription = domEvents.cellMousedown.subscribe(function (args) {
            if (_this.options.enabled && (!_this.options.mode || _this.options.mode === "multiple") &&
                !_this.options.checkboxOnly && args.originalEvent.shiftKey) {
                args.originalEvent.preventDefault();
            }
        });
        this.id = nextId++;
    }
    SelectionService.prototype.init = function (settings) {
        this.settings = settings;
        this.currentSelection = [];
        if (settings.selectable && settings.selectable.enabled !== false) {
            var iterator = this.getIterator();
            while (true) {
                var item = iterator.next();
                if (item.done) {
                    break;
                }
                if (item.value && item.value.type === "data") {
                    var rowArgs = {
                        dataItem: item.value.data,
                        index: item.value.index
                    };
                    if (settings.rowSelected(rowArgs)) {
                        this.currentSelection[item.value.index] = rowArgs;
                    }
                }
            }
        }
    };
    SelectionService.prototype.isSelected = function (index) {
        return this.options.enabled && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.currentSelection[index]);
    };
    SelectionService.prototype.handleClick = function (item, event) {
        var ev;
        if (this.options.mode === "single" && (event.ctrlKey || event.metaKey) && this.isSelected(item.index)) {
            ev = this.toggle(item);
        }
        else if (this.options.mode === "multiple") {
            if ((event.ctrlKey || event.metaKey) && !event.shiftKey) {
                ev = this.toggle(item);
            }
            else if (event.shiftKey) {
                ev = this.addAllTo(item);
            }
        }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(ev)) {
            ev = this.select(item);
            this.currentSelection[item.index] = item.data;
        }
        if (!ev.selectedRows.length && !ev.deselectedRows.length) {
            return;
        }
        ev.ctrlKey = event.ctrlKey || event.metaKey;
        this.setDeprecatedEventProperties(ev);
        this.changes.emit(ev);
    };
    SelectionService.prototype.toggle = function (item) {
        var selectedRows = [];
        var deselectedRows = [];
        this.lastSelectionStartIndex = item.index;
        if (this.isSelected(item.index)) {
            deselectedRows.push({ dataItem: item.data, index: item.index });
        }
        else {
            selectedRows.push({ dataItem: item.data, index: item.index });
        }
        return {
            deselectedRows: deselectedRows,
            selectedRows: selectedRows
        };
    };
    SelectionService.prototype.toggleByIndex = function (index) {
        var iterator = this.getIterator();
        if (this.selectAllChecked && this.isSelected(index)) {
            this.selectAllChecked = false;
        }
        while (true) {
            var item = iterator.next();
            if (item.done) {
                break;
            }
            if (item.value && item.value.type === "data" && item.value.index === index) {
                var itemToToggle = {
                    data: item.value.data,
                    index: item.value.index
                };
                if (this.isSelected(index) || this.options.mode === "multiple") {
                    return this.toggle(itemToToggle);
                }
                else {
                    return this.select(itemToToggle);
                }
            }
        }
    };
    SelectionService.prototype.select = function (item) {
        var deselectedRows = [];
        var selectedRows = [];
        this.lastSelectionStartIndex = item.index;
        if (!this.isSelected(item.index)) {
            selectedRows.push({ dataItem: item.data, index: item.index });
        }
        this.currentSelection.forEach(function (row) {
            if (row.index !== item.index) {
                deselectedRows.push(row);
            }
        });
        return {
            deselectedRows: deselectedRows,
            selectedRows: selectedRows
        };
    };
    SelectionService.prototype.addAllTo = function (item) {
        var selectedRows = [];
        var deselectedRows = [];
        var start = Math.min(this.lastSelectionStartIndex, item.index);
        var end = Math.max(this.lastSelectionStartIndex, item.index);
        var iterator = this.getIterator();
        while (true) {
            var next = iterator.next();
            if (next.done) {
                break;
            }
            if (next.value && next.value.type === "data") {
                var idx = next.value.index;
                if ((idx < start || idx > end) && this.isSelected(idx)) {
                    deselectedRows.push({ dataItem: next.value.data, index: idx });
                }
                if ((idx >= start && idx <= end) && !this.isSelected(idx)) {
                    selectedRows.push({ dataItem: next.value.data, index: idx });
                }
            }
        }
        return {
            deselectedRows: deselectedRows,
            selectedRows: selectedRows
        };
    };
    SelectionService.prototype.updateAll = function (selectAllChecked) {
        this.selectAllChecked = selectAllChecked;
        var selectedRows = [];
        var deselectedRows = [];
        var iterator = this.getIterator();
        while (true) {
            var next = iterator.next();
            if (next.done) {
                break;
            }
            if (next.value && next.value.type === "data") {
                var idx = next.value.index;
                if (this.isSelected(idx) && !selectAllChecked) {
                    deselectedRows.push({ dataItem: next.value.data, index: idx });
                }
                if (!this.isSelected(idx) && selectAllChecked) {
                    selectedRows.push({ dataItem: next.value.data, index: idx });
                }
            }
        }
        if (!selectedRows.length && !deselectedRows.length) {
            return;
        }
        var ev = {
            deselectedRows: deselectedRows,
            selectedRows: selectedRows
        };
        this.setDeprecatedEventProperties(ev);
        this.changes.emit(ev);
    };
    Object.defineProperty(SelectionService.prototype, "selectAllState", {
        get: function () {
            if (this.selected.length === 0) {
                return false;
            }
            if (this.selected.length === this.settings.view.length) {
                return true;
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SelectionService.prototype, "selected", {
        get: function () {
            return this.currentSelection.map(function (item) {
                return item.index;
            }).filter(function (n) { return typeof n === "number"; });
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SelectionService.prototype, "options", {
        get: function () {
            var defaultOptions = {
                checkboxOnly: false,
                enabled: true,
                mode: "multiple"
            };
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.settings)) {
                return defaultOptions;
            }
            if (typeof this.settings.selectable === 'boolean') {
                return {
                    checkboxOnly: false,
                    enabled: this.settings.selectable,
                    mode: "multiple"
                };
            }
            else {
                return Object.assign(defaultOptions, this.settings.selectable);
            }
        },
        enumerable: true,
        configurable: true
    });
    SelectionService.prototype.ngOnDestroy = function () {
        if (this.cellClickSubscription) {
            this.cellClickSubscription.unsubscribe();
            this.cellClickSubscription = null;
        }
        if (this.mousedownSubscription) {
            this.mousedownSubscription.unsubscribe();
            this.mousedownSubscription = null;
        }
    };
    SelectionService.prototype.getIterator = function () {
        var accessor = this.settings.view.accessor();
        if (!accessor) {
            return;
        }
        return accessor[__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__["$$iterator"]]();
    };
    SelectionService.prototype.setDeprecatedEventProperties = function (ev) {
        if (ev.selectedRows.length >= ev.deselectedRows.length) {
            ev.selected = true;
            ev.index = ev.selectedRows[ev.selectedRows.length - 1].index;
        }
        else {
            ev.selected = false;
            ev.index = ev.deselectedRows[ev.deselectedRows.length - 1].index;
        }
        return ev;
    };
    return SelectionService;
}());

SelectionService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
SelectionService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__common_dom_events_service__["a" /* DomEventsService */], },
]; };


/***/ }),
/* 92 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DOMService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__ = __webpack_require__(464);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(71);



var STYLES = [
    'font-size',
    'font-family',
    'font-stretch',
    'font-style',
    'font-weight',
    'line-height'
];
/**
 * @hidden
 */
var DOMService = (function () {
    function DOMService() {
    }
    DOMService.prototype.addOffset = function (current, addition) {
        return {
            left: current.left + addition.left,
            top: current.top + addition.top
        };
    };
    DOMService.prototype.align = function (settings) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["c" /* align */])(settings);
    };
    DOMService.prototype.boundingOffset = function (el) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["d" /* boundingOffset */])(this.nativeElement(el));
    };
    DOMService.prototype.getFontStyles = function (el) {
        var window = this.getWindow();
        if (!window || !el) {
            return [];
        }
        var computedStyles = window.getComputedStyle(this.nativeElement(el));
        return STYLES.map(function (font) { return ({ key: font, value: computedStyles[font] }); });
    };
    DOMService.prototype.getWindow = function () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["f" /* isWindowAvailable */])() ? window : null;
    };
    DOMService.prototype.isBodyOffset = function (el) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["e" /* isBodyOffset */])(this.nativeElement(el));
    };
    DOMService.prototype.hasOffsetParent = function (el) {
        if (!el) {
            return false;
        }
        return !!this.nativeElement(el).offsetParent;
    };
    DOMService.prototype.offset = function (el) {
        if (!el) {
            return null;
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["f" /* offset */])(this.nativeElement(el));
    };
    DOMService.prototype.staticOffset = function (el) {
        if (!el) {
            return null;
        }
        var element = this.nativeElement(el);
        var _a = element.style, left = _a.left, top = _a.top;
        element.style.left = '0px';
        element.style.top = '0px';
        var currentOffset = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["f" /* offset */])(element);
        element.style.left = left;
        element.style.top = top;
        return currentOffset;
    };
    DOMService.prototype.nativeElement = function (el) {
        if (!el) {
            return null;
        }
        return el.nativeElement || el;
    };
    DOMService.prototype.position = function (element, popup) {
        if (!element || !popup) {
            return null;
        }
        var nativeEl = this.nativeElement(element);
        var parentSibling = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["a" /* siblingContainer */])(nativeEl, this.nativeElement(popup));
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["g" /* positionWithScroll */])(nativeEl, parentSibling);
    };
    DOMService.prototype.relativeOffset = function (el, currentLocation) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["h" /* applyLocationOffset */])(this.offset(el), currentLocation, this.isBodyOffset(el));
    };
    DOMService.prototype.addScroll = function (rect, scroll) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["i" /* addScroll */])(rect, scroll);
    };
    DOMService.prototype.removeScroll = function (rect, scroll) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["j" /* removeScroll */])(rect, scroll);
    };
    DOMService.prototype.restrictToView = function (settings) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["k" /* restrictToView */])(settings);
    };
    DOMService.prototype.scrollPosition = function (el) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["l" /* scrollPosition */])(this.nativeElement(el));
    };
    DOMService.prototype.scrollableParents = function (el) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["g" /* scrollableParents */])(this.nativeElement(el));
    };
    DOMService.prototype.stackingElementOffset = function (el) {
        var relativeContextElement = this.getRelativeContextElement(el);
        if (!relativeContextElement) {
            return null;
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["f" /* offset */])(relativeContextElement);
    };
    DOMService.prototype.stackingElementScroll = function (el) {
        var relativeContextElement = this.getRelativeContextElement(el);
        if (!relativeContextElement) {
            return { x: 0, y: 0 };
        }
        return {
            x: relativeContextElement.scrollLeft,
            y: relativeContextElement.scrollTop
        };
    };
    DOMService.prototype.stackingElementViewPort = function (el) {
        var relativeContextElement = this.getRelativeContextElement(el);
        if (!relativeContextElement) {
            return null;
        }
        return {
            height: relativeContextElement.scrollHeight,
            width: relativeContextElement.scrollWidth
        };
    };
    DOMService.prototype.getRelativeContextElement = function (el) {
        if (!el || !__WEBPACK_IMPORTED_MODULE_2__util__["h" /* HAS_RELATIVE_STACKING_CONTEXT */]) {
            return null;
        }
        var parent = this.nativeElement(el).parentElement;
        while (parent) {
            if (window.getComputedStyle(parent).transform !== 'none') {
                return parent;
            }
            parent = parent.parentElement;
        }
        return null;
    };
    DOMService.prototype.useRelativePosition = function (el) {
        return !!this.getRelativeContextElement(el);
    };
    DOMService.prototype.windowViewPort = function (el) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_popup_common__["m" /* getWindowViewPort */])(this.nativeElement(el));
    };
    DOMService.prototype.zIndex = function (anchor, container) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["i" /* zIndex */])(this.nativeElement(anchor), this.nativeElement(container));
    };
    DOMService.prototype.zoomLevel = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["b" /* isDocumentAvailable */])() || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["f" /* isWindowAvailable */])()) {
            return 1;
        }
        return parseFloat((document.documentElement.clientWidth / window.innerWidth).toFixed(2));
    };
    DOMService.prototype.isZoomed = function () {
        return this.zoomLevel() > 1;
    };
    return DOMService;
}());

DOMService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
DOMService.ctorParameters = function () { return []; };


/***/ }),
/* 93 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return either; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return compose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return constant; });
/**
 * @hidden
 */
/**
 * @hidden
 */ var either = function (predicate, right, left) { return function (value) { return predicate(value) ? right(value) : left(value); }; };
/**
 * @hidden
 * Performs the right-to-left function composition. Functions should have a unary.
 */
var compose = function () {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return function (data) { return args.reduceRight(function (acc, curr) { return curr(acc); }, data); };
};
/**
 * @hidden
 */
var constant = function (x) { return function () { return x; }; };


/***/ }),
/* 94 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common__ = __webpack_require__(8);


var BaseNode = (function (Class) {
    function BaseNode(srcElement) {
        Class.call(this);

        this.childNodes = [];
        this.parent = null;

        if (srcElement) {
            this.srcElement = srcElement;
            this.observe();
        }
    }

    if ( Class ) BaseNode.__proto__ = Class;
    BaseNode.prototype = Object.create( Class && Class.prototype );
    BaseNode.prototype.constructor = BaseNode;

    BaseNode.prototype.destroy = function destroy () {
        var this$1 = this;

        if (this.srcElement) {
            this.srcElement.removeObserver(this);
        }

        var children = this.childNodes;
        for (var i = 0; i < children.length; i++) {
            this$1.childNodes[i].destroy();
        }

        this.parent = null;
    };

    BaseNode.prototype.load = function load () {};

    BaseNode.prototype.observe = function observe () {
        if (this.srcElement) {
            this.srcElement.addObserver(this);
        }
    };

    BaseNode.prototype.append = function append (node) {
        this.childNodes.push(node);
        node.parent = this;
    };

    BaseNode.prototype.insertAt = function insertAt (node, pos) {
        this.childNodes.splice(pos, 0, node);
        node.parent = this;
    };

    BaseNode.prototype.remove = function remove (index, count) {
        var this$1 = this;

        var end = index + count;
        for (var i = index; i < end; i++) {
            this$1.childNodes[i].removeSelf();
        }
        this.childNodes.splice(index, count);
    };

    BaseNode.prototype.removeSelf = function removeSelf () {
        this.clear();
        this.destroy();
    };

    BaseNode.prototype.clear = function clear () {
        this.remove(0, this.childNodes.length);
    };

    BaseNode.prototype.invalidate = function invalidate () {
        if (this.parent) {
            this.parent.invalidate();
        }
    };

    BaseNode.prototype.geometryChange = function geometryChange () {
        this.invalidate();
    };

    BaseNode.prototype.optionsChange = function optionsChange () {
        this.invalidate();
    };

    BaseNode.prototype.childrenChange = function childrenChange (e) {
        if (e.action === "add") {
            this.load(e.items, e.index);
        } else if (e.action === "remove") {
            this.remove(e.index, e.items.length);
        }

        this.invalidate();
    };

    return BaseNode;
}(__WEBPACK_IMPORTED_MODULE_0__common__["d" /* Class */]));

/* harmony default export */ __webpack_exports__["a"] = (BaseNode);
//# sourceMappingURL=base-node.js.map


/***/ }),
/* 95 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shapes__ = __webpack_require__(438);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__shapes__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_0__shapes__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__shapes__["c"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0__shapes__["d"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__shapes__["e"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_0__shapes__["f"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__alignment__ = __webpack_require__(657);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gradients__ = __webpack_require__(693);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__gradients__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__gradients__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2__gradients__["c"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__animations__ = __webpack_require__(666);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__parsing_path_parser__ = __webpack_require__(698);
/* unused harmony reexport PathParser */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__core_surface__ = __webpack_require__(220);
/* unused harmony reexport Surface */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__core_base_node__ = __webpack_require__(94);
/* unused harmony reexport BaseNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__core_surface_factory__ = __webpack_require__(138);
/* unused harmony reexport SurfaceFactory */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__core_options_store__ = __webpack_require__(219);
/* unused harmony reexport OptionsStore */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__svg__ = __webpack_require__(709);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__canvas__ = __webpack_require__(669);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__canvas_export_image__ = __webpack_require__(672);
/* unused harmony reexport exportImage */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__svg_export_svg__ = __webpack_require__(712);
/* unused harmony reexport exportSVG */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__search_quad_node__ = __webpack_require__(435);
/* unused harmony reexport QuadNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__search_shapes_quad_tree__ = __webpack_require__(437);
/* unused harmony reexport ShapesQuadTree */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__mixins_observers_mixin__ = __webpack_require__(25);
/* unused harmony reexport ObserversMixin */
/* unused harmony reexport svg */
/* unused harmony reexport canvas */
/* unused harmony reexport util */
























//# sourceMappingURL=drawing.js.map


/***/ }),
/* 96 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);



var Matrix = (function (Class) {
    function Matrix(a, b, c, d, e, f) {
        if ( a === void 0 ) a = 0;
        if ( b === void 0 ) b = 0;
        if ( c === void 0 ) c = 0;
        if ( d === void 0 ) d = 0;
        if ( e === void 0 ) e = 0;
        if ( f === void 0 ) f = 0;

        Class.call(this);

        this.a = a;
        this.b = b;
        this.c = c;
        this.d = d;
        this.e = e;
        this.f = f;
    }

    if ( Class ) Matrix.__proto__ = Class;
    Matrix.prototype = Object.create( Class && Class.prototype );
    Matrix.prototype.constructor = Matrix;

    Matrix.prototype.multiplyCopy = function multiplyCopy (matrix) {
        return new Matrix(
            this.a * matrix.a + this.c * matrix.b,
            this.b * matrix.a + this.d * matrix.b,
            this.a * matrix.c + this.c * matrix.d,
            this.b * matrix.c + this.d * matrix.d,
            this.a * matrix.e + this.c * matrix.f + this.e,
            this.b * matrix.e + this.d * matrix.f + this.f
        );
    };

    Matrix.prototype.invert = function invert () {
        var ref = this;
        var a = ref.a;
        var b = ref.b;
        var d = ref.c;
        var e = ref.d;
        var g = ref.e;
        var h = ref.f;
        var det = a * e - b * d;

        if (det === 0) {
            return null;
        }

        return new Matrix(e / det, -b / det, -d / det, a / det,
                          (d * h - e * g) / det, (b * g - a * h) / det);
    };

    Matrix.prototype.clone = function clone () {
        return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
    };

    Matrix.prototype.equals = function equals (other) {
        if (!other) {
            return false;
        }

        return this.a === other.a && this.b === other.b &&
               this.c === other.c && this.d === other.d &&
               this.e === other.e && this.f === other.f;
    };

    Matrix.prototype.round = function round$1 (precision) {
        this.a = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(this.a, precision);
        this.b = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(this.b, precision);
        this.c = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(this.c, precision);
        this.d = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(this.d, precision);
        this.e = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(this.e, precision);
        this.f = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(this.f, precision);

        return this;
    };

    Matrix.prototype.toArray = function toArray (precision) {
        var result = [ this.a, this.b, this.c, this.d, this.e, this.f ];

        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* defined */])(precision)) {
            for (var i = 0; i < result.length; i++) {
                result[i] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(result[i], precision);
            }
        }

        return result;
    };

    Matrix.prototype.toString = function toString (precision, separator) {
        if ( separator === void 0 ) separator = ",";

        return this.toArray(precision).join(separator);
    };

    Matrix.translate = function translate (x, y) {
        return new Matrix(1, 0, 0, 1, x, y);
    };

    Matrix.unit = function unit () {
        return new Matrix(1, 0, 0, 1, 0, 0);
    };

    Matrix.rotate = function rotate (angle, x, y) {
        var matrix = new Matrix();
        matrix.a = Math.cos(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["h" /* rad */])(angle));
        matrix.b = Math.sin(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["h" /* rad */])(angle));
        matrix.c = -matrix.b;
        matrix.d = matrix.a;
        matrix.e = (x - x * matrix.a + y * matrix.b) || 0;
        matrix.f = (y - y * matrix.a - x * matrix.b) || 0;

        return matrix;
    };

    Matrix.scale = function scale (scaleX, scaleY) {
        return new Matrix(scaleX, 0, 0, scaleY, 0, 0);
    };

    return Matrix;
}(__WEBPACK_IMPORTED_MODULE_0__common__["d" /* Class */]));

Matrix.IDENTITY = Matrix.unit();

/* harmony default export */ __webpack_exports__["a"] = (Matrix);
//# sourceMappingURL=matrix.js.map


/***/ }),
/* 97 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_matrix__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_to_matrix__ = __webpack_require__(54);



var IDENTITY_MATRIX_HASH = __WEBPACK_IMPORTED_MODULE_0__geometry_matrix__["a" /* default */].IDENTITY.toString();

var Measurable = {
    extend: function(proto) {
        proto.bbox = this.bbox;
        proto.geometryChange = this.geometryChange;
    },

    bbox: function(transformation) {
        var combinedMatrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__geometry_to_matrix__["a" /* default */])(this.currentTransform(transformation));
        var matrixHash = combinedMatrix ? combinedMatrix.toString() : IDENTITY_MATRIX_HASH;
        var bbox;

        if (this._bboxCache && this._matrixHash === matrixHash) {
            bbox = this._bboxCache.clone();
        } else {
            bbox = this._bbox(combinedMatrix);
            this._bboxCache = bbox ? bbox.clone() : null;
            this._matrixHash = matrixHash;
        }

        var strokeWidth = this.options.get("stroke.width");
        if (strokeWidth && bbox) {
            bbox.expand(strokeWidth / 2);
        }

        return bbox;
    },

    geometryChange: function() {
        delete this._bboxCache;
        this.trigger("geometryChange", {
            element: this
        });
    }
};

/* harmony default export */ __webpack_exports__["a"] = (Measurable);
//# sourceMappingURL=measurable.js.map


/***/ }),
/* 98 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_traversable__ = __webpack_require__(226);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_elements_bounding_box__ = __webpack_require__(442);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_elements_clippend_bounding_box__ = __webpack_require__(443);






var Group = (function (Element) {
    function Group(options) {
        Element.call(this, options);
        this.children = [];
    }

    if ( Element ) Group.__proto__ = Element;
    Group.prototype = Object.create( Element && Element.prototype );
    Group.prototype.constructor = Group;

    Group.prototype.childrenChange = function childrenChange (action, items, index) {
        this.trigger("childrenChange",{
            action: action,
            items: items,
            index: index
        });
    };

    Group.prototype.append = function append$1 () {
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["b" /* append */])(this.children, arguments);
        this._reparent(arguments, this);

        this.childrenChange("add", arguments);

        return this;
    };

    Group.prototype.insert = function insert (index, element) {
        this.children.splice(index, 0, element);
        element.parent = this;

        this.childrenChange("add", [ element ], index);

        return this;
    };

    Group.prototype.insertAt = function insertAt (element, index) {
        return this.insert(index, element);
    };

    Group.prototype.remove = function remove (element) {
        var index = this.children.indexOf(element);
        if (index >= 0) {
            this.children.splice(index, 1);
            element.parent = null;
            this.childrenChange("remove", [ element ], index);
        }

        return this;
    };

    Group.prototype.removeAt = function removeAt (index) {
        if (0 <= index && index < this.children.length) {
            var element = this.children[index];
            this.children.splice(index, 1);
            element.parent = null;
            this.childrenChange("remove", [ element ], index);
        }

        return this;
    };

    Group.prototype.clear = function clear () {
        var items = this.children;
        this.children = [];
        this._reparent(items, null);

        this.childrenChange("remove", items, 0);

        return this;
    };

    Group.prototype.bbox = function bbox (transformation) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_elements_bounding_box__["a" /* default */])(this.children, true, this.currentTransform(transformation));
    };

    Group.prototype.rawBBox = function rawBBox () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_elements_bounding_box__["a" /* default */])(this.children, false);
    };

    Group.prototype._clippedBBox = function _clippedBBox (transformation) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils_elements_clippend_bounding_box__["a" /* default */])(this.children, this.currentTransform(transformation));
    };

    Group.prototype.currentTransform = function currentTransform (transformation) {
        return Element.prototype.currentTransform.call(this, transformation) || null;
    };

    Group.prototype.containsPoint = function containsPoint (point, parentTransform) {
        if (this.visible()) {
            var children = this.children;
            var transform = this.currentTransform(parentTransform);
            for (var idx = 0; idx < children.length; idx++) {
                if (children[idx].containsPoint(point, transform)) {
                    return true;
                }
            }
        }
        return false;
    };

    Group.prototype._reparent = function _reparent (elements, newParent) {
        var this$1 = this;

        for (var i = 0; i < elements.length; i++) {
            var child = elements[i];
            var parent = child.parent;
            if (parent && parent !== this$1 && parent.remove) {
                parent.remove(child);
            }

            child.parent = newParent;
        }
    };

    return Group;
}(__WEBPACK_IMPORTED_MODULE_0__element__["a" /* default */]));

Group.prototype.nodeType = "Group";

__WEBPACK_IMPORTED_MODULE_1__mixins_traversable__["a" /* default */].extend(Group.prototype, "children");

/* harmony default export */ __webpack_exports__["a"] = (Group);
//# sourceMappingURL=group.js.map


/***/ }),
/* 99 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SVG_NS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NONE; });
var SVG_NS = "http://www.w3.org/2000/svg";
var NONE = "none";


//# sourceMappingURL=constants.js.map


/***/ }),
/* 100 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = renderAttr;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);


function renderAttr(name, value) {
    return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(value) && value !== null) ? (" " + name + "='" + value + "' ") : "";
}
//# sourceMappingURL=render-attribute.js.map


/***/ }),
/* 101 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = defined;
var UNDEFINED = "undefined";

function defined(value) {
    return typeof value !== UNDEFINED;
}
//# sourceMappingURL=defined.js.map


/***/ }),
/* 102 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__document__ = __webpack_require__(232);


var offsetParent = function (element) {
    var offsetParent = element.offsetParent;

    while (offsetParent && offsetParent.style.position === "static") {
        offsetParent = offsetParent.offsetParent;
    }

    return offsetParent || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__document__["a" /* default */])(element);
};

/* harmony default export */ __webpack_exports__["a"] = (offsetParent);

//# sourceMappingURL=offset-parent.js.map


/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var queue_1 = __webpack_require__(514);
var Subscription_1 = __webpack_require__(16);
var observeOn_1 = __webpack_require__(528);
var ObjectUnsubscribedError_1 = __webpack_require__(524);
var SubjectSubscription_1 = __webpack_require__(1055);
/**
 * @class ReplaySubject<T>
 */
var ReplaySubject = (function (_super) {
    __extends(ReplaySubject, _super);
    function ReplaySubject(bufferSize, windowTime, scheduler) {
        if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; }
        if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; }
        _super.call(this);
        this.scheduler = scheduler;
        this._events = [];
        this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
        this._windowTime = windowTime < 1 ? 1 : windowTime;
    }
    ReplaySubject.prototype.next = function (value) {
        var now = this._getNow();
        this._events.push(new ReplayEvent(now, value));
        this._trimBufferThenGetEvents();
        _super.prototype.next.call(this, value);
    };
    ReplaySubject.prototype._subscribe = function (subscriber) {
        var _events = this._trimBufferThenGetEvents();
        var scheduler = this.scheduler;
        var subscription;
        if (this.closed) {
            throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
        }
        else if (this.hasError) {
            subscription = Subscription_1.Subscription.EMPTY;
        }
        else if (this.isStopped) {
            subscription = Subscription_1.Subscription.EMPTY;
        }
        else {
            this.observers.push(subscriber);
            subscription = new SubjectSubscription_1.SubjectSubscription(this, subscriber);
        }
        if (scheduler) {
            subscriber.add(subscriber = new observeOn_1.ObserveOnSubscriber(subscriber, scheduler));
        }
        var len = _events.length;
        for (var i = 0; i < len && !subscriber.closed; i++) {
            subscriber.next(_events[i].value);
        }
        if (this.hasError) {
            subscriber.error(this.thrownError);
        }
        else if (this.isStopped) {
            subscriber.complete();
        }
        return subscription;
    };
    ReplaySubject.prototype._getNow = function () {
        return (this.scheduler || queue_1.queue).now();
    };
    ReplaySubject.prototype._trimBufferThenGetEvents = function () {
        var now = this._getNow();
        var _bufferSize = this._bufferSize;
        var _windowTime = this._windowTime;
        var _events = this._events;
        var eventsCount = _events.length;
        var spliceCount = 0;
        // Trim events that fall out of the time window.
        // Start at the front of the list. Break early once
        // we encounter an event that falls within the window.
        while (spliceCount < eventsCount) {
            if ((now - _events[spliceCount].time) < _windowTime) {
                break;
            }
            spliceCount++;
        }
        if (eventsCount > _bufferSize) {
            spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
        }
        if (spliceCount > 0) {
            _events.splice(0, spliceCount);
        }
        return _events;
    };
    return ReplaySubject;
}(Subject_1.Subject));
exports.ReplaySubject = ReplaySubject;
var ReplayEvent = (function () {
    function ReplayEvent(time, value) {
        this.time = time;
        this.value = value;
    }
    return ReplayEvent;
}());
//# sourceMappingURL=ReplaySubject.js.map

/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var merge_1 = __webpack_require__(1060);
Observable_1.Observable.merge = merge_1.merge;
//# sourceMappingURL=merge.js.map

/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var auditTime_1 = __webpack_require__(946);
Observable_1.Observable.prototype.auditTime = auditTime_1.auditTime;
//# sourceMappingURL=auditTime.js.map

/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var switchMap_1 = __webpack_require__(1003);
Observable_1.Observable.prototype.switchMap = switchMap_1.switchMap;
//# sourceMappingURL=switchMap.js.map

/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var takeUntil_1 = __webpack_require__(1007);
Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil;
//# sourceMappingURL=takeUntil.js.map

/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 root_1 = __webpack_require__(42);
var Action_1 = __webpack_require__(1021);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var AsyncAction = (function (_super) {
    __extends(AsyncAction, _super);
    function AsyncAction(scheduler, work) {
        _super.call(this, scheduler, work);
        this.scheduler = scheduler;
        this.work = work;
        this.pending = false;
    }
    AsyncAction.prototype.schedule = function (state, delay) {
        if (delay === void 0) { delay = 0; }
        if (this.closed) {
            return this;
        }
        // Always replace the current state with the new state.
        this.state = state;
        // Set the pending flag indicating that this action has been scheduled, or
        // has recursively rescheduled itself.
        this.pending = true;
        var id = this.id;
        var scheduler = this.scheduler;
        //
        // Important implementation note:
        //
        // Actions only execute once by default, unless rescheduled from within the
        // scheduled callback. This allows us to implement single and repeat
        // actions via the same code path, without adding API surface area, as well
        // as mimic traditional recursion but across asynchronous boundaries.
        //
        // However, JS runtimes and timers distinguish between intervals achieved by
        // serial `setTimeout` calls vs. a single `setInterval` call. An interval of
        // serial `setTimeout` calls can be individually delayed, which delays
        // scheduling the next `setTimeout`, and so on. `setInterval` attempts to
        // guarantee the interval callback will be invoked more precisely to the
        // interval period, regardless of load.
        //
        // Therefore, we use `setInterval` to schedule single and repeat actions.
        // If the action reschedules itself with the same delay, the interval is not
        // canceled. If the action doesn't reschedule, or reschedules with a
        // different delay, the interval will be canceled after scheduled callback
        // execution.
        //
        if (id != null) {
            this.id = this.recycleAsyncId(scheduler, id, delay);
        }
        this.delay = delay;
        // If this action has already an async Id, don't request a new one.
        this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
        return this;
    };
    AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        return root_1.root.setInterval(scheduler.flush.bind(scheduler, this), delay);
    };
    AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        // If this action is rescheduled with the same delay time, don't clear the interval id.
        if (delay !== null && this.delay === delay && this.pending === false) {
            return id;
        }
        // Otherwise, if the action's delay time is different from the current delay,
        // or the action has been rescheduled before it's executed, clear the interval id
        return root_1.root.clearInterval(id) && undefined || undefined;
    };
    /**
     * Immediately executes this action and the `work` it contains.
     * @return {any}
     */
    AsyncAction.prototype.execute = function (state, delay) {
        if (this.closed) {
            return new Error('executing a cancelled action');
        }
        this.pending = false;
        var error = this._execute(state, delay);
        if (error) {
            return error;
        }
        else if (this.pending === false && this.id != null) {
            // Dequeue if the action didn't reschedule itself. Don't call
            // unsubscribe(), because the action could reschedule later.
            // For example:
            // ```
            // scheduler.schedule(function doWork(counter) {
            //   /* ... I'm a busy worker bee ... */
            //   var originalAction = this;
            //   /* wait 100ms before rescheduling the action */
            //   setTimeout(function () {
            //     originalAction.schedule(counter + 1);
            //   }, 100);
            // }, 1000);
            // ```
            this.id = this.recycleAsyncId(this.scheduler, this.id, null);
        }
    };
    AsyncAction.prototype._execute = function (state, delay) {
        var errored = false;
        var errorValue = undefined;
        try {
            this.work(state);
        }
        catch (e) {
            errored = true;
            errorValue = !!e && e || new Error(e);
        }
        if (errored) {
            this.unsubscribe();
            return errorValue;
        }
    };
    AsyncAction.prototype._unsubscribe = function () {
        var id = this.id;
        var scheduler = this.scheduler;
        var actions = scheduler.actions;
        var index = actions.indexOf(this);
        this.work = null;
        this.state = null;
        this.pending = false;
        this.scheduler = null;
        if (index !== -1) {
            actions.splice(index, 1);
        }
        if (id != null) {
            this.id = this.recycleAsyncId(scheduler, id, null);
        }
        this.delay = null;
    };
    return AsyncAction;
}(Action_1.Action));
exports.AsyncAction = AsyncAction;
//# sourceMappingURL=AsyncAction.js.map

/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Scheduler_1 = __webpack_require__(812);
var AsyncScheduler = (function (_super) {
    __extends(AsyncScheduler, _super);
    function AsyncScheduler() {
        _super.apply(this, arguments);
        this.actions = [];
        /**
         * A flag to indicate whether the Scheduler is currently executing a batch of
         * queued actions.
         * @type {boolean}
         */
        this.active = false;
        /**
         * An internal ID used to track the latest asynchronous task such as those
         * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and
         * others.
         * @type {any}
         */
        this.scheduled = undefined;
    }
    AsyncScheduler.prototype.flush = function (action) {
        var actions = this.actions;
        if (this.active) {
            actions.push(action);
            return;
        }
        var error;
        this.active = true;
        do {
            if (error = action.execute(action.state, action.delay)) {
                break;
            }
        } while (action = actions.shift()); // exhaust the scheduler queue
        this.active = false;
        if (error) {
            while (action = actions.shift()) {
                action.unsubscribe();
            }
            throw error;
        }
    };
    return AsyncScheduler;
}(Scheduler_1.Scheduler));
exports.AsyncScheduler = AsyncScheduler;
//# sourceMappingURL=AsyncScheduler.js.map

/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 __());
};
/**
 * An error thrown when an element was queried at a certain index of an
 * Observable, but no such index or position exists in that sequence.
 *
 * @see {@link elementAt}
 * @see {@link take}
 * @see {@link takeLast}
 *
 * @class ArgumentOutOfRangeError
 */
var ArgumentOutOfRangeError = (function (_super) {
    __extends(ArgumentOutOfRangeError, _super);
    function ArgumentOutOfRangeError() {
        var err = _super.call(this, 'argument out of range');
        this.name = err.name = 'ArgumentOutOfRangeError';
        this.stack = err.stack;
        this.message = err.message;
    }
    return ArgumentOutOfRangeError;
}(Error));
exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError;
//# sourceMappingURL=ArgumentOutOfRangeError.js.map

/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(14);

/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(16);

/***/ }),
/* 113 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateInputModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dateinput_component__ = __webpack_require__(264);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__localization_localized_messages_directive__ = __webpack_require__(541);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__localization_dateinput_custom_messages_component__ = __webpack_require__(265);






var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__dateinput_component__["a" /* DateInputComponent */],
    __WEBPACK_IMPORTED_MODULE_5__localization_dateinput_custom_messages_component__["a" /* DateInputCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_4__localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the DateInput component.
 */
var DateInputModule = (function () {
    function DateInputModule() {
    }
    return DateInputModule;
}());

DateInputModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES],
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["a" /* IntlModule */]]
            },] },
];
/** @nocollapse */
DateInputModule.ctorParameters = function () { return []; };


/***/ }),
/* 114 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'accept': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'acceptLabel': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'cancel': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'cancelLabel': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'now': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'nowLabel': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'toggle': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 115 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export SCROLLER_FACTORY_TOKEN */
/* unused harmony export DEFAULT_SCROLLER_FACTORY */
/* unused harmony export ScrollDirection */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualizationComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_row_height_service__ = __webpack_require__(551);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_scroller_service__ = __webpack_require__(552);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_scheduler_animationFrame__ = __webpack_require__(512);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_scheduler_animationFrame___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_scheduler_animationFrame__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_observable_interval__ = __webpack_require__(145);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_observable_interval___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_observable_interval__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_observable_empty__ = __webpack_require__(489);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_observable_empty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_add_observable_empty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_observable_of__ = __webpack_require__(241);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_add_observable_of__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_add_operator_combineLatest__ = __webpack_require__(493);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_add_operator_combineLatest___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_rxjs_add_operator_combineLatest__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_scan__ = __webpack_require__(497);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_scan___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_scan__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_takeWhile__ = __webpack_require__(501);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_takeWhile___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_takeWhile__);
/* tslint:disable:component-selector-name  component-selector-type */
















/**
 * @hidden
 */
var SCROLLER_FACTORY_TOKEN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]('dateinputs-scroll-service-factory');
/**
 * @hidden
 */
function DEFAULT_SCROLLER_FACTORY(observable) {
    return new __WEBPACK_IMPORTED_MODULE_2__services_scroller_service__["a" /* ScrollerService */](observable);
}
/**
 * @hidden
 */
var ScrollDirection;
(function (ScrollDirection) {
    ScrollDirection[ScrollDirection["Up"] = 0] = "Up";
    ScrollDirection[ScrollDirection["Down"] = 1] = "Down";
})(ScrollDirection || (ScrollDirection = {}));
var FRAME_DURATION = 17;
var scrollModifiers = (_a = {},
    _a[ScrollDirection.Down] = function (step) { return function (value) { return value + step; }; },
    _a[ScrollDirection.Up] = function (step) { return function (value) { return value - step; }; },
    _a);
var scrollNormalizers = (_b = {},
    _b[ScrollDirection.Down] = function (end) { return function (value) { return Math.min(value, end); }; },
    _b[ScrollDirection.Up] = function (end) { return function (value) { return Math.max(value, end); }; },
    _b);
var scrollValidators = (_c = {},
    _c[ScrollDirection.Down] = function (end) { return function (start) { return start < end; }; },
    _c[ScrollDirection.Up] = function (end) { return function (start) { return start > end; }; },
    _c);
var differenceToScroll = function (scrollTop, staticOffset, maxScrollDifference) {
    return Math.min(Math.abs(staticOffset - scrollTop), maxScrollDifference);
};
/**
 * @hidden
 */
var VirtualizationComponent = (function () {
    function VirtualizationComponent(scrollerFactory, container, renderer, zone) {
        this.container = container;
        this.renderer = renderer;
        this.zone = zone;
        this.itemHeight = 1;
        this.topOffset = 0;
        this.bottomOffset = 0;
        this.maxScrollDifference = 100;
        this.scrollOffsetHeight = 0;
        this.scrollDuration = 150;
        this.activeIndexChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.pageChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.scrollChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.resolvedPromise = Promise.resolve(null);
        this.dispatcher = new __WEBPACK_IMPORTED_MODULE_6_rxjs_Subject__["Subject"]();
        this.scroller = scrollerFactory(this.dispatcher);
    }
    VirtualizationComponent.prototype.wrapperClasses = function () {
        return true;
    };
    VirtualizationComponent.prototype.ngOnChanges = function (changes) {
        if (changes.take || changes.total) {
            this.initServices();
            this.totalHeight = this.getTotalHeight();
        }
    };
    VirtualizationComponent.prototype.ngOnInit = function () {
        if (!this.rowHeightService) {
            this.rowHeightService = this.createRowHeightService();
        }
    };
    VirtualizationComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.zone.runOutsideAngular(function () {
            _this.containerScrollSubscription = _this.scroll$()
                .map(function (event) { return event.target; })
                .subscribe(function (t) {
                _this.dispatcher.next(t);
                _this.emitActiveIndex(t);
            });
        });
    };
    VirtualizationComponent.prototype.ngOnDestroy = function () {
        if (this.containerScrollSubscription) {
            this.containerScrollSubscription.unsubscribe();
        }
        if (this.scrollSubscription) {
            this.scrollSubscription.unsubscribe();
        }
        if (this.animationSubscription) {
            this.animationSubscription.unsubscribe();
        }
    };
    VirtualizationComponent.prototype.activeIndex = function () {
        return this.itemIndex(this.container.nativeElement.scrollTop);
    };
    VirtualizationComponent.prototype.itemIndex = function (offset) {
        return this.rowHeightService.index(offset);
    };
    VirtualizationComponent.prototype.itemOffset = function (index) {
        return this.rowHeightService.offset(index);
    };
    VirtualizationComponent.prototype.isIndexVisible = function (index) {
        if (!this.rowHeightService) {
            return false;
        }
        var currentScrollTop = this.container.nativeElement.scrollTop;
        var top = this.rowHeightService.offset(index);
        var bottom = top + this.rowHeightService.height(index);
        return currentScrollTop >= top && currentScrollTop <= bottom;
    };
    VirtualizationComponent.prototype.isListScrolled = function (index) {
        return this.container.nativeElement.scrollTop !== this.rowHeightService.offset(index);
    };
    VirtualizationComponent.prototype.scrollTo = function (value) {
        this.renderer.setProperty(this.container.nativeElement, 'scrollTop', value);
    };
    VirtualizationComponent.prototype.scrollToIndex = function (index) {
        var _this = this;
        //XXX: scrolling with tick is required to prevent list jump in Chrome.
        //Original issue: focus first day in the month and press LEFT arrow.
        //Notice how the view jumps on every day change.
        //
        this.resolvedPromise.then(function () {
            _this.scrollTo(_this.rowHeightService.offset(index));
        });
    };
    VirtualizationComponent.prototype.scrollToBottom = function () {
        this.scrollTo(this.totalHeight);
    };
    VirtualizationComponent.prototype.animateToIndex = function (index) {
        var _this = this;
        if (this.animationSubscription) {
            this.animationSubscription.unsubscribe();
        }
        var indexOffset = this.rowHeightService.offset(index);
        var direction = this.getScrollDirection(indexOffset);
        var _a = this.scrollRange(indexOffset, direction), start = _a.start, end = _a.end;
        if (start === end) {
            return;
        }
        var step = this.scrollStep(start, end);
        var modifyScroll = scrollModifiers[direction](step);
        var normalizeScroll = scrollNormalizers[direction](end);
        var isScrollValid = scrollValidators[direction](modifyScroll(end));
        this.zone.runOutsideAngular(function () {
            _this.animationSubscription = __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__["Observable"].of(start)
                .combineLatest(__WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__["Observable"].interval(0, __WEBPACK_IMPORTED_MODULE_4_rxjs_scheduler_animationFrame__["animationFrame"]))
                .map(function (stream) { return stream[0]; })
                .scan(modifyScroll)
                .takeWhile(isScrollValid)
                .map(normalizeScroll)
                .subscribe(function (x) { return _this.scrollTo(x); });
        });
    };
    VirtualizationComponent.prototype.scrollRange = function (indexOffset, direction) {
        var containerScrollTop = this.container.nativeElement.scrollTop;
        if (parseInt(indexOffset, 10) === parseInt(containerScrollTop, 10)) {
            return { start: indexOffset, end: indexOffset };
        }
        var max = this.containerMaxScroll();
        var sign = direction === ScrollDirection.Up ? 1 : -1;
        var difference = differenceToScroll(containerScrollTop, indexOffset, this.maxScrollDifference);
        var end = Math.min(indexOffset, max);
        var start = Math.min(Math.max(end + (sign * difference), 0), max);
        return { start: start, end: end };
    };
    VirtualizationComponent.prototype.scrollStep = function (start, end) {
        return Math.abs(end - start) / (this.scrollDuration / FRAME_DURATION);
    };
    VirtualizationComponent.prototype.scroll$ = function () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["f" /* isDocumentAvailable */])() ? __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__["Observable"].fromEvent(this.container.nativeElement, 'scroll') : __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__["Observable"].empty();
    };
    VirtualizationComponent.prototype.initServices = function () {
        var _this = this;
        this.rowHeightService = this.createRowHeightService();
        if (this.scrollSubscription) {
            this.scrollSubscription.unsubscribe();
        }
        this.scrollSubscription = this.scroller
            .create(this.rowHeightService, this.skip, this.take, this.total, this.topOffset, this.scrollOffsetHeight)
            .subscribe(function (x) { return _this.zone.run(function () {
            if (x instanceof __WEBPACK_IMPORTED_MODULE_2__services_scroller_service__["b" /* PageAction */]) {
                _this.pageChange.emit(x);
            }
            else {
                _this.scrollChange.emit(x);
            }
        }); });
    };
    VirtualizationComponent.prototype.createRowHeightService = function () {
        return new __WEBPACK_IMPORTED_MODULE_1__services_row_height_service__["a" /* RowHeightService */](this.total, this.itemHeight, 0);
    };
    VirtualizationComponent.prototype.getTotalHeight = function () {
        return this.rowHeightService.totalHeight() + this.bottomOffset;
    };
    VirtualizationComponent.prototype.emitActiveIndex = function (_a) {
        var scrollTop = _a.scrollTop;
        var index = this.rowHeightService.index(scrollTop - this.topOffset);
        if (this.lastActiveIndex !== index) {
            this.lastActiveIndex = index;
            this.activeIndexChange.emit(index);
        }
    };
    VirtualizationComponent.prototype.getScrollDirection = function (indexOffset) {
        return indexOffset < this.container.nativeElement.scrollTop ? ScrollDirection.Up : ScrollDirection.Down;
    };
    VirtualizationComponent.prototype.containerMaxScroll = function () {
        var containerElement = this.container.nativeElement;
        return containerElement.scrollHeight - containerElement.offsetHeight;
    };
    return VirtualizationComponent;
}());

VirtualizationComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                providers: [{
                        provide: SCROLLER_FACTORY_TOKEN,
                        useValue: DEFAULT_SCROLLER_FACTORY
                    }],
                selector: 'kendo-virtualization',
                template: "\n    <ng-content></ng-content>\n    <div\n        class=\"k-scrollable-placeholder\"\n        [style.height.px]=\"totalHeight\"\n    ></div>\n  "
            },] },
];
/** @nocollapse */
VirtualizationComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [SCROLLER_FACTORY_TOKEN,] },] },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };
VirtualizationComponent.propDecorators = {
    'itemHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'topOffset': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'bottomOffset': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'maxScrollDifference': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'scrollOffsetHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'scrollDuration': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skip': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'take': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'total': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeIndexChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'pageChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'scrollChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'wrapperClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-content',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-scrollable',] },],
};
var _a, _b, _c;


/***/ }),
/* 116 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export NavigationEvent */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavigationService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_keys__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_action__ = __webpack_require__(87);




var MIN_INDEX = 0;
/**
 * @hidden
 */
var NavigationEvent = (function () {
    /**
     * The index of the item to which the user navigated.
     */
    function NavigationEvent(index, originalEvent) {
        this.index = index;
        this.originalEvent = originalEvent;
    }
    return NavigationEvent;
}());

/**
 * @hidden
 */
var NavigationService = (function () {
    function NavigationService() {
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.enter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.tab = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.esc = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.up = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.right = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.down = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.left = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.delete = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.backspace = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.home = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.end = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    NavigationService.prototype.process = function (args) {
        var keyCode = args.originalEvent.keyCode;
        var altKey = args.originalEvent.altKey;
        var index;
        var action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Undefined;
        if (altKey && keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].down) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Open;
        }
        else if (altKey && keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].up) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Close;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].enter) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Enter;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].esc) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Esc;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].tab) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Tab;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].up) {
            index = this.next({ current: args.current, start: args.max, end: args.min, step: -1 });
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Up;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].left) {
            index = this.next({ current: args.current, start: args.max, end: args.min, step: -1 });
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Left;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].down) {
            index = this.next({ current: args.current, start: args.min, end: args.max, step: 1 });
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Down;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].right) {
            index = this.next({ current: args.current, start: args.min, end: args.max, step: 1 });
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Right;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].home) {
            index = MIN_INDEX;
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Home;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].end) {
            index = args.max;
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].End;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].delete) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Delete;
        }
        else if (keyCode === __WEBPACK_IMPORTED_MODULE_2__common_keys__["a" /* Keys */].backspace) {
            action = __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Backspace;
        }
        var eventData = new NavigationEvent(index, args.originalEvent);
        if (action !== __WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */].Undefined) {
            this[__WEBPACK_IMPORTED_MODULE_3__navigation_action__["a" /* NavigationAction */][action].toLowerCase()].emit(eventData);
        }
        return action;
    };
    NavigationService.prototype.next = function (args) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["b" /* isPresent */])(args.current)) {
            return args.start;
        }
        else {
            return args.current !== args.end ? args.current + args.step : args.end;
        }
    };
    return NavigationService;
}());

NavigationService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
NavigationService.ctorParameters = function () { return []; };


/***/ }),
/* 117 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SearchBarComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_keys__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* tslint:disable:member-ordering */




/**
 * @hidden
 */
var SearchBarComponent = (function () {
    function SearchBarComponent(rtl, renderer) {
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.onClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.onNavigate = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this._userInput = "";
        this._previousValue = "";
        this._placeholder = "";
        this._composing = false;
        this.direction = rtl ? 'rtl' : 'ltr';
        this.renderer = renderer;
    }
    Object.defineProperty(SearchBarComponent.prototype, "userInput", {
        get: function () {
            return this._userInput;
        },
        set: function (userInput) {
            this._userInput = userInput || "";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SearchBarComponent.prototype, "searchBarClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SearchBarComponent.prototype, "value", {
        get: function () {
            return this.input.nativeElement.value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SearchBarComponent.prototype, "placeholder", {
        get: function () {
            return this._placeholder;
        },
        set: function (text) {
            this._placeholder = text || '';
            this.setInputSize();
        },
        enumerable: true,
        configurable: true
    });
    SearchBarComponent.prototype.compositionStart = function () {
        this._composing = true;
    };
    SearchBarComponent.prototype.compositionUpdate = function () {
        this._composing = true;
    };
    SearchBarComponent.prototype.compositionEnd = function () {
        this._composing = false;
        this._previousValue = this.value;
        this.valueChange.emit(this.value);
    };
    SearchBarComponent.prototype.ngOnChanges = function (changes) {
        var previousUserInput;
        if (this.input && (changes.userInput || changes.suggestedText)) {
            if (changes.userInput && changes.userInput.previousValue) {
                if (this._previousValue === changes.userInput.previousValue) {
                    previousUserInput = this._previousValue;
                }
                else {
                    previousUserInput = changes.userInput.currentValue || "";
                }
            }
            else {
                previousUserInput = this._previousValue;
            }
            var caretIndex = this.input.nativeElement.selectionStart;
            var caretAtEnd = previousUserInput.length === caretIndex;
            this.writeInputValue(this.suggestedText ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["c" /* combineStr */])(this.userInput, this.suggestedText) : this.userInput);
            if (this.suggestedText) {
                this.setInputSelection(this.userInput.length, this.suggestedText.length);
            }
            else if (caretAtEnd) {
                this.setInputSelection(this.userInput.length, this.userInput.length);
            }
            else {
                this.setInputSelection(caretIndex, caretIndex);
            }
        }
    };
    SearchBarComponent.prototype.writeInputValue = function (text) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* isDocumentAvailable */])()) {
            this.renderer.setProperty(this.input.nativeElement, 'value', text);
        }
    };
    SearchBarComponent.prototype.setInputSelection = function (start, end) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* isDocumentAvailable */])() && this.input.nativeElement === document.activeElement) {
            try {
                this.input.nativeElement.setSelectionRange(start, end);
            }
            catch (e) {
                //Make sure element is in the DOM before invoking its methods
            }
        }
    };
    SearchBarComponent.prototype.handleInput = function (event) {
        var value = event.target.value;
        if (value !== this.userInput && !this._composing) {
            this._previousValue = value;
            this.valueChange.emit(value);
        }
    };
    SearchBarComponent.prototype.handleFocus = function (event) {
        this.onFocus.emit(event);
    };
    SearchBarComponent.prototype.handleBlur = function (event) {
        this.onBlur.emit(event);
    };
    SearchBarComponent.prototype.handleKeydown = function (event) {
        var keyCode = event.keyCode;
        var keys = [__WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].up, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].down, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].left, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].right, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].enter,
            __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].esc, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].delete, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].backspace, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].home, __WEBPACK_IMPORTED_MODULE_1__common_keys__["a" /* Keys */].end];
        if (keys.indexOf(keyCode) > -1) {
            this.onNavigate.emit(event);
        }
    };
    SearchBarComponent.prototype.focus = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* isDocumentAvailable */])()) {
            this.input.nativeElement.focus();
        }
    };
    SearchBarComponent.prototype.blur = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* isDocumentAvailable */])()) {
            this.input.nativeElement.blur();
        }
    };
    SearchBarComponent.prototype.setInputSize = function () {
        var lengthOf = function (x) { return x ? x.length : 0; };
        var input = this.input.nativeElement;
        var placeholderLength = lengthOf(this.placeholder);
        var textLength = lengthOf(this.value);
        var size = Math.max(placeholderLength, textLength, 1);
        this.renderer.setAttribute(input, 'size', size.toString());
    };
    return SearchBarComponent;
}());

SearchBarComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-searchbar',
                template: "\n        <input #input\n            autocomplete=\"off\"\n            [id]=\"id\"\n            [disabled]=\"disabled\"\n            [readonly]=\"readonly\"\n            [placeholder]=\"placeholder\"\n            [class]=\"'k-input'\"\n            (input)=\"handleInput($event)\"\n            (focus)=\"handleFocus($event)\"\n            (blur)=\"handleBlur($event)\"\n            (keydown)=\"handleKeydown($event)\"\n            [attr.tabIndex]=\"tabIndex\"\n            [attr.dir]=\"direction\"\n            [attr.role]=\"role\"\n            [attr.aria-disabled]=\"disabled\"\n            [attr.aria-readonly]=\"readonly\"\n            [attr.aria-haspopup]=\"true\"\n            [attr.aria-expanded]=\"popupOpen\"\n            [attr.aria-owns]=\"listId\"\n            [attr.aria-activedescendant]=\"activeDescendant\"\n        />\n   "
            },] },
];
/** @nocollapse */
SearchBarComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
]; };
SearchBarComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'listId': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeDescendant': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'readonly': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupOpen': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'role': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'userInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'suggestedText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onNavigate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'input': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["input",] },],
    'searchBarClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-searchbar',] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'compositionStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["compositionstart",] },],
    'compositionUpdate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["compositionupdate",] },],
    'compositionEnd': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["compositionend",] },],
};


/***/ }),
/* 118 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnBase; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var ColumnBase = (function () {
    function ColumnBase(parent) {
        this.parent = parent;
    }
    Object.defineProperty(ColumnBase.prototype, "level", {
        /**
         * @hidden
         */
        get: function () {
            return this.parent ? this.parent.level + 1 : 0;
        },
        enumerable: true,
        configurable: true
    });
    return ColumnBase;
}());

ColumnBase.propDecorators = {
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'width': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'locked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'hidden': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'headerCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'children': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChildren"], args: [ColumnBase,] },],
};


/***/ }),
/* 119 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DraggableDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__telerik_kendo_draggable__ = __webpack_require__(471);


/**
 * @hidden
 */
var DraggableDirective = (function () {
    function DraggableDirective(element, ngZone) {
        var _this = this;
        this.kendo = {
            drag: new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](),
            press: new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](),
            release: new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]()
        };
        if (typeof document !== 'undefined') {
            this.draggable = new __WEBPACK_IMPORTED_MODULE_1__telerik_kendo_draggable__["a" /* default */]({
                drag: function (e) { return _this.kendo.drag.next(Object.assign({}, e, { column: _this.column })); },
                press: function (e) { return _this.kendo.press.next(Object.assign({}, e, { column: _this.column })); },
                release: function (e) { return _this.kendo.release.next(Object.assign({}, e, { column: _this.column })); }
            });
            ngZone.runOutsideAngular(function () { return _this.draggable.bindTo(element.nativeElement); });
        }
    }
    Object.defineProperty(DraggableDirective.prototype, "kendoGridDraggable", {
        set: function (column) {
            this.column = column;
        },
        enumerable: true,
        configurable: true
    });
    DraggableDirective.prototype.ngOnDestroy = function () {
        if (typeof document !== 'undefined') {
            this.draggable.destroy();
        }
    };
    return DraggableDirective;
}());

DraggableDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                outputs: ['kendo.press', 'kendo.drag', 'kendo.release'],
                selector: '[kendoGridDraggable]'
            },] },
];
/** @nocollapse */
DraggableDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };
DraggableDirective.propDecorators = {
    'kendoGridDraggable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 120 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PreventableEvent; });
/**
 * @hidden
 */
var PreventableEvent = (function () {
    function PreventableEvent() {
        this.prevented = false;
    }
    /**
     * Prevents the default action for a specified event.
     *
     * In this way, the source component suppresses
     * the built-in behavior that follows the event.
     */
    PreventableEvent.prototype.preventDefault = function () {
        this.prevented = true;
    };
    /**
     * Returns `true` if the event was prevented
     * by any of its subscribers.
     *
     * @returns `true` if the default action was prevented.
     * Otherwise, returns `false`.
     */
    PreventableEvent.prototype.isDefaultPrevented = function () {
        return this.prevented;
    };
    return PreventableEvent;
}());



/***/ }),
/* 121 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StringFilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__string_filter_component__ = __webpack_require__(338);





/**
 * Represents a string filter-cell component.
 *
 * @example
 *
 *  ```ts-no-run
 *      <kendo-grid-column field="ProductName" title="Product Name">
 *          <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
 *          <kendo-grid-string-filter-cell
 *              [showOperators]="false"
 *              [column]="column"
 *              [filter]="filter">
 *          </kendo-grid-string-filter-cell>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var StringFilterCellComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StringFilterCellComponent, _super);
    function StringFilterCellComponent(filterService, localization) {
        var _this = _super.call(this, filterService, localization) || this;
        /**
         * Determines if the drop-down filter operators will be shown. The default value is `true`.
         * @type {boolean}
         */
        _this.showOperators = true;
        return _this;
    }
    return StringFilterCellComponent;
}(__WEBPACK_IMPORTED_MODULE_4__string_filter_component__["a" /* StringFilterComponent */]));

StringFilterCellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-string-filter-cell',
                template: "\n        <kendo-grid-filter-wrapper-cell\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [defaultOperator]=\"operator\"\n            [showOperators]=\"showOperators\">\n            <input class=\"k-textbox\" kendoFilterInput [ngModel]=\"currentFilter?.value\" />\n        </kendo-grid-filter-wrapper-cell>\n    "
            },] },
];
/** @nocollapse */
StringFilterCellComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
StringFilterCellComponent.propDecorators = {
    'showOperators': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 122 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SinglePopupService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_preventable_event__ = __webpack_require__(120);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_Subject__);






var contains = function (node, predicate) {
    while (node) {
        if (predicate(node)) {
            return true;
        }
        node = node.parentNode;
    }
    return false;
};
var CloseEvent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](CloseEvent, _super);
    function CloseEvent() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return CloseEvent;
}(__WEBPACK_IMPORTED_MODULE_4__common_preventable_event__["a" /* PreventableEvent */]));
/**
 * @hidden
 */
var SinglePopupService = (function () {
    function SinglePopupService(popupService, renderer, ngZone) {
        this.popupService = popupService;
        this.renderer = renderer;
        this.ngZone = ngZone;
        this.onClose = new __WEBPACK_IMPORTED_MODULE_5_rxjs_Subject__["Subject"]();
    }
    SinglePopupService.prototype.open = function (anchor, template, popupRef) {
        var toggle = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(popupRef) && this.popupRef === popupRef;
        this.destroy();
        if (!toggle) {
            this.popupRef = this.popupService.open({
                anchor: anchor,
                content: template
            });
            this.attachClose(anchor);
        }
        return this.popupRef;
    };
    SinglePopupService.prototype.destroy = function () {
        if (this.popupRef) {
            this.detachClose();
            this.popupRef.close();
            this.popupRef = null;
        }
    };
    SinglePopupService.prototype.detachClose = function () {
        if (this.removeClick) {
            this.removeClick();
        }
    };
    SinglePopupService.prototype.attachClose = function (skipElement) {
        var _this = this;
        this.detachClose();
        this.ngZone.runOutsideAngular(function () {
            return _this.removeClick = _this.renderer.listen("document", "click", function (_a) {
                var target = _a.target;
                if (!contains(target, function (x) { return _this.popupRef.popupElement === x || x === skipElement; })) {
                    var args = new CloseEvent();
                    _this.onClose.next(args);
                    if (!args.isDefaultPrevented()) {
                        _this.destroy();
                    }
                }
            });
        });
    };
    return SinglePopupService;
}());

SinglePopupService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Injectable"] },
];
/** @nocollapse */
SinglePopupService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["NgZone"], },
]; };


/***/ }),
/* 123 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StringFilterMenuComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__string_filter_component__ = __webpack_require__(338);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__ = __webpack_require__(3);





var StringFilterMenuComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StringFilterMenuComponent, _super);
    function StringFilterMenuComponent(localization) {
        var _this = _super.call(this, null, localization) || this;
        _this.logicOperators = [
            { text: "And", value: "and" },
            { text: "Or", value: "or" }
        ];
        /**
         * The current menu filter.
         * @type {CompositeFilterDescriptor}
         */
        _this.filter = { filters: [], logic: "and" };
        /**
         * Determines if the second criterion inputs should be shown
         */
        _this.extra = true;
        return _this;
    }
    Object.defineProperty(StringFilterMenuComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StringFilterMenuComponent.prototype, "firstFilter", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter.filters) && this.filter.filters.length) {
                return this.filter.filters[0];
            }
            else {
                return this.insertDefaultFilter(0, {
                    field: (this.column || {}).field,
                    operator: this.currentOperator
                });
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StringFilterMenuComponent.prototype, "secondFilter", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter.filters) && this.filter.filters.length > 1) {
                return this.filter.filters[1];
            }
            else {
                return this.insertDefaultFilter(1, {
                    field: (this.column || {}).field,
                    operator: this.currentOperator
                });
            }
        },
        enumerable: true,
        configurable: true
    });
    StringFilterMenuComponent.prototype.logicChange = function (value) {
        this.filter.logic = value;
    };
    StringFilterMenuComponent.prototype.insertDefaultFilter = function (index, filter) {
        this.filter = (this.filter || { filters: [], logic: "and" });
        this.filter.filters[index] = filter;
        return filter;
    };
    return StringFilterMenuComponent;
}(__WEBPACK_IMPORTED_MODULE_3__string_filter_component__["a" /* StringFilterComponent */]));

StringFilterMenuComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-string-filter-menu',
                template: "\n        <kendo-grid-string-filter-menu-input\n            [currentFilter]=\"firstFilter\"\n            [operators]=\"operators\"\n            [filterService]=\"filterService\"\n            [column]=\"column\"\n            [filter]=\"filter\">\n        </kendo-grid-string-filter-menu-input>\n        <kendo-dropdownlist\n            *ngIf=\"extra\"\n            class=\"k-filter-and\"\n            [data]=\"logicOperators\"\n            [valuePrimitive]=\"true\"\n            (valueChange)=\"logicChange($event)\"\n            [value]=\"filter?.logic\"\n            textField=\"text\"\n            valueField=\"value\">\n        </kendo-dropdownlist>\n        <kendo-grid-string-filter-menu-input\n            *ngIf=\"extra\"\n            [operators]=\"operators\"\n            [currentFilter]=\"secondFilter\"\n            [filterService]=\"filterService\"\n            [column]=\"column\"\n            [filter]=\"filter\">\n        </kendo-grid-string-filter-menu-input>\n    "
            },] },
];
/** @nocollapse */
StringFilterMenuComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
StringFilterMenuComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell',] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'extra': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 124 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_header_template_directive__ = __webpack_require__(189);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__group_header_component__ = __webpack_require__(590);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__group_footer_template_directive__ = __webpack_require__(188);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__group_panel_component__ = __webpack_require__(592);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__group_indicator_component__ = __webpack_require__(591);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__shared_module__ = __webpack_require__(50);








var exportedModules = [
    __WEBPACK_IMPORTED_MODULE_2__group_header_template_directive__["a" /* GroupHeaderTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_4__group_footer_template_directive__["a" /* GroupFooterTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_3__group_header_component__["a" /* GroupHeaderComponent */],
    __WEBPACK_IMPORTED_MODULE_5__group_panel_component__["a" /* GroupPanelComponent */],
    __WEBPACK_IMPORTED_MODULE_6__group_indicator_component__["a" /* GroupIndicatorComponent */]
];
/**
 * @hidden
 */
var GroupModule = (function () {
    function GroupModule() {
    }
    GroupModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_2__group_header_template_directive__["a" /* GroupHeaderTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_4__group_footer_template_directive__["a" /* GroupFooterTemplateDirective */]
        ];
    };
    return GroupModule;
}());

GroupModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [exportedModules],
                exports: [exportedModules],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_7__shared_module__["a" /* SharedModule */]]
            },] },
];
/** @nocollapse */
GroupModule.ctorParameters = function () { return []; };


/***/ }),
/* 125 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupsService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_expand_state_service__ = __webpack_require__(302);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);




var removeLast = function (groupIndex) { return groupIndex.lastIndexOf("_") > -1
    ? groupIndex.slice(0, groupIndex.lastIndexOf("_"))
    : ""; };
/**
 * @hidden
 */
var GroupsService = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](GroupsService, _super);
    function GroupsService(isCollapsed) {
        if (isCollapsed === void 0) { isCollapsed = false; }
        return _super.call(this, isCollapsed) || this;
    }
    GroupsService.prototype.isInExpandedGroup = function (groupIndex, skipSelf) {
        if (skipSelf === void 0) { skipSelf = true; }
        if (skipSelf) {
            groupIndex = removeLast(groupIndex);
        }
        var expanded = true;
        while (groupIndex && expanded) {
            expanded = this.isExpanded(groupIndex);
            groupIndex = removeLast(groupIndex);
        }
        return expanded;
    };
    GroupsService.prototype.expandChildren = function (groupIndex) {
        this.rowState = this.rowState.filter(function (x) { return !x.startsWith(groupIndex); });
    };
    return GroupsService;
}(__WEBPACK_IMPORTED_MODULE_2__common_expand_state_service__["a" /* ExpandStateService */]));

GroupsService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Injectable"] },
];
/** @nocollapse */
GroupsService.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_3__utils__["l" /* Skip */],] },] },
]; };


/***/ }),
/* 126 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return dateFormatNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return dateFieldName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return firstDay; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return format; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return formatDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return formatNumber; });
/* unused harmony export load */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return numberSymbols; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return parseDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return parseNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return splitDateFormat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return toString; });
/* unused harmony export setData */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__ = __webpack_require__(778);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__error_solutions__ = __webpack_require__(621);


function formatMessage(error) {
    var message = error.message;
    var errorSolution = __WEBPACK_IMPORTED_MODULE_1__error_solutions__["a" /* errorSolutions */][Object.keys(__WEBPACK_IMPORTED_MODULE_1__error_solutions__["a" /* errorSolutions */]).filter(function (key) { return message.indexOf(key) === 0; })[0]];
    return errorSolution ? message + " " + errorSolution : message;
}
function intlMethod(fn) {
    return function () {
        var values = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            values[_i] = arguments[_i];
        }
        try {
            return fn.apply(null, values);
        }
        catch (error) {
            error.message = formatMessage(error);
            throw error;
        }
    };
}
/**
 * @hidden
 */
var dateFormatNames = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["a" /* dateFormatNames */]);
/**
 * @hidden
 */
var dateFieldName = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["b" /* dateFieldName */]);
/**
 * @hidden
 */
var firstDay = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["c" /* firstDay */]);
/**
 * @hidden
 */
var format = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["d" /* format */]);
/**
 * @hidden
 */
var formatDate = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["e" /* formatDate */]);
/**
 * @hidden
 */
var formatNumber = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["f" /* formatNumber */]);
/**
 * @hidden
 */
var load = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["g" /* load */]);
/**
 * @hidden
 */
var numberSymbols = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["h" /* numberSymbols */]);
/**
 * @hidden
 */
var parseDate = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["i" /* parseDate */]);
/**
 * @hidden
 */
var parseNumber = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["j" /* parseNumber */]);
/**
 * @hidden
 */
var splitDateFormat = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["k" /* splitDateFormat */]);
/**
 * @hidden
 */
var toString = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["l" /* toString */]);
/**
 * @hidden
 */
var setData = intlMethod(__WEBPACK_IMPORTED_MODULE_0__telerik_kendo_intl__["m" /* setData */]);


/***/ }),
/* 127 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IntlService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * An abstract base class that implements
 * the Internationalization service methods
 * for the current locale.
 */
var IntlService = (function () {
    function IntlService() {
    }
    return IntlService;
}());

IntlService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
IntlService.ctorParameters = function () { return []; };


/***/ }),
/* 128 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addDays; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adjust_dst__ = __webpack_require__(76);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_date__ = __webpack_require__(77);


/**
 * A function that adds and subtracts days from a `Date` object.
 *
 * @param date - The initial date value.
 * @param offset - The number of days to add and subtract from the date.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * addDays(new Date(2016, 0, 1), 5); // 2016-1-6
 * addDays(new Date(2016, 0, 1), -5); // 2015-12-26
 * ```
 */
var addDays = function (date, offset) {
    var newDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__clone_date__["a" /* cloneDate */])(date);
    newDate.setDate(newDate.getDate() + offset);
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__adjust_dst__["a" /* adjustDST */])(newDate, date.getHours());
};


/***/ }),
/* 129 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Direction; });
/**
 * An enumeration which represents the horizontal direction.
 * The `Forward` option moves forward.
 * The `Backward` option moves backward.
 */
var Direction;
(function (Direction) {
    /**
     * The `Forward` value with an underlying `1` number value.
     */
    Direction[Direction["Forward"] = 1] = "Forward";
    /**
     * The `Backward` value with an underlying `-1` (minus one) number value.
     */
    Direction[Direction["Backward"] = -1] = "Backward";
})(Direction || (Direction = {}));


/***/ }),
/* 130 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return lastDayOfMonth; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_days__ = __webpack_require__(128);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create_date__ = __webpack_require__(51);


/**
 * A function which returns the last date of the month.
 *
 * @param date - The initial date.
 * @returns - The last date of the initial date month.
 *
 * @example
 * ```ts-no-run
 * lastDayOfMonth(new Date(2016, 0, 15)); // 2016-01-31
 * ```
 */
var lastDayOfMonth = function (date) {
    var newDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__create_date__["a" /* createDate */])(date.getFullYear(), date.getMonth() + 1, 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__add_days__["a" /* addDays */])(newDate, -1);
};


/***/ }),
/* 131 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeYear; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__set_year__ = __webpack_require__(411);

/**
 * @hidden
 */
var normalizeYear = function (value, year) { return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__set_year__["a" /* setYear */])(value, year(value.getFullYear()))); };


/***/ }),
/* 132 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = defineAccessors;
function setAccessor(field) {
    return function(value) {
        if (this[field] !== value) {
            this[field] = value;
            this.geometryChange();
        }

        return this;
    };
}

function getAccessor(field) {
    return function() {
        return this[field];
    };
}

function defineAccessors(fn, fields) {
    for (var i = 0; i < fields.length; i++) {
        var name = fields[i];
        var capitalized = name.charAt(0).toUpperCase() +
                          name.substring(1, name.length);

        fn["set" + capitalized] = setAccessor(name);
        fn["get" + capitalized] = getAccessor(name);
    }
}
//# sourceMappingURL=define-accessors.js.map


/***/ }),
/* 133 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = defineGeometryAccessors;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);


function geometryAccessor(name) {
    var fieldName = "_" + name;
    return function(value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(value)) {
            this._observerField(fieldName, value);
            this.geometryChange();
            return this;
        }

        return this[fieldName];
    };
}

function defineGeometryAccessors(fn, names) {
    for (var i = 0; i < names.length; i++) {
        fn[names[i]] = geometryAccessor(names[i]);
    }
}
//# sourceMappingURL=define-geometry-accessors.js.map


/***/ }),
/* 134 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = definePointAccessors;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_point__ = __webpack_require__(19);



function pointAccessor(name) {
    var fieldName = "_" + name;
    return function(value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(value)) {
            this._observerField(fieldName, __WEBPACK_IMPORTED_MODULE_1__geometry_point__["a" /* default */].create(value));
            this.geometryChange();
            return this;
        }

        return this[fieldName];
    };
}

function definePointAccessors(fn, names) {
    for (var i = 0; i < names.length; i++) {
        fn[names[i]] = pointAccessor(names[i]);
    }
}
//# sourceMappingURL=define-point-accessors.js.map


/***/ }),
/* 135 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = translateToPoint;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_transform__ = __webpack_require__(39);


function translateToPoint(point, bbox, element) {
    var transofrm = element.transform() || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__geometry_transform__["a" /* default */])();
    var matrix = transofrm.matrix();
    matrix.e += point.x - bbox.origin.x;
    matrix.f += point.y - bbox.origin.y;

    transofrm.matrix(matrix);
    element.transform(transofrm);
}
//# sourceMappingURL=translate-to-point.js.map


/***/ }),
/* 136 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = renderPath;

function renderPath(ctx, path) {
    var segments = path.segments;

    if (segments.length === 0) {
        return;
    }

    var segment = segments[0];
    var anchor = segment.anchor();
    ctx.moveTo(anchor.x, anchor.y);

    for (var i = 1; i < segments.length; i++) {
        segment = segments[i];
        anchor = segment.anchor();

        var prevSeg = segments[i - 1];
        var prevOut = prevSeg.controlOut();
        var controlIn = segment.controlIn();

        if (prevOut && controlIn) {
            ctx.bezierCurveTo(prevOut.x, prevOut.y,
                              controlIn.x, controlIn.y,
                              anchor.x, anchor.y);
        } else {
            ctx.lineTo(anchor.x, anchor.y);
        }
    }

    if (path.options.closed) {
        ctx.closePath();
    }
}
//# sourceMappingURL=render-path.js.map


/***/ }),
/* 137 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var Class = function Class () {};

/* harmony default export */ __webpack_exports__["a"] = (Class);
//# sourceMappingURL=class.js.map


/***/ }),
/* 138 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common__ = __webpack_require__(8);


var SurfaceFactory = (function (Class) {
    function SurfaceFactory() {
        Class.call(this);

        this._items = [];
    }

    if ( Class ) SurfaceFactory.__proto__ = Class;
    SurfaceFactory.prototype = Object.create( Class && Class.prototype );
    SurfaceFactory.prototype.constructor = SurfaceFactory;

    SurfaceFactory.prototype.register = function register (name, type, order) {
        var items = this._items;
        var first = items[0];
        var entry = {
            name: name,
            type: type,
            order: order
        };

        if (!first || order < first.order) {
            items.unshift(entry);
        } else {
            items.push(entry);
        }
    };

    SurfaceFactory.prototype.create = function create (element, options) {
        var items = this._items;
        var match = items[0];

        if (options && options.type) {
            var preferred = options.type.toLowerCase();
            for (var i = 0; i < items.length; i++) {
                if (items[i].name === preferred) {
                    match = items[i];
                    break;
                }
            }
        }

        if (match) {
            return new match.type(element, options);
        }

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common__["e" /* logToConsole */])(
            "Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n" +
            "- The browser does not support SVG and Canvas. User agent: " + (navigator.userAgent));
    };

    return SurfaceFactory;
}(__WEBPACK_IMPORTED_MODULE_0__common__["d" /* Class */]));

SurfaceFactory.current = new SurfaceFactory();

/* harmony default export */ __webpack_exports__["a"] = (SurfaceFactory);
//# sourceMappingURL=surface-factory.js.map


/***/ }),
/* 139 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PRECISION; });
var PRECISION = 10;


//# sourceMappingURL=constants.js.map


/***/ }),
/* 140 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__ = __webpack_require__(132);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);





var Size = (function (Class) {
    function Size(width, height) {
        Class.call(this);

        this.width = width || 0;
        this.height = height || 0;
    }

    if ( Class ) Size.__proto__ = Class;
    Size.prototype = Object.create( Class && Class.prototype );
    Size.prototype.constructor = Size;

    var staticAccessors = { ZERO: {} };

    Size.prototype.equals = function equals (other) {
        return other && other.width === this.width && other.height === this.height;
    };

    Size.prototype.clone = function clone () {
        return new Size(this.width, this.height);
    };

    Size.prototype.toArray = function toArray (digits) {
        var doRound = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(digits);
        var width = doRound ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(this.width, digits) : this.width;
        var height = doRound ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(this.height, digits) : this.height;

        return [ width, height ];
    };

    Size.create = function create (arg0, arg1) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(arg0)) {
            if (arg0 instanceof Size) {
                return arg0;
            } else if (arguments.length === 1 && arg0.length === 2) {
                return new Size(arg0[0], arg0[1]);
            }

            return new Size(arg0, arg1);
        }
    };

    staticAccessors.ZERO.get = function () {
        return new Size(0, 0);
    };

    Object.defineProperties( Size, staticAccessors );

    return Size;
}(__WEBPACK_IMPORTED_MODULE_2__common__["d" /* Class */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__["a" /* default */])(Size.prototype, [ "width", "height" ]);
__WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__["a" /* default */].extend(Size.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Size);
//# sourceMappingURL=size.js.map


/***/ }),
/* 141 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_elements_array__ = __webpack_require__(440);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_paintable__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_measurable__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry_arc__ = __webpack_require__(221);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__geometry_rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__geometry_segment__ = __webpack_require__(430);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__geometry_size__ = __webpack_require__(140);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__geometry_math_line_intersections_count__ = __webpack_require__(427);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util__ = __webpack_require__(5);












var Path = (function (Element) {
    function Path(options) {
        Element.call(this, options);
        this.segments = new __WEBPACK_IMPORTED_MODULE_0__geometry_elements_array__["a" /* default */]();
        this.segments.addObserver(this);

        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["e" /* defined */])(this.options.stroke)) {
            this.stroke("#000");

            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["e" /* defined */])(this.options.stroke.lineJoin)) {
                this.options.set("stroke.lineJoin", "miter");
            }
        }
    }

    if ( Element ) Path.__proto__ = Element;
    Path.prototype = Object.create( Element && Element.prototype );
    Path.prototype.constructor = Path;

    Path.prototype.moveTo = function moveTo (x, y) {
        this.suspend();
        this.segments.elements([]);
        this.resume();

        this.lineTo(x, y);

        return this;
    };

    Path.prototype.lineTo = function lineTo (x, y) {
        var point = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["e" /* defined */])(y) ? new __WEBPACK_IMPORTED_MODULE_7__geometry_point__["a" /* default */](x, y) : x;
        var segment = new __WEBPACK_IMPORTED_MODULE_6__geometry_segment__["a" /* default */](point);

        this.segments.push(segment);

        return this;
    };

    Path.prototype.curveTo = function curveTo (controlOut, controlIn, point) {
        if (this.segments.length > 0) {
            var lastSegment = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["u" /* last */])(this.segments);
            var segment = new __WEBPACK_IMPORTED_MODULE_6__geometry_segment__["a" /* default */](point, controlIn);
            this.suspend();
            lastSegment.controlOut(controlOut);
            this.resume();

            this.segments.push(segment);
        }

        return this;
    };

    Path.prototype.arc = function arc (startAngle, endAngle, radiusX, radiusY, anticlockwise) {
        if (this.segments.length > 0) {
            var lastSegment = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["u" /* last */])(this.segments);
            var anchor = lastSegment.anchor();
            var start = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["h" /* rad */])(startAngle);
            var center = new __WEBPACK_IMPORTED_MODULE_7__geometry_point__["a" /* default */](anchor.x - radiusX * Math.cos(start),
                anchor.y - radiusY * Math.sin(start));
            var arc = new __WEBPACK_IMPORTED_MODULE_4__geometry_arc__["a" /* default */](center, {
                startAngle: startAngle,
                endAngle: endAngle,
                radiusX: radiusX,
                radiusY: radiusY,
                anticlockwise: anticlockwise
            });

            this._addArcSegments(arc);
        }

        return this;
    };

    Path.prototype.arcTo = function arcTo (end, rx, ry, largeArc, swipe, rotation) {
        if (this.segments.length > 0) {
            var lastSegment = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["u" /* last */])(this.segments);
            var anchor = lastSegment.anchor();
            var arc = __WEBPACK_IMPORTED_MODULE_4__geometry_arc__["a" /* default */].fromPoints(anchor, end, rx, ry, largeArc, swipe, rotation);

            this._addArcSegments(arc);
        }
        return this;
    };

    Path.prototype._addArcSegments = function _addArcSegments (arc) {
        var this$1 = this;

        this.suspend();

        var curvePoints = arc.curvePoints();

        for (var i = 1; i < curvePoints.length; i += 3) {
            this$1.curveTo(curvePoints[i], curvePoints[i + 1], curvePoints[i + 2]);
        }

        this.resume();
        this.geometryChange();
    };

    Path.prototype.close = function close () {
        this.options.closed = true;
        this.geometryChange();

        return this;
    };

    Path.prototype.rawBBox = function rawBBox () {
        return this._bbox();
    };

    Path.prototype._containsPoint = function _containsPoint (point) {
        var segments = this.segments;
        var length = segments.length;
        var intersectionsCount = 0;
        var previous, current;

        for (var idx = 1; idx < length; idx++) {
            previous = segments[idx - 1];
            current = segments[idx];
            intersectionsCount += previous._intersectionsTo(current, point);
        }

        if (this.options.closed || !segments[0].anchor().equals(segments[length - 1].anchor())) {
            intersectionsCount += __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__geometry_math_line_intersections_count__["a" /* default */])(segments[0].anchor(), segments[length - 1].anchor(), point);
        }

        return intersectionsCount % 2 !== 0;
    };

    Path.prototype._isOnPath = function _isOnPath (point, width) {
        var segments = this.segments;
        var length = segments.length;
        var pathWidth = width || this.options.stroke.width;

        if (length > 1) {
            if (segments[0]._isOnPathTo(segments[1], point, pathWidth, "start")) {
                return true;
            }

            for (var idx = 2; idx <= length - 2; idx++) {
                if (segments[idx - 1]._isOnPathTo(segments[idx], point, pathWidth)) {
                    return true;
                }
            }

            if (segments[length - 2]._isOnPathTo(segments[length - 1], point, pathWidth, "end")) {
                return true;
            }
        }
        return false;
    };

    Path.prototype._bbox = function _bbox (matrix) {
        var segments = this.segments;
        var length = segments.length;
        var boundingBox;

        if (length === 1) {
            var anchor = segments[0].anchor().transformCopy(matrix);
            boundingBox = new __WEBPACK_IMPORTED_MODULE_5__geometry_rect__["a" /* default */](anchor, __WEBPACK_IMPORTED_MODULE_8__geometry_size__["a" /* default */].ZERO);
        } else if (length > 0) {
            for (var i = 1; i < length; i++) {
                var segmentBox = segments[i - 1].bboxTo(segments[i], matrix);
                if (boundingBox) {
                    boundingBox = __WEBPACK_IMPORTED_MODULE_5__geometry_rect__["a" /* default */].union(boundingBox, segmentBox);
                } else {
                    boundingBox = segmentBox;
                }
            }
        }

        return boundingBox;
    };

    Path.fromRect = function fromRect (rect, options) {
        return new Path(options)
            .moveTo(rect.topLeft())
            .lineTo(rect.topRight())
            .lineTo(rect.bottomRight())
            .lineTo(rect.bottomLeft())
            .close();
    };

    Path.fromPoints = function fromPoints (points, options) {
        if (points) {
            var path = new Path(options);

            for (var i = 0; i < points.length; i++) {
                var point = __WEBPACK_IMPORTED_MODULE_7__geometry_point__["a" /* default */].create(points[i]);
                if (point) {
                    if (i === 0) {
                        path.moveTo(point);
                    } else {
                        path.lineTo(point);
                    }
                }
            }

            return path;
        }
    };

    Path.fromArc = function fromArc (arc, options) {
        var path = new Path(options);
        var startAngle = arc.startAngle;
        var start = arc.pointAt(startAngle);
        path.moveTo(start.x, start.y);
        path.arc(startAngle, arc.endAngle, arc.radiusX, arc.radiusY, arc.anticlockwise);
        return path;
    };

    return Path;
}(__WEBPACK_IMPORTED_MODULE_1__element__["a" /* default */]));

Path.prototype.nodeType = "Path";

__WEBPACK_IMPORTED_MODULE_2__mixins_paintable__["a" /* default */].extend(Path.prototype);
__WEBPACK_IMPORTED_MODULE_3__mixins_measurable__["a" /* default */].extend(Path.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Path);
//# sourceMappingURL=path.js.map


/***/ }),
/* 142 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = renderAllAttr;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__render_attribute__ = __webpack_require__(100);


function renderAllAttr(attrs) {
    var output = "";
    for (var i = 0; i < attrs.length; i++) {
        output += __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__render_attribute__["a" /* default */])(attrs[i][0], attrs[i][1]);
    }

    return output;
}
//# sourceMappingURL=render-all-attributes.js.map


/***/ }),
/* 143 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var getWindow = function (element) { return ( element.ownerDocument.defaultView ); };

/* harmony default export */ __webpack_exports__["a"] = (getWindow);

//# sourceMappingURL=window.js.map


/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var Subscription_1 = __webpack_require__(16);
/**
 * @class AsyncSubject<T>
 */
var AsyncSubject = (function (_super) {
    __extends(AsyncSubject, _super);
    function AsyncSubject() {
        _super.apply(this, arguments);
        this.value = null;
        this.hasNext = false;
        this.hasCompleted = false;
    }
    AsyncSubject.prototype._subscribe = function (subscriber) {
        if (this.hasError) {
            subscriber.error(this.thrownError);
            return Subscription_1.Subscription.EMPTY;
        }
        else if (this.hasCompleted && this.hasNext) {
            subscriber.next(this.value);
            subscriber.complete();
            return Subscription_1.Subscription.EMPTY;
        }
        return _super.prototype._subscribe.call(this, subscriber);
    };
    AsyncSubject.prototype.next = function (value) {
        if (!this.hasCompleted) {
            this.value = value;
            this.hasNext = true;
        }
    };
    AsyncSubject.prototype.error = function (error) {
        if (!this.hasCompleted) {
            _super.prototype.error.call(this, error);
        }
    };
    AsyncSubject.prototype.complete = function () {
        this.hasCompleted = true;
        if (this.hasNext) {
            _super.prototype.next.call(this, this.value);
        }
        _super.prototype.complete.call(this);
    };
    return AsyncSubject;
}(Subject_1.Subject));
exports.AsyncSubject = AsyncSubject;
//# sourceMappingURL=AsyncSubject.js.map

/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var interval_1 = __webpack_require__(937);
Observable_1.Observable.interval = interval_1.interval;
//# sourceMappingURL=interval.js.map

/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var delay_1 = __webpack_require__(958);
Observable_1.Observable.prototype.delay = delay_1.delay;
//# sourceMappingURL=delay.js.map

/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var distinctUntilChanged_1 = __webpack_require__(503);
Observable_1.Observable.prototype.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged;
//# sourceMappingURL=distinctUntilChanged.js.map

/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function isDate(value) {
    return value instanceof Date && !isNaN(+value);
}
exports.isDate = isDate;
//# sourceMappingURL=isDate.js.map

/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var isArray_1 = __webpack_require__(83);
function isNumeric(val) {
    // parseFloat NaNs numeric-cast false positives (null|true|false|"")
    // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
    // subtraction forces infinities to NaN
    // adding 1 corrects loss of precision from parseFloat (#15100)
    return !isArray_1.isArray(val) && (val - parseFloat(val) + 1) >= 0;
}
exports.isNumeric = isNumeric;
;
//# sourceMappingURL=isNumeric.js.map

/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(61);

/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(63);

/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(8);

/***/ }),
/* 153 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CalendarModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templates_module__ = __webpack_require__(262);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__calendar_component__ = __webpack_require__(253);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__header_component__ = __webpack_require__(535);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_component__ = __webpack_require__(256);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__view_list_component__ = __webpack_require__(263);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__view_component__ = __webpack_require__(538);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__services_bus_view_service__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__services_dom_service__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__services_navigation_service__ = __webpack_require__(260);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__services_century_view_service__ = __webpack_require__(257);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__services_decade_view_service__ = __webpack_require__(258);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__services_month_view_service__ = __webpack_require__(259);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__services_year_view_service__ = __webpack_require__(261);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__localization_localized_messages_directive__ = __webpack_require__(536);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__localization_calendar_custom_messages_component__ = __webpack_require__(254);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__virtualization_virtualization_module__ = __webpack_require__(278);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__for_directive__ = __webpack_require__(534);




















var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_4__calendar_component__["a" /* CalendarComponent */],
    __WEBPACK_IMPORTED_MODULE_5__header_component__["a" /* HeaderComponent */],
    __WEBPACK_IMPORTED_MODULE_6__navigation_component__["a" /* NavigationComponent */],
    __WEBPACK_IMPORTED_MODULE_17__localization_calendar_custom_messages_component__["a" /* CalendarCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_16__localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */],
    __WEBPACK_IMPORTED_MODULE_7__view_list_component__["a" /* ViewListComponent */],
    __WEBPACK_IMPORTED_MODULE_8__view_component__["a" /* ViewComponent */]
];
var CALENDAR_PROVIDERS = [
    __WEBPACK_IMPORTED_MODULE_9__services_bus_view_service__["a" /* BusViewService */],
    __WEBPACK_IMPORTED_MODULE_10__services_dom_service__["a" /* DOMService */],
    __WEBPACK_IMPORTED_MODULE_11__services_navigation_service__["a" /* NavigationService */],
    __WEBPACK_IMPORTED_MODULE_12__services_century_view_service__["a" /* CenturyViewService */],
    __WEBPACK_IMPORTED_MODULE_13__services_decade_view_service__["a" /* DecadeViewService */],
    __WEBPACK_IMPORTED_MODULE_14__services_month_view_service__["a" /* MonthViewService */],
    __WEBPACK_IMPORTED_MODULE_15__services_year_view_service__["a" /* YearViewService */]
];
/**
 * The exported package module.
 *
 * The package exports:
 * - `CalendarComponent`&mdash;The Calendar component class.
 * - `CellTemplateDirective`&mdash;The month cell template directive.
 * - `MonthCellTemplateDirective`&mdash;The month cell template directive.
 * - `YearCellTemplateDirective`&mdash;The year cell template directive.
 * - `DecadeCellTemplateDirective`&mdash;The decade cell template directive.
 * - `CenturyCellTemplateDirective`&mdash;The century cell template directive.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Calendar module
 * import { CalendarModule } from '@progress/kendo-angular-dateinputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, CalendarModule], // import Calendar module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var CalendarModule = (function () {
    function CalendarModule() {
    }
    return CalendarModule;
}());

CalendarModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_19__for_directive__["a" /* KForOf */]],
                exports: [COMPONENT_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_3__templates_module__["a" /* TemplatesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["a" /* IntlModule */], __WEBPACK_IMPORTED_MODULE_3__templates_module__["a" /* TemplatesModule */], __WEBPACK_IMPORTED_MODULE_18__virtualization_virtualization_module__["a" /* VirtualizationModule */]],
                providers: CALENDAR_PROVIDERS
            },] },
];
/** @nocollapse */
CalendarModule.ctorParameters = function () { return []; };


/***/ }),
/* 154 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Used for rendering the cell content of the Calendar.
 *
 * To define the cell template, nest an `<ng-template>` tag with the `kendoCalendarCellTemplate` directive
 * inside the component tag.
 *
 * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive.
 * To provide more details about the current cell, get a reference to the current `cellContext`
 * by using the `let-cellContext` directive.
 *
 * > `kendoCalendarCellTemplate` is equivalent to
 * [`kendoCalendarMonthCellTemplate`]({% slug api_dateinputs_monthcelltemplatedirective %}).
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * styles: ['.custom { color: red; }'],
 * template: `
 *  <kendo-calendar>
 *    <ng-template kendoCalendarCellTemplate let-date>
 *      <span class="custom">{{date.getDate()}}</span>
 *    </ng-template>
 *  </kendo-calendar>
 * `
 * })
 * class AppComponent { }
 * ```
 *
 * For more examples, refer to the section on [templates]({% slug overview_calendar %}#toc-templates).
 */
var CellTemplateDirective = (function () {
    function CellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return CellTemplateDirective;
}());

CellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoCalendarCellTemplate]'
            },] },
];
/** @nocollapse */
CellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 155 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CenturyCellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Used for rendering the century cell content of the Calendar.
 *
 * To define the century cell template, nest an `<ng-template>` tag with the `kendoCalendarCenturyCellTemplate` directive
 * inside the component tag.
 *
 * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive.
 * To provide more details about the current century cell, get a reference to the current `cellContext`
 * by using the `let-cellContext` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * styles: ['.custom { color: red; }'],
 * template: `
 *  <kendo-calendar [activeView]="activeView">
 *    <ng-template kendoCalendarCenturyCellTemplate let-context="cellContext">
 *      <span class="custom">{{context.formattedValue}}</span>
 *    </ng-template>
 *  </kendo-calendar>
 * `
 * })
 * class AppComponent {
 *  public activeView: CalendarView = 'century';
 * }
 * ```
 *
 * For more examples, refer to the section on [templates]({% slug overview_calendar %}#toc-templates).
 */
var CenturyCellTemplateDirective = (function () {
    function CenturyCellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return CenturyCellTemplateDirective;
}());

CenturyCellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoCalendarCenturyCellTemplate]'
            },] },
];
/** @nocollapse */
CenturyCellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 156 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DecadeCellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Used for rendering the decade cell content of the Calendar.
 *
 * To define the decade cell template, nest an `<ng-template>` tag with the `kendoCalendarDecadeCellTemplate` directive
 * inside the component tag.
 *
 * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive.
 * To provide more details about the current decade cell, get a reference to the current `cellContext`
 * by using the `let-cellContext` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * styles: ['.custom { color: red; }'],
 * template: `
 *  <kendo-calendar [activeView]="activeView">
 *    <ng-template kendoCalendarDecadeCellTemplate let-context="cellContext">
 *      <span class="custom">{{context.formattedValue}}</span>
 *    </ng-template>
 *  </kendo-calendar>
 * `
 * })
 * class AppComponent {
 *  public activeView: CalendarView = 'decade';
 * }
 * ```
 *
 * For more examples, refer to the section on [templates]({% slug overview_calendar %}#toc-templates).
 */
var DecadeCellTemplateDirective = (function () {
    function DecadeCellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return DecadeCellTemplateDirective;
}());

DecadeCellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoCalendarDecadeCellTemplate]'
            },] },
];
/** @nocollapse */
DecadeCellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 157 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MonthCellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Used for rendering the month cell content of the Calendar.
 *
 * To define the month cell template, nest an `<ng-template>` tag with the `kendoCalendarMonthCellTemplate` directive
 * inside the component tag.
 *
 * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive.
 * To provide more details about the current month cell, get a reference to the current `cellContext`
 * by using the `let-cellContext` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * styles: ['.custom { color: red; }'],
 * template: `
 *  <kendo-calendar>
 *    <ng-template kendoCalendarMonthCellTemplate let-context="cellContext">
 *      <span class="custom">{{context.formattedValue}}</span>
 *    </ng-template>
 *  </kendo-calendar>
 * `
 * })
 * class AppComponent { }
 * ```
 *
 * For more examples, refer to the section on [templates]({% slug overview_calendar %}#toc-templates).
 */
var MonthCellTemplateDirective = (function () {
    function MonthCellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return MonthCellTemplateDirective;
}());

MonthCellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoCalendarMonthCellTemplate]'
            },] },
];
/** @nocollapse */
MonthCellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 158 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WeekNumberCellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Used for rendering the week number cell content in the month view of the Calendar.
 *
 * To define the month week number cell template, nest an `<ng-template>` tag with the `kendoCalendarWeekNumberCellTemplate` directive
 * inside the component tag.
 *
 * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive.
 * To provide more details about the current week number cell, get a reference to the current `cellContext`
 * by using the `let-cellContext` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * styles: ['.custom { color: red; }'],
 * template: `
 *  <kendo-calendar [weekNumbers]="true">
 *    <ng-template kendoCalendarWeekNumberCellTemplate let-context="cellContext">
 *      <span class="custom">{{context.formattedValue}}</span>
 *    </ng-template>
 *  </kendo-calendar>
 * `
 * })
 * class AppComponent { }
 * ```
 *
 * For more examples, refer to the section on [templates]({% slug overview_calendar %}#toc-templates).
 */
var WeekNumberCellTemplateDirective = (function () {
    function WeekNumberCellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return WeekNumberCellTemplateDirective;
}());

WeekNumberCellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoCalendarWeekNumberCellTemplate]'
            },] },
];
/** @nocollapse */
WeekNumberCellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 159 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return YearCellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Used for rendering the year cell content of the Calendar.
 *
 * To define the year cell template, nest an `<ng-template>` tag with the `kendoCalendarYearCellTemplate` directive
 * inside the component tag.
 *
 * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive.
 * To provide more details about the current year cell, get a reference to the current `cellContext`
 * by using the `let-cellContext` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * styles: ['.custom { color: red; }'],
 * template: `
 *  <kendo-calendar [activeView]="activeView">
 *    <ng-template kendoCalendarYearCellTemplate let-context="cellContext">
 *      <span class="custom">{{context.formattedValue}}</span>
 *    </ng-template>
 *  </kendo-calendar>
 * `
 * })
 * class AppComponent {
 *  public activeView: CalendarView = 'year';
 * }
 * ```
 *
 * For more examples, refer to the section on [templates]({% slug overview_calendar %}#toc-templates).
 */
var YearCellTemplateDirective = (function () {
    function YearCellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return YearCellTemplateDirective;
}());

YearCellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoCalendarYearCellTemplate]'
            },] },
];
/** @nocollapse */
YearCellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 160 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__calendar_calendar_component__ = __webpack_require__(253);
/* unused harmony reexport CalendarComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dateinput_dateinput_component__ = __webpack_require__(264);
/* unused harmony reexport DateInputComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__datepicker_datepicker_component__ = __webpack_require__(267);
/* unused harmony reexport DatePickerComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__timepicker_timepicker_component__ = __webpack_require__(276);
/* unused harmony reexport TimePickerComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__calendar_calendar_module__ = __webpack_require__(153);
/* unused harmony reexport CalendarModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dateinput_dateinput_module__ = __webpack_require__(113);
/* unused harmony reexport DateInputModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__datepicker_datepicker_module__ = __webpack_require__(268);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_6__datepicker_datepicker_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__dateinputs_module__ = __webpack_require__(542);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_7__dateinputs_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__timepicker_timepicker_module__ = __webpack_require__(277);
/* unused harmony reexport TimePickerModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__calendar_localization_calendar_custom_messages_component__ = __webpack_require__(254);
/* unused harmony reexport CalendarCustomMessagesComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__dateinput_localization_dateinput_custom_messages_component__ = __webpack_require__(265);
/* unused harmony reexport DateInputCustomMessagesComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__datepicker_localization_datepicker_custom_messages_component__ = __webpack_require__(269);
/* unused harmony reexport DatePickerCustomMessagesComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__preventable_event__ = __webpack_require__(161);
/* unused harmony reexport PreventableEvent */















/***/ }),
/* 161 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PreventableEvent; });
/**
 * A preventable event instance triggered by the open and close events.
 */
var PreventableEvent = (function () {
    function PreventableEvent() {
        this.prevented = false;
    }
    /**
     * Prevents the default action for a specified event.
     * In this way, the source component suppresses the built-in behavior that follows the event.
     */
    PreventableEvent.prototype.preventDefault = function () {
        this.prevented = true;
    };
    /**
     * If the event is prevented by any of its subscribers, returns `true`.
     *
     * @returns `true` if the default action was prevented. Otherwise, returns `false`.
     */
    PreventableEvent.prototype.isDefaultPrevented = function () {
        return this.prevented;
    };
    return PreventableEvent;
}());



/***/ }),
/* 162 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TIME_PART; });
/**
 * @hidden
 */
var TIME_PART = {
    dayperiod: 'dayperiod',
    hour: 'hour',
    millisecond: 'millisecond',
    minute: 'minute',
    second: 'second'
};


/***/ }),
/* 163 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DOMService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(14);


var div = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* domContainerFactory */])('div');
var ul = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* domContainerFactory */])('ul');
var li = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* domContainerFactory */])('li');
var listItem = function () { return li('<span>02</span>', 'k-item'); };
var list = function () { return ul([listItem()], 'k-reset'); };
var scrollable = function () { return (div([list()], 'k-time-container k-content k-scrollable')); };
var timeListWrapper = function () {
    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["f" /* isDocumentAvailable */])()) {
        return null;
    }
    return div([div([scrollable()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });
};
var TIMELIST_WRAPPER = timeListWrapper();
/**
 * @hidden
 */
var DOMService = (function () {
    function DOMService() {
    }
    DOMService.prototype.ensureHeights = function () {
        if (this.timeListHeight !== undefined) {
            return;
        }
        this.calculateHeights();
    };
    DOMService.prototype.calculateHeights = function (container) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["f" /* isDocumentAvailable */])()) {
            return;
        }
        var listContainer = container && container.querySelector('.k-time-list-container');
        var hostContainer = listContainer || document.body;
        var wrapper = hostContainer.appendChild(TIMELIST_WRAPPER);
        this.timeListHeight = wrapper.querySelector('.k-scrollable').offsetHeight;
        this.itemHeight = wrapper.querySelector('li').offsetHeight;
        hostContainer.removeChild(wrapper);
    };
    DOMService.prototype.isActive = function (element) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["f" /* isDocumentAvailable */])() || !element) {
            return false;
        }
        return (element.nativeElement || element) === document.activeElement;
    };
    return DOMService;
}());

DOMService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
DOMService.ctorParameters = function () { return []; };


/***/ }),
/* 164 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return maxValidator; });
/**
 * @hidden
 */
var maxValidator = function (maxValue) {
    return function (control) {
        var err = {
            maxError: {
                maxValue: maxValue,
                value: control.value
            }
        };
        if (!maxValue || !control.value) {
            return null;
        }
        return control.value > maxValue ? err : null;
    };
};


/***/ }),
/* 165 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return minValidator; });
/**
 * @hidden
 */
var minValidator = function (minValue) {
    return function (control) {
        var err = {
            minError: {
                minValue: minValue,
                value: control.value
            }
        };
        if (!minValue || !control.value) {
            return null;
        }
        return control.value < minValue ? err : null;
    };
};


/***/ }),
/* 166 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MultiSelectComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__searchbar_component__ = __webpack_require__(117);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selection_service__ = __webpack_require__(61);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_service__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_action__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__common_keys__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__templates_item_template_directive__ = __webpack_require__(65);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__templates_header_template_directive__ = __webpack_require__(64);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__templates_footer_template_directive__ = __webpack_require__(63);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__templates_tag_template_directive__ = __webpack_require__(292);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__templates_group_tag_template_directive__ = __webpack_require__(291);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__templates_no_data_template_directive__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__error_messages__ = __webpack_require__(555);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__common_preventable_event__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__common_remove_tag_event__ = __webpack_require__(553);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__progress_kendo_angular_popup__ = __webpack_require__(28);
/* tslint:disable:max-line-length */




















var MULTISELECT_VALUE_ACCESSOR = {
    multi: true,
    provide: __WEBPACK_IMPORTED_MODULE_4__angular_forms__["NG_VALUE_ACCESSOR"],
    // tslint:disable-next-line:no-use-before-declare
    useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__angular_core__["forwardRef"])(function () { return MultiSelectComponent; })
};
/**
 * Represents the Kendo UI MultiSelect component for Angular.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-multiselect [data]="listItems">
 *  </kendo-multiselect>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 */
var MultiSelectComponent = (function () {
    function MultiSelectComponent(rtl, popupService, selectionService, navigationService, cdr, differs, renderer, hostElement) {
        this.popupService = popupService;
        this.selectionService = selectionService;
        this.navigationService = navigationService;
        this.cdr = cdr;
        this.differs = differs;
        this.renderer = renderer;
        this.hostElement = hostElement;
        this.activeId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* guid */])();
        this.listBoxId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* guid */])();
        this.focusedTagIndex = undefined;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* guid */])();
        /**
         * Controls whether to close the suggestion list of the MultiSelect after the selection of an item.
         * @default true
         */
        this.autoClose = true;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Sets the disabled state of the component.
         */
        this.disabled = false;
        /**
         * Sets the readonly state of the component.
         */
        this.readonly = false;
        /**
         * Enables the [filtering]({% slug filtering_multiselect %}) functionality of the MultiSelect.
         */
        this.filterable = false;
        /**
         * If set to `true`, renders a button on hovering over the component.
         * Clicking this button resets the value of the component to an empty array and triggers the `change` event.
         */
        this.clearButton = true;
        /**
         * A user-defined callback function which receives an array of selected data items and maps them to an array of tags.
         *
         * @param { Any[] } dataItems - The selected data items from the list.
         * @returns { Any[] } - The tags that will be rendered by the component.
         */
        this.tagMapper = function (tags) { return tags || []; };
        /**
         * Fires each time the user types in the filter input.
         * You can filter the source based on the passed filtration value.
         */
        this.filterChange = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"]();
        /**
         * Fires each time the value is changed.
         *
         * For more details, refer to the example on [events]({% slug overview_multiselect %}#toc-events).
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to open.
         * This event is preventable. If you cancel it, the popup will remain closed.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to close.
         * This event is preventable. If you cancel it, the popup will remain open.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the MultiSelect.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the MultiSelect gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time a tag is about to be removed.
         * This event is preventable. If you cancel it, the tag will not be removed.
         */
        this.removeTag = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"]();
        this.onChangeCallback = function (_) { };
        this.onTouchedCallback = function (_) { };
        this._data = [];
        this._placeholder = '';
        this._open = false;
        this._value = [];
        this.selectedDataItems = [];
        this._popupSettings = { height: 200, animate: true };
        this.observableSubscriptions = new __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__["Subscription"]();
        this.changeSubscription = new __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__["Subscription"]();
        this.isFocused = false;
        this.wrapperBlurred = new __WEBPACK_IMPORTED_MODULE_2__angular_core__["EventEmitter"]();
        this.hostElement = hostElement.nativeElement;
        this.popupMouseDownHandler = this.onMouseDown.bind(this);
        this.direction = rtl ? 'rtl' : 'ltr';
        this.subscribeEvents();
    }
    Object.defineProperty(MultiSelectComponent.prototype, "popupOpen", {
        get: function () {
            return this._open;
        },
        set: function (open) {
            if (this.disabled || this.readonly || this.popupOpen === open) {
                return;
            }
            var eventArgs = new __WEBPACK_IMPORTED_MODULE_16__common_preventable_event__["a" /* PreventableEvent */]();
            if (open) {
                this.open.emit(eventArgs);
            }
            else {
                this.close.emit(eventArgs);
            }
            if (eventArgs.isDefaultPrevented()) {
                return;
            }
            this._toggle(open);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.focusComponent = function () {
        if (!this.isFocused) {
            this.isFocused = true;
            this.onFocus.emit();
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.blurComponent = function () {
        if (this.isFocused) {
            this.closePopup();
            this.isFocused = false;
            this.text = "";
            this.onBlur.emit();
            this.onTouchedCallback();
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.wrapperMousedown = function (event) {
        if (this.isFocused && event.target === this.searchbar.input.nativeElement) {
            return;
        }
        this.searchbar.focus();
        this.popupOpen = !this.popupOpen;
        event.preventDefault();
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.onResize = function () {
        if (this._open) {
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
        }
    };
    Object.defineProperty(MultiSelectComponent.prototype, "appendTo", {
        get: function () {
            var appendTo = this.popupSettings.appendTo;
            if (!appendTo || appendTo === 'root') {
                return undefined;
            }
            return appendTo === 'component' ? this.container : appendTo;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "data", {
        get: function () {
            return this._data;
        },
        /**
         * Sets the data of the MultiSelect.
         *
         * > The data has to be provided in an array-like list of items.
         */
        set: function (data) {
            this._data = data || [];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "value", {
        get: function () {
            return this._value;
        },
        /**
         * Sets the value of the MultiSelect. It can be either of the primitive (string, numbers) or of the complex (objects) type.
         * To define the type, use the `valuePrimitive` option.
         *
         * > All selected values which are not present in the source are ignored.
         */
        set: function (values) {
            this._value = values ? values : [];
            if (!this.differ && this.value) {
                this.differ = this.differs.find(this.value).create();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "placeholder", {
        get: function () {
            return this.selectedDataItems.length ? '' : this._placeholder;
        },
        /**
         * The hint which is displayed when the component is empty.
         * When the values are selected, it disappears.
         */
        set: function (text) {
            this._placeholder = text || '';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "popupSettings", {
        get: function () {
            return this._popupSettings;
        },
        /**
         * Configures the popup of the MultiSelect.
         *
         * The available options are:
         * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
         * - `width: Number`&mdash;Sets the width of the popup container. By default, the width of the host element is used.
         * - `height: Number`&mdash;Sets the height of the popup container. By default, the height is 200px.
         * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
         */
        set: function (settings) {
            this._popupSettings = Object.assign({ height: 200, animate: true }, settings);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "widgetClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "dir", {
        get: function () {
            return this.direction;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "focusedClass", {
        get: function () {
            return this.isFocused;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "disabledClass", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "listContainerClasses", {
        get: function () {
            var containerClasses = ['k-list-container', 'k-reset'];
            if (this.popupSettings.popupClass) {
                containerClasses.push(this.popupSettings.popupClass);
            }
            return containerClasses;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MultiSelectComponent.prototype, "width", {
        get: function () {
            var wrapperOffsetWidth = 0;
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* isDocumentAvailable */])()) {
                wrapperOffsetWidth = this.wrapper.nativeElement.offsetWidth;
            }
            var width = this.popupSettings.width || wrapperOffsetWidth;
            var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px";
            var maxWidth = isNaN(width) ? width : width + "px";
            return { min: minWidth, max: maxWidth };
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.popupOpened = function () {
        this.popupWidth = this.width.max;
        this.popupMinWidth = this.width.min;
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.onMouseDown = function (event) {
        var tagName = event.target.tagName.toLowerCase();
        if (tagName !== "input") {
            event.preventDefault();
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.verifySettings = function () {
        var valueOrText = !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(this.valueField) !== !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(this.textField);
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__angular_core__["isDevMode"])() || this.value.length === 0) {
            return;
        }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["k" /* isArray */])(this.value)) {
            throw new Error(__WEBPACK_IMPORTED_MODULE_15__error_messages__["a" /* MultiselectMessages */].array);
        }
        if (this.valuePrimitive === true && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isObjectArray */])(this.value)) {
            throw new Error(__WEBPACK_IMPORTED_MODULE_15__error_messages__["a" /* MultiselectMessages */].primitive);
        }
        if (this.valuePrimitive === false && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isObjectArray */])(this.value)) {
            throw new Error(__WEBPACK_IMPORTED_MODULE_15__error_messages__["a" /* MultiselectMessages */].object);
        }
        if (valueOrText) {
            throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#toc-bind-to-arrays-of-complex-data");
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.change = function (event) {
        var _this = this;
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(event.added)) {
            var dataItem = this.data[event.added];
            var newItem = (this.valuePrimitive && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(dataItem[this.valueField])) ? dataItem[this.valueField] :
                dataItem;
            this.value = this.value.concat([newItem]);
            this.cdr.markForCheck();
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(event.removed)) {
            var dataItem_1 = this.data[event.removed];
            if (this.valuePrimitive) {
                var index = this.value.indexOf(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(dataItem_1[this.valueField]) ? dataItem_1[this.valueField] : dataItem_1);
                this.value.splice(index, 1);
            }
            else {
                this.value = this.value.filter(function (item) { return item[_this.valueField] !== dataItem_1[_this.valueField]; });
            }
            this.cdr.markForCheck();
        }
        this.emitValueChange();
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.setState = function (value) {
        var objectArray = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isObjectArray */])(value);
        var selection = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["m" /* selectedIndices */])(this.value, this.data, this.valueField);
        this.selectionService.resetSelection(selection);
        if (this.popupOpen && this.selectionService.focused === undefined && this.data.length) {
            this.selectionService.focused = 0;
        }
        if (this.selectedDataItems.length <= 0) {
            if (this.valuePrimitive && !this.valueField) {
                this.selectedDataItems = value.slice();
            }
            if (objectArray || this.valuePrimitive && this.valueField) {
                this.selectedDataItems = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["n" /* resolveAllValues */])(value, this.data, this.valueField);
            }
        }
        this.tags = this.tagMapper(this.selectedDataItems.slice(0));
        this.cdr.markForCheck();
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.handleBlur = function () {
        this.wrapperBlurred.emit();
        // this.closePopup();
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.handleFilter = function (text) {
        this.text = text;
        this.searchbar.setInputSize();
        if (this.filterable && this.text) {
            this.filterChange.emit(text);
        }
        else {
            this.searchTextAndFocus(text);
        }
        if (text && !this.popupOpen) {
            this.openPopup();
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.handleNavigate = function (event) {
        var navigateInput = this.text && event.keyCode !== __WEBPACK_IMPORTED_MODULE_8__common_keys__["a" /* Keys */].down && event.keyCode !== __WEBPACK_IMPORTED_MODULE_8__common_keys__["a" /* Keys */].up;
        var selectValue = this.text && event.keyCode === __WEBPACK_IMPORTED_MODULE_8__common_keys__["a" /* Keys */].enter || event.keyCode === __WEBPACK_IMPORTED_MODULE_8__common_keys__["a" /* Keys */].esc;
        var deleteTag = !this.text && event.keyCode === __WEBPACK_IMPORTED_MODULE_8__common_keys__["a" /* Keys */].backspace && this.tags.length > 0;
        if (deleteTag) {
            this.handleBackspace();
            return;
        }
        if (this.disabled || navigateInput && !selectValue) {
            return;
        }
        var eventData = event;
        var focused = isNaN(this.selectionService.focused) ? -1 : this.selectionService.focused;
        var action = this.navigationService.process({
            current: focused,
            max: this.data.length - 1,
            min: 0,
            open: this.popupOpen,
            originalEvent: eventData
        });
        if (action !== __WEBPACK_IMPORTED_MODULE_7__navigation_action__["a" /* NavigationAction */].Undefined &&
            ((action === __WEBPACK_IMPORTED_MODULE_7__navigation_action__["a" /* NavigationAction */].Enter && this.popupOpen) || action !== __WEBPACK_IMPORTED_MODULE_7__navigation_action__["a" /* NavigationAction */].Enter)) {
            event.preventDefault();
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.handleRemoveTag = function (tagData) {
        var eventArgs = new __WEBPACK_IMPORTED_MODULE_17__common_remove_tag_event__["a" /* RemoveTagEvent */](tagData);
        if (this.disabled || this.readonly) {
            return;
        }
        this.removeTag.emit(eventArgs);
        if (eventArgs.isDefaultPrevented()) {
            return;
        }
        if (tagData instanceof Array) {
            this.removeGroupTag(tagData);
        }
        else {
            this.removeSingleTag(tagData);
        }
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.clearAll = function (event) {
        event.stopImmediatePropagation();
        if (this.filterable && this.text) {
            this.text = "";
            this.filterChange.emit("");
        }
        this.value = [];
        this.selectedDataItems = [];
        this.cdr.markForCheck();
        this.emitValueChange();
        this.setState([]);
    };
    MultiSelectComponent.prototype.ngAfterContentChecked = function () {
        this.verifySettings();
    };
    MultiSelectComponent.prototype.ngDoCheck = function () {
        if (this.differ) {
            var valueChanges = this.differ.diff(this.value);
            if (valueChanges) {
                this.selectedDataItems = this.getSelectedDataItems(valueChanges);
                this.tags = this.tagMapper(this.selectedDataItems.slice(0));
            }
        }
    };
    MultiSelectComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.hostElement, "tabindex");
    };
    MultiSelectComponent.prototype.ngOnChanges = function (changes) {
        var _this = this;
        if (this.valuePrimitive === undefined) {
            this.valuePrimitive = !this.valueField;
        }
        if (changes.value && this.selectedDataItems.length > 0) {
            //peristed selected data items when list is filtered
            this.selectedDataItems = this.selectedDataItems.concat(this.data).filter(function (curr) {
                return changes.value.currentValue.find(function (item) { return item[_this.valueField] === curr; });
            }).filter(function (dataItem) { return !!dataItem; }); //filter undefined values
        }
        var STATE_PROPS = /(data|value|textField|valueField|valuePrimitive)/g;
        if (STATE_PROPS.test(Object.keys(changes).join())) {
            this.setState(this.value);
        }
    };
    MultiSelectComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.searchbar.setInputSize();
        this.observableSubscriptions.add(this.searchbar.onFocus.subscribe(function (event) {
            if (!_this.isFocused) {
                _this.isFocused = true;
                _this.onFocus.emit(event);
            }
        }));
        this.observableSubscriptions.add(this.searchbar.onBlur.subscribe(function (event) {
            if (_this.isFocused) {
                _this.isFocused = false;
                _this.onBlur.emit(event);
                _this.onTouchedCallback();
            }
        }));
    };
    MultiSelectComponent.prototype.ngOnDestroy = function () {
        this._toggle(false);
        this.unsubscribeEvents();
    };
    /**
     * Focuses the MultiSelect.
     */
    MultiSelectComponent.prototype.focus = function () {
        if (!this.disabled) {
            this.searchbar.focus();
        }
    };
    /**
     * Blurs the MultiSelect.
     */
    MultiSelectComponent.prototype.blur = function () {
        if (!this.disabled) {
            this.searchbar.blur();
        }
    };
    /**
     * Toggles the visibility of the popup.
     * If you use the `toggle` method to open or close the popup, the respective `open` and `close` events will not be fired.
     *
     * @param open - The state of the popup.
     */
    MultiSelectComponent.prototype.toggle = function (open) {
        var _this = this;
        Promise.resolve(null).then(function () {
            _this._toggle((open === undefined) ? !_this._open : open);
            _this.cdr.markForCheck();
        });
    };
    Object.defineProperty(MultiSelectComponent.prototype, "isOpen", {
        /**
         * Returns the current open state of the popup.
         */
        get: function () {
            return this.popupOpen;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Resets the value of the MultiSelect.
     * If you use the `reset` method to clear components value, the model will not update automatically and the `selectionChange` and `valueChange` events will not be fired.
     */
    MultiSelectComponent.prototype.reset = function () {
        this.text = "";
        this.value = [];
        this.selectedDataItems = [];
        this.setState([]);
        this.cdr.markForCheck();
    };
    // NG MODEL BINDINGS
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.writeValue = function (value) {
        this.value = value || [];
        this.selectedDataItems = [];
        this.setState(this.value);
        this.verifySettings();
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.registerOnChange = function (fn) {
        this.onChangeCallback = fn;
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.registerOnTouched = function (fn) {
        this.onTouchedCallback = fn;
    };
    /**
     * @hidden
     */
    MultiSelectComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    MultiSelectComponent.prototype.subscribeEvents = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.observableSubscriptions = this.changeSubscription = this.selectionService.onChange.subscribe(this.handleItemChange.bind(this));
        var isOpen = function () { return _this.popupOpen; };
        var isClosed = function () { return !_this.popupOpen; };
        var isTagFocused = function () { return !_this.popupOpen && _this.focusedTagIndex !== undefined; };
        [
            this.navigationService.esc.subscribe(this.closePopup.bind(this)),
            this.navigationService.enter.filter(isOpen).subscribe(this.handleEnter.bind(this)),
            this.navigationService.open.subscribe(this.openPopup.bind(this)),
            this.navigationService.close.subscribe(this.handleClose.bind(this)),
            this.navigationService.up.filter(isOpen).subscribe(function (event) { return _this.handleUp(event.index); }),
            this.navigationService.home.filter(function () { return isClosed; }).subscribe(this.handleHome.bind(this)),
            this.navigationService.end.filter(function () { return isClosed; }).subscribe(this.handleEnd.bind(this)),
            this.navigationService.backspace.filter(isTagFocused).subscribe(this.handleBackspace.bind(this)),
            this.navigationService.delete.filter(isTagFocused).subscribe(this.handleDelete.bind(this)),
            this.navigationService.left.subscribe(this.handleLeftKey.bind(this)),
            this.navigationService.right.subscribe(this.handleRightKey.bind(this)),
            this.navigationService.down.subscribe(function (event) { return _this.handleDownKey(event.index); })
        ].forEach(function (s) { return _this.observableSubscriptions.add(s); });
    };
    MultiSelectComponent.prototype.unsubscribeEvents = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.observableSubscriptions.unsubscribe();
    };
    MultiSelectComponent.prototype.removeGroupTag = function (dataItems) {
        var _this = this;
        var indices = dataItems.map(function (dataItem) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["m" /* selectedIndices */])([dataItem], _this.data, _this.valueField)[0]; });
        var valuesToRemove = [];
        indices.forEach(function (currentValue, index) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["o" /* isNumber */])(currentValue)) {
                _this.selectionService.unselect(currentValue);
            }
            else {
                var filter = function (item) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(item, _this.valueField) !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(dataItems[index], _this.valueField); };
                valuesToRemove.push(_this.value.find(filter));
            }
        });
        if (valuesToRemove.length) {
            var newValue_1 = this.value.slice();
            var newSelectedDataItems_1 = this.selectedDataItems.slice();
            valuesToRemove.forEach(function (value) {
                var filter = function (item) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(item, _this.valueField) !== value; };
                newValue_1 = newValue_1.filter(filter);
                newSelectedDataItems_1 = newSelectedDataItems_1.filter(filter);
            });
            this.value = newValue_1;
            this.selectedDataItems = newSelectedDataItems_1;
        }
        this.tags = this.tagMapper(this.selectedDataItems.slice(0));
        this.cdr.markForCheck();
        this.emitValueChange();
    };
    MultiSelectComponent.prototype.removeSingleTag = function (dataItem) {
        var _this = this;
        var index = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["m" /* selectedIndices */])([dataItem], this.data, this.valueField)[0];
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["o" /* isNumber */])(index)) {
            this.selectionService.unselect(index);
            this.popupOpen = false;
        }
        else {
            var filter = function (item) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(item, _this.valueField) !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(dataItem, _this.valueField); };
            this.value = this.value.filter(filter);
            this.selectedDataItems = this.selectedDataItems.filter(filter);
            this.tags = this.tagMapper(this.selectedDataItems.slice(0));
            this.cdr.markForCheck();
            this.emitValueChange();
        }
    };
    MultiSelectComponent.prototype.handleItemChange = function (event) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(event.added)) {
            this.handleFilter('');
        }
        this.change(event);
        if (this.autoClose) {
            this.popupOpen = false;
        }
    };
    MultiSelectComponent.prototype.handleEnter = function (event) {
        var focusedIndex = this.selectionService.focused;
        if (this.popupOpen) {
            event.originalEvent.preventDefault();
        }
        if (focusedIndex === -1) {
            return;
        }
        if (this.selectionService.isSelected(focusedIndex)) {
            this.selectionService.unselect(focusedIndex);
        }
        else {
            this.selectionService.add(focusedIndex);
        }
        this.handleFilter('');
        if (this.autoClose) {
            this.popupOpen = false;
        }
    };
    MultiSelectComponent.prototype.handleClose = function () {
        this.closePopup();
        this.searchbar.focus();
    };
    MultiSelectComponent.prototype.handleEnd = function () {
        this.focusedTagIndex = this.tags.length - 1;
    };
    MultiSelectComponent.prototype.handleHome = function () {
        this.focusedTagIndex = 0;
    };
    MultiSelectComponent.prototype.handleUp = function (index) {
        this.selectionService.focused = index;
    };
    MultiSelectComponent.prototype.handleBackspace = function () {
        if (this.focusedTagIndex !== undefined) {
            this.handleDelete();
            return;
        }
        this.handleRemoveTag(this.tags[this.tags.length - 1]);
        this.searchbar.focus();
    };
    MultiSelectComponent.prototype.handleDelete = function () {
        this.handleRemoveTag(this.tags[this.focusedTagIndex]);
        if (this.focusedTagIndex === this.tags.length) {
            this.focusedTagIndex = undefined;
        }
    };
    MultiSelectComponent.prototype.handleLeftKey = function () {
        if (this.direction === 'rtl' && this.focusedTagIndex === 0) {
            this.focusedTagIndex = undefined;
            return;
        }
        if (this.direction === 'rtl' && this.focusedTagIndex === undefined) {
            return;
        }
        if (this.focusedTagIndex === undefined || this.focusedTagIndex < 0) {
            this.focusedTagIndex = this.tags.length - 1;
        }
        else if (this.focusedTagIndex !== 0) {
            this.focusedTagIndex--;
        }
    };
    MultiSelectComponent.prototype.handleDownKey = function (index) {
        if (this.popupOpen) {
            this.selectionService.focused = index || 0;
        }
        else {
            this.openPopup();
        }
    };
    MultiSelectComponent.prototype.handleRightKey = function () {
        var last = this.tags.length - 1;
        if (this.direction === 'rtl' && this.focusedTagIndex === undefined) {
            this.focusedTagIndex = 0;
            return;
        }
        if (this.direction === 'rtl' && this.focusedTagIndex === last) {
            return;
        }
        if (this.focusedTagIndex === last) {
            this.focusedTagIndex = undefined;
        }
        else if (this.focusedTagIndex < last) {
            this.focusedTagIndex++;
        }
    };
    MultiSelectComponent.prototype.findIndex = function (text) {
        var _this = this;
        return this.data.findIndex(function (item) {
            var itemText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(item, _this.textField);
            itemText = itemText === undefined ? "" : itemText.toString().toLowerCase();
            return itemText.startsWith(text.toLowerCase());
        });
    };
    MultiSelectComponent.prototype.searchTextAndFocus = function (text) {
        var index = this.findIndex(text);
        this.selectionService.focused = index;
    };
    MultiSelectComponent.prototype.closePopup = function () {
        this.popupOpen = false;
        this.focusedTagIndex = undefined;
    };
    MultiSelectComponent.prototype.openPopup = function () {
        this.popupOpen = true;
        this.focusedTagIndex = undefined;
    };
    MultiSelectComponent.prototype.emitValueChange = function () {
        this.onChangeCallback(this.value);
        this.valueChange.emit(this.value);
    };
    MultiSelectComponent.prototype._toggle = function (open) {
        var _this = this;
        this._open = open;
        if (this.popupRef) {
            this.popupRef.popupElement
                .removeEventListener('mousedown', this.popupMouseDownHandler);
            this.popupRef.close();
            this.popupRef = null;
        }
        if (this._open) {
            this.popupRef = this.popupService.open({
                anchor: this.wrapper,
                animate: this.popupSettings.animate,
                appendTo: this.appendTo,
                content: this.popupTemplate,
                popupClass: this.listContainerClasses,
                positionMode: 'absolute'
            });
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler);
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
            popupWrapper.setAttribute("dir", this.direction);
            this.popupRef.popupOpen.subscribe(this.popupOpened.bind(this));
            this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; });
        }
    };
    MultiSelectComponent.prototype.getSelectedDataItems = function (valueChanges) {
        var _this = this;
        var selectedDataItems = [];
        valueChanges.forEachItem(function (value) {
            var currentValue = value.currentValue;
            var isBoundToComplexData = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isObjectArray */])(_this.data);
            var index = _this.data.findIndex(function (item) {
                var value = _this.valuePrimitive ? currentValue : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(currentValue, _this.valueField);
                return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* getter */])(item, _this.valueField) === value;
            });
            if (index !== -1) {
                _this.selectionService.select(index);
                selectedDataItems.push(_this.data[index]);
            }
            else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["b" /* isPresent */])(value) && !(isBoundToComplexData && _this.valuePrimitive)) {
                selectedDataItems.push(currentValue);
            }
        });
        return selectedDataItems;
    };
    return MultiSelectComponent;
}());

MultiSelectComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Component"], args: [{
                exportAs: 'kendoMultiSelect',
                providers: [MULTISELECT_VALUE_ACCESSOR, __WEBPACK_IMPORTED_MODULE_5__selection_service__["a" /* SelectionService */], __WEBPACK_IMPORTED_MODULE_6__navigation_service__["a" /* NavigationService */]],
                selector: 'kendo-multiselect',
                template: "\n        <div class=\"k-multiselect-wrap k-floatwrap\"\n            #wrapper\n            (mousedown)=\"wrapperMousedown($event)\"\n        >\n            <kendo-taglist\n                [tags]=\"tags\"\n                [textField]=\"textField\"\n                [focused]=\"focusedTagIndex\"\n                [disabled]=\"disabled\"\n                [template]=\"tagTemplate\"\n                [groupTemplate]=\"groupTagTemplate\"\n                [activeId]=\"activeId\"\n                (removeTag)=\"handleRemoveTag($event)\"\n            >\n            </kendo-taglist>\n            <kendo-searchbar\n                #searchbar\n                [id]=\"id\"\n                [role]=\"'listbox'\"\n                [listId]=\"listBoxId\"\n                [activeDescendant]=\"activeId\"\n                [userInput]=\"text\"\n                [disabled]=\"disabled\"\n                [readonly]=\"readonly\"\n                [tabIndex]=\"tabIndex\"\n                [popupOpen]=\"popupOpen\"\n                [placeholder]=\"placeholder\"\n                (onNavigate)=\"handleNavigate($event)\"\n                (valueChange)=\"handleFilter($event)\"\n                (onBlur)=\"blurComponent()\"\n                (onFocus)=\"focusComponent()\"\n            >\n            </kendo-searchbar>\n            <span *ngIf=\"!loading && !readonly && clearButton && (tags?.length || text?.length)\" class=\"k-icon k-clear-value k-i-close\" title=\"clear\" role=\"button\" tabindex=\"-1\" (mousedown)=\"clearAll($event)\"></span>\n            <span *ngIf=\"loading\" class=\"k-icon k-i-loading\"></span>\n        </div>\n        <ng-template #popupTemplate>\n            <!--header template-->\n            <ng-template *ngIf=\"headerTemplate\"\n                [templateContext]=\"{\n                    templateRef: headerTemplate.templateRef\n                }\">\n            </ng-template>\n            <!--list-->\n            <kendo-list\n                [id]=\"listBoxId\"\n                [data]=\"data\"\n                [textField]=\"textField\"\n                [valueField]=\"valueField\"\n                [height]=\"popupSettings?.height\"\n                [template]=\"template\"\n                [show]=\"popupOpen\"\n                [multipleSelection]=\"true\"\n                >\n            </kendo-list>\n            <!--no data template-->\n            <div class=\"k-nodata\" *ngIf=\"data.length === 0\">\n                <ng-template [ngIf]=\"noDataTemplate\"\n                    [templateContext]=\"{\n                        templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n                    }\">\n                </ng-template>\n                <ng-template [ngIf]=\"!noDataTemplate\">\n                    <div>NO DATA FOUND.</div>\n                </ng-template>\n            </div>\n            <!--footer template-->\n            <ng-template *ngIf=\"footerTemplate\"\n                [templateContext]=\"{\n                    templateRef: footerTemplate.templateRef\n                }\">\n            </ng-template>\n        </ng-template>\n        <ng-template [ngIf]=\"popupOpen\">\n            <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n        </ng-template>\n        <ng-container #container></ng-container>\n  "
            },] },
];
/** @nocollapse */
MultiSelectComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_18__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_19__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: __WEBPACK_IMPORTED_MODULE_5__selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_6__navigation_service__["a" /* NavigationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["KeyValueDiffers"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ElementRef"], },
]; };
MultiSelectComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'autoClose': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'loading': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'valueField': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'textField': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"], args: ["tabIndex",] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'readonly': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'popupSettings': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'valuePrimitive': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'clearButton': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'tagMapper': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Input"] },],
    'filterChange': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"], args: ['blur',] },],
    'removeTag': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["Output"] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ViewChild"], args: ['container', { read: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ViewContainerRef"] },] },],
    'searchbar': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_1__searchbar_component__["a" /* SearchBarComponent */],] },],
    'popupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ViewChild"], args: ['popupTemplate',] },],
    'wrapper': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ViewChild"], args: ['wrapper',] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_9__templates_item_template_directive__["a" /* ItemTemplateDirective */],] },],
    'headerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_10__templates_header_template_directive__["a" /* HeaderTemplateDirective */],] },],
    'footerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_11__templates_footer_template_directive__["a" /* FooterTemplateDirective */],] },],
    'tagTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_12__templates_tag_template_directive__["a" /* TagTemplateDirective */],] },],
    'groupTagTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_13__templates_group_tag_template_directive__["a" /* GroupTagTemplateDirective */],] },],
    'noDataTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_14__templates_no_data_template_directive__["a" /* NoDataTemplateDirective */],] },],
    'widgetClasses': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["HostBinding"], args: ['class.k-multiselect',] }, { type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["HostBinding"], args: ['class.k-header',] },],
    'dir': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["HostBinding"], args: ['attr.dir',] },],
    'focusedClass': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'disabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_2__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
};


/***/ }),
/* 167 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ValueTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering the selected value of the component. It can only be used with the DropDownList.
 *
 * The template context is set to the current DropDownList. To get a reference to the current data item, use the `let-dataItem` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-dropdownlist [data]="listItems">
 *    <ng-template kendoDropDownListValueTemplate let-dataItem>
 *      <span>{{dataItem}} option</span>
 *    </ng-template>
 *  </kendo-dropdownlist>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 *
 * For more examples, refer to the article on [templates]({% slug templates_ddl %}).
 */
var ValueTemplateDirective = (function () {
    function ValueTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return ValueTemplateDirective;
}());

ValueTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDropDownListValueTemplate]'
            },] },
];
/** @nocollapse */
ValueTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 168 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FooterTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column footer cell template of the Kendo ExcelExport column component.
 *
 * It helps to customize the footer cell for the column.
 */
var FooterTemplateDirective = (function () {
    function FooterTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return FooterTemplateDirective;
}());

FooterTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoExcelExportFooterTemplate]'
            },] },
];
/** @nocollapse */
FooterTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 169 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupFooterTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column group footer cell template of the ExcelExport column component.
 *
 * It helps to customize the group footer cell for the column.
 */
var GroupFooterTemplateDirective = (function () {
    function GroupFooterTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return GroupFooterTemplateDirective;
}());

GroupFooterTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoExcelExportGroupFooterTemplate]'
            },] },
];
/** @nocollapse */
GroupFooterTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 170 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupHeaderTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the group header cell template of the ExcelExport column component.
 *
 * It helps to customize the content of the group header item.
 */
var GroupHeaderTemplateDirective = (function () {
    function GroupHeaderTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return GroupHeaderTemplateDirective;
}());

GroupHeaderTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoExcelExportGroupHeaderTemplate]'
            },] },
];
/** @nocollapse */
GroupHeaderTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 171 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnResizingService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_zip__ = __webpack_require__(491);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_zip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_zip__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_take__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_take___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_take__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_column_common__ = __webpack_require__(27);





/**
 * @hidden
 */
var isLocked = function (column) { return column.parent ? isLocked(column.parent) : !!column.locked; };
/**
 * @hidden
 */
var resizeArgs = function (column, extra) { return Object.assign({
    columns: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__columns_column_common__["d" /* leafColumns */])([column]),
    locked: isLocked(column)
}, extra); }; // tslint:disable-line:align
/**
 * @hidden
 */
var ColumnResizingService = (function () {
    function ColumnResizingService() {
        this.changes = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.tables = new Array();
        this.muteEndNotificaton = false;
    }
    ColumnResizingService.prototype.start = function (column) {
        this.trackColumns(column);
        var columns = (this.column.isColumnGroup ? [column] : [])
            .concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__columns_column_common__["d" /* leafColumns */])([column]));
        this.changes.emit({
            columns: columns,
            locked: isLocked(this.column),
            type: 'start'
        });
    };
    ColumnResizingService.prototype.resizeColumns = function (deltaPercent) {
        var action = resizeArgs(this.column, {
            deltaPercent: deltaPercent,
            type: 'resizeColumn'
        });
        this.changes.emit(action);
    };
    ColumnResizingService.prototype.resizeTable = function (delta) {
        var action = resizeArgs(this.column, {
            delta: delta,
            type: 'resizeTable'
        });
        this.changes.emit(action);
    };
    ColumnResizingService.prototype.resizedColumn = function (state) {
        this.resizedColumns.push(state);
    };
    ColumnResizingService.prototype.end = function () {
        this.changes.emit({
            columns: [],
            resizedColumns: this.resizedColumns,
            type: 'end'
        });
    };
    ColumnResizingService.prototype.registerTable = function (fn) {
        var _this = this;
        this.tables.push(fn);
        return function () {
            _this.tables.splice(_this.tables.indexOf(fn), 1);
        };
    };
    ColumnResizingService.prototype.measureColumns = function (info) {
        var _this = this;
        var observables = this.tables.map(function (fn) { return fn(info); });
        __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].zip.apply(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"], observables).take(1)
            .subscribe(function (widths) {
            _this.changes.emit({
                columns: info.map(function (i) { return i.column; }),
                type: 'autoFitComplete',
                widths: widths
            });
            if (!_this.muteEndNotificaton) {
                _this.end();
            }
            _this.muteEndNotificaton = false;
        });
    };
    ColumnResizingService.prototype.autoFit = function (column) {
        this.muteEndNotificaton = true;
        this.start(column);
        this.changes.emit({
            columns: [column],
            type: 'triggerAutoFit'
        });
    };
    ColumnResizingService.prototype.trackColumns = function (column) {
        this.resizedColumns = [];
        this.column = column;
    };
    return ColumnResizingService;
}());

ColumnResizingService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ColumnResizingService.ctorParameters = function () { return []; };


/***/ }),
/* 172 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isSpanColumnComponent;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SpanColumnComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_cell_template_directive__ = __webpack_require__(68);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__editing_edit_template_directive__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__column_component__ = __webpack_require__(49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils__ = __webpack_require__(7);







/**
 * @hidden
 */
function isSpanColumnComponent(column) {
    return column.isSpanColumn;
}
/**
 * Represents a column which can be spanned over multiple data cells while the individual header and footer cells are retained.
 * This behavior enables you to achieve more flexible layout and, at the same time,
 * keep the built-in UI element for sorting, filtering, and grouping.
 * The columns that will be merged have to be wrapped inside the `<kendo-grid-span-column>` tag.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *    selector: 'my-app',
 *    template: `
 *        <kendo-grid
 *              [sortable]="true"
 *              [filterable]="true"
 *              [kendoGridBinding]="products">
 *          <kendo-grid-column field="ProductID" title="Product ID" width="120">
 *          </kendo-grid-column>
 *          <kendo-grid-span-column>
 *              <kendo-grid-column field="ProductName" title="Product Name">
 *              </kendo-grid-column>
 *              <kendo-grid-column field="UnitPrice" title="Unit Price" filter="numeric" width="180" format="{0:c}">
 *              </kendo-grid-column>
 *          </kendo-grid-span-column>
 *          <kendo-grid-column field="Discontinued" width="120" filter="boolean">
 *              <ng-template kendoGridCellTemplate let-dataItem>
 *                  <input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
 *              </ng-template>
 *          </kendo-grid-column>
 *        </kendo-grid>
 *    `
 * })
 *
 * class AppComponent {
 *   public products = [{
 *      "ProductID": 1,
 *      "ProductName": "Chai",
 *      "UnitPrice": 18.0000,
 *      "Discontinued": true
 *    }, {
 *      "ProductID": 2,
 *      "ProductName": "Chang",
 *      "UnitPrice": 19.0000,
 *      "Discontinued": false
 *    }
 *   ];
 * }
 *
 * ```
 *
 * By default, the data cell displays the data for the specified fields.
 * To further customize the spanned-column functionality,
 * you can use a [cell template]({% slug api_grid_celltemplatedirective %}).
 *
 * ```html-no-run
 * <kendo-grid-span-column>
 *  <kendo-grid-column field="field1" title="Field 1"></kendo-grid-column>
 *  <kendo-grid-column field="field2" title="Field 2"></kendo-grid-column>
 *    <ng-template kendoGridCellTemplate let-dataItem>
 *        <h5>{{ dataItem.field1 }}</h5>
 *        <p>{{ dataItem.field2 }}</p>
 *    </ng-template>
 *  </kendo-grid-span-column>
 * ```
 */
var SpanColumnComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](SpanColumnComponent, _super);
    function SpanColumnComponent(parent) {
        var _this = _super.call(this, parent) || this;
        /*
         * @hidden
         */
        _this.isSpanColumn = true;
        _this.template = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["QueryList"]();
        _this.editTemplate = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["QueryList"]();
        /**
         * @hidden
         */
        _this.childColumns = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["QueryList"]();
        _this._editable = true;
        _this._hidden = false;
        _this._locked = false;
        if (parent && parent.isSpanColumn) {
            throw new Error('SpanColumn cannot be nested inside another SpanColumn');
        }
        return _this;
    }
    Object.defineProperty(SpanColumnComponent.prototype, "hidden", {
        get: function () {
            return this._hidden || this.childColumns.toArray().every(function (x) { return x.hidden; });
        },
        /**
         * Sets the visibility of the column.
         *
         * @default false
         */
        set: function (value) {
            this._hidden = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SpanColumnComponent.prototype, "editable", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__utils__["b" /* isPresent */])(this.editTemplateRef) && this._editable;
        },
        /**
         * Defines whether the edit template of the column will be rendered. The default value is `false`.
         *
         * > To enable the editing functionality for a spanned column, set an edit template for it.
         *
         * @example
         * ```ts-no-run
         * <kendo-grid>
         *    <kendo-grid-span-column [editable]="false">
         *      <kendo-grid-column field="UnitPrice">
         *      </kendo-grid-column>
         *      <kendo-grid-column field="ProductName">
         *      </kendo-grid-column>
         *      <ng-template kendoGridEditTemplate>
         *         .....
         *      </ng-template>
         *    </kendo-grid-span-column>
         * </kendo-grid>
         * ```
         */
        set: function (value) {
            this._editable = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SpanColumnComponent.prototype, "templateRef", {
        /**
         * @hidden
         */
        get: function () {
            var template = this.template.first;
            return template ? template.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SpanColumnComponent.prototype, "editTemplateRef", {
        /**
         * @hidden
         */
        get: function () {
            var editTemplate = this.editTemplate.first;
            return editTemplate ? editTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SpanColumnComponent.prototype, "colspan", {
        /**
         * @hidden
         */
        get: function () {
            return this.childColumns.filter(function (c) { return !c.hidden; }).length;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SpanColumnComponent.prototype, "locked", {
        get: function () {
            return this._locked || this.childColumns.some(function (c) { return c.locked; });
        },
        /**
         * Toggles the locked (frozen) state of the columns.
         * Locked columns are visible at all times during the horizontal scrolling of the Grid.
         * For the option to work properly, make sure that the Grid is configured to meet the following requirements:
         * - Scrolling is enabled.
         * - The `height` option of the Grid is set.
         * - The widths of all Grid columns are explicitly set in pixels.
         * In this way, the Grid adjusts the layout of the locked and unlocked columns.
         *
         * @default false
         *
         * @example
         * ```ts
         * _@Component({
         *    selector: 'my-app',
         *    template: `
         *        <kendo-grid [data]="gridData" [scrollable]="scrollable" style="height: 200px">
         *          <kendo-grid-span-column [locked]="true">
         *             <kendo-grid-column field="ProductID" title="Product ID" width="120">
         *             </kendo-grid-column>
         *             <kendo-grid-column field="ProductName" title="Product Name" width="200">
         *             </kendo-grid-column>
         *          <kendo-grid-span-column>
         *          <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         *          </kendo-grid-column>
         *        </kendo-grid>
         *    `
         * })
         *
         * class AppComponent {
         *    public gridData: any[];
         *
         *    constructor() {
         *        this.gridData = products;
         *    }
         * }
         *
         * const products = [{
         *    "ProductID": 1,
         *    "ProductName": "Chai",
         *    "UnitPrice": 18.0000,
         *    "Discontinued": true
         *  }, {
         *    "ProductID": 2,
         *    "ProductName": "Chang",
         *    "UnitPrice": 19.0000,
         *    "Discontinued": false
         *  }
         * ];
         *
         * ```
         */
        set: function (value) {
            this._locked = value;
        },
        enumerable: true,
        configurable: true
    });
    return SpanColumnComponent;
}(__WEBPACK_IMPORTED_MODULE_4__column_base__["a" /* ColumnBase */]));

SpanColumnComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_4__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return SpanColumnComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-grid-span-column',
                template: ""
            },] },
];
/** @nocollapse */
SpanColumnComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_4__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };
SpanColumnComponent.propDecorators = {
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_cell_template_directive__["a" /* CellTemplateDirective */], { descendants: false },] },],
    'editTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_3__editing_edit_template_directive__["a" /* EditTemplateDirective */], { descendants: false },] },],
    'childColumns': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_5__column_component__["b" /* ColumnComponent */],] },],
    'hidden': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'editable': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'locked': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 173 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DomEventsService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var DomEventsService = (function () {
    function DomEventsService() {
        this.cellClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.cellMousedown = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    return DomEventsService;
}());

DomEventsService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
DomEventsService.ctorParameters = function () { return []; };


/***/ }),
/* 174 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChangeNotificationService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_take__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_take___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_take__);


/**
 * @hidden
 */
var ChangeNotificationService = (function () {
    function ChangeNotificationService(ngZone) {
        this.ngZone = ngZone;
        this.changes = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    ChangeNotificationService.prototype.notify = function () {
        var _this = this;
        if (!this.subscription || this.subscription.closed) {
            this.subscription = this.ngZone.onStable
                .asObservable()
                .take(1)
                .subscribe(function () { return _this.changes.emit(); });
        }
    };
    return ChangeNotificationService;
}());

ChangeNotificationService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ChangeNotificationService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 175 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DataBindingDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__ = __webpack_require__(75);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__ = __webpack_require__(66);





/**
 * A Directive which encapsulates the in-memory handling of data operations such as paging, sorting, and grouping.
 */
var DataBindingDirective = (function () {
    function DataBindingDirective(grid, localDataChangesService) {
        this.grid = grid;
        this.localDataChangesService = localDataChangesService;
        this.state = {
            skip: 0
        };
        this.originalData = [];
        if (localDataChangesService) {
            this.dataChangedSubscription = this.localDataChangesService.changes.subscribe(this.rebind.bind(this));
        }
    }
    Object.defineProperty(DataBindingDirective.prototype, "skip", {
        /**
         * Defines the number of records to be skipped by the pager.
         */
        set: function (value) {
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(value)) {
                value = 0;
            }
            this.grid.skip = this.state.skip = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataBindingDirective.prototype, "sort", {
        /**
         * Defines the descriptors by which the data will be sorted.
         */
        set: function (value) {
            this.grid.sort = this.state.sort = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataBindingDirective.prototype, "filter", {
        /**
         * Defines the descriptor by which the data will be filtered.
         */
        set: function (value) {
            this.grid.filter = this.state.filter = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataBindingDirective.prototype, "pageSize", {
        /**
         * Defines the page size used by the Grid pager.
         */
        set: function (value) {
            this.grid.pageSize = this.state.take = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataBindingDirective.prototype, "group", {
        /**
         * The descriptors by which the data will be grouped.
         */
        set: function (value) {
            this.grid.group = this.state.group = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataBindingDirective.prototype, "data", {
        /**
         * The array of data which will be used to populate the Grid.
         */
        set: function (value) {
            this.originalData = value || [];
            if (this.localDataChangesService) {
                this.localDataChangesService.data = value;
            }
            this.grid.data = this.process(this.state);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DataBindingDirective.prototype.ngOnInit = function () {
        this.applyState(this.state);
        this.stateChangeSubscription = this.grid
            .dataStateChange
            .subscribe(this.onStateChange.bind(this));
    };
    /**
     * @hidden
     */
    DataBindingDirective.prototype.ngOnDestroy = function () {
        this.stateChangeSubscription.unsubscribe();
        if (this.dataChangedSubscription) {
            this.dataChangedSubscription.unsubscribe();
        }
    };
    /**
     * @hidden
     */
    DataBindingDirective.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["e" /* anyChanged */])(["pageSize", "skip", "sort", "group", "filter"], changes)) {
            this.rebind();
        }
    };
    /**
     * @hidden
     */
    DataBindingDirective.prototype.onStateChange = function (state) {
        this.applyState(state);
        this.rebind();
    };
    /**
     * @hidden
     */
    DataBindingDirective.prototype.rebind = function () {
        this.data = this.originalData;
        this.grid.onDataChange();
    };
    DataBindingDirective.prototype.process = function (state) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["a" /* process */])(this.originalData, state);
    };
    DataBindingDirective.prototype.applyState = function (_a) {
        var skip = _a.skip, take = _a.take, sort = _a.sort, group = _a.group, filter = _a.filter;
        this.skip = skip;
        this.pageSize = take;
        this.sort = sort;
        this.group = group;
        this.filter = filter;
    };
    return DataBindingDirective;
}());

DataBindingDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridBinding]'
            },] },
];
/** @nocollapse */
DataBindingDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__grid_component__["a" /* GridComponent */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__["a" /* LocalDataChangesService */], },
]; };
DataBindingDirective.propDecorators = {
    'skip': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'sort': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageSize': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'group': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["kendoGridBinding",] },],
};


/***/ }),
/* 176 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EditTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column edit cell template of the Grid.
 * It helps to customize the content of the edited cells.
 *
 * To define the cell template, nest a `<ng-template>` tag with the `kendoGridEditTemplate` directive
 * inside a `<kendo-grid-column>` tag.
 *
 * The template context contains the following fields:
 * - `formGroup`&mdash;The current [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html).
 * If you use the Grid inside [Template-Driven Forms](https://angular.io/docs/ts/latest/guide/forms.html), it will be `undefined`.
 * - `rowIndex`&mdash;The current row index. If inside a new item row, it is `-1`.
 * - `dataItem`&mdash;The current data item.
 * - `column`&mdash;The current column instance.
 * - `isNew`&mdash;The state of the current item.
 */
var EditTemplateDirective = (function () {
    function EditTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return EditTemplateDirective;
}());

EditTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridEditTemplate]'
            },] },
];
/** @nocollapse */
EditTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 177 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExcelService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var ExcelService = (function () {
    function ExcelService() {
        this.saveToExcel = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.exportClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    ExcelService.prototype.save = function (component) {
        if (this.saveToExcel.observers.length === 0) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
                throw new Error('Saving excel requires including the ExcelModule and adding the <kendo-grid-excel> component.');
            }
        }
        else {
            this.saveToExcel.emit(component);
        }
    };
    return ExcelService;
}());

ExcelService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ExcelService.ctorParameters = function () { return []; };


/***/ }),
/* 178 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateFilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__date_filter_component__ = __webpack_require__(316);





/**
 * Represents a date filter-cell component.
 *
 * @example
 *
 *  ```ts-no-run
 *      <kendo-grid-column field="OrderDate" title="Order Date">
 *          <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
 *          <kendo-grid-date-filter-cell
 *              [showOperators]="false"
 *              [column]="column"
 *              [filter]="filter">
 *          </kendo-grid-date-filter-cell>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var DateFilterCellComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DateFilterCellComponent, _super);
    function DateFilterCellComponent(filterService, localization) {
        var _this = _super.call(this, filterService, localization) || this;
        _this.localization = localization;
        /**
         * Determines if the drop-down filter operators will be shown. The default value is `true`.
         * @type {boolean}
         */
        _this.showOperators = true;
        return _this;
    }
    return DateFilterCellComponent;
}(__WEBPACK_IMPORTED_MODULE_4__date_filter_component__["a" /* DateFilterComponent */]));

DateFilterCellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-date-filter-cell',
                template: "\n        <kendo-grid-filter-wrapper-cell\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [defaultOperator]=\"operator\"\n            [showOperators]=\"showOperators\"\n            >\n            <kendo-datepicker\n                kendoFilterInput\n                [value]=\"currentFilter?.value\"\n                [format]=\"format\"\n                [formatPlaceholder]=\"formatPlaceholder\"\n                [placeholder]=\"placeholder\"\n                [activeView]=\"activeView\"\n                [bottomView]=\"bottomView\"\n                [topView]=\"topView\"\n                [min]=\"min\"\n                [max]=\"max\"\n                >\n            </kendo-datepicker>\n        </kendo-grid-filter-wrapper-cell>\n    "
            },] },
];
/** @nocollapse */
DateFilterCellComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
DateFilterCellComponent.propDecorators = {
    'showOperators': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 179 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterCellTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the filter-cell template.
 */
var FilterCellTemplateDirective = (function () {
    function FilterCellTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return FilterCellTemplateDirective;
}());

FilterCellTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridFilterCellTemplate]'
            },] },
];
/** @nocollapse */
FilterCellTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 180 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericFilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__numeric_filter_component__ = __webpack_require__(320);





/**
 * Represents a numeric filter cell.
 *
 * @example
 *  ```ts-no-run
 *      <kendo-grid-column field="ProductName" title="Product Name">
 *          <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
 *          <kendo-grid-numeric-filter-cell
 *              [column]="column"
 *              [filter]="filter">
 *          </kendo-grid-numeric-filter-cell>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var NumericFilterCellComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](NumericFilterCellComponent, _super);
    function NumericFilterCellComponent(filterService, localization) {
        var _this = _super.call(this, filterService, localization) || this;
        _this.localization = localization;
        /**
         * Determines if the drop-down filter operators will be shown. The default value is `true`.
         * @type {boolean}
         */
        _this.showOperators = true;
        return _this;
    }
    return NumericFilterCellComponent;
}(__WEBPACK_IMPORTED_MODULE_4__numeric_filter_component__["a" /* NumericFilterComponent */]));

NumericFilterCellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-numeric-filter-cell',
                template: "\n        <kendo-grid-filter-wrapper-cell\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [defaultOperator]=\"operator\"\n            [showOperators]=\"showOperators\">\n            <kendo-numerictextbox\n                kendoFilterInput\n                [autoCorrect]=\"true\"\n                [value]=\"currentFilter?.value\"\n                [format]=\"format\"\n                [decimals]=\"decimals\"\n                [spinners]=\"spinners\"\n                [min]=\"min\"\n                [max]=\"max\"\n                [step]=\"step\">\n            </kendo-numerictextbox>\n        </kendo-grid-filter-wrapper-cell>\n    "
            },] },
];
/** @nocollapse */
NumericFilterCellComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
NumericFilterCellComponent.propDecorators = {
    'showOperators': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 181 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RowFilterModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter_row_component__ = __webpack_require__(580);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_cell_component__ = __webpack_require__(315);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filter_cell_template_directive__ = __webpack_require__(179);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__numeric_filter_cell_component__ = __webpack_require__(180);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__filter_cell_wrapper_component__ = __webpack_require__(579);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__string_filter_cell_component__ = __webpack_require__(121);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__filter_cell_operators_component__ = __webpack_require__(314);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__autocomplete_filter_cell_component__ = __webpack_require__(312);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__boolean_filter_cell_component__ = __webpack_require__(313);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__date_filter_cell_component__ = __webpack_require__(178);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__shared_filtering_module__ = __webpack_require__(337);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__filter_cell_host_directive__ = __webpack_require__(578);













var INTERNAL_COMPONENTS = [
    __WEBPACK_IMPORTED_MODULE_1__filter_row_component__["a" /* FilterRowComponent */],
    __WEBPACK_IMPORTED_MODULE_2__filter_cell_component__["a" /* FilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_3__filter_cell_template_directive__["a" /* FilterCellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_6__string_filter_cell_component__["a" /* StringFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_4__numeric_filter_cell_component__["a" /* NumericFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_8__autocomplete_filter_cell_component__["a" /* AutoCompleteFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_9__boolean_filter_cell_component__["a" /* BooleanFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_12__filter_cell_host_directive__["a" /* FilterCellHostDirective */],
    __WEBPACK_IMPORTED_MODULE_5__filter_cell_wrapper_component__["a" /* FilterCellWrapperComponent */],
    __WEBPACK_IMPORTED_MODULE_10__date_filter_cell_component__["a" /* DateFilterCellComponent */]
];
var ENTRY_COMPONENTS = [
    __WEBPACK_IMPORTED_MODULE_6__string_filter_cell_component__["a" /* StringFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_4__numeric_filter_cell_component__["a" /* NumericFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_9__boolean_filter_cell_component__["a" /* BooleanFilterCellComponent */],
    __WEBPACK_IMPORTED_MODULE_10__date_filter_cell_component__["a" /* DateFilterCellComponent */]
];
/**
 * @hidden
 */
var RowFilterModule = (function () {
    function RowFilterModule() {
    }
    RowFilterModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_1__filter_row_component__["a" /* FilterRowComponent */],
            __WEBPACK_IMPORTED_MODULE_2__filter_cell_component__["a" /* FilterCellComponent */],
            __WEBPACK_IMPORTED_MODULE_3__filter_cell_template_directive__["a" /* FilterCellTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_7__filter_cell_operators_component__["a" /* FilterCellOperatorsComponent */],
            __WEBPACK_IMPORTED_MODULE_6__string_filter_cell_component__["a" /* StringFilterCellComponent */],
            __WEBPACK_IMPORTED_MODULE_4__numeric_filter_cell_component__["a" /* NumericFilterCellComponent */],
            __WEBPACK_IMPORTED_MODULE_8__autocomplete_filter_cell_component__["a" /* AutoCompleteFilterCellComponent */],
            __WEBPACK_IMPORTED_MODULE_9__boolean_filter_cell_component__["a" /* BooleanFilterCellComponent */],
            __WEBPACK_IMPORTED_MODULE_10__date_filter_cell_component__["a" /* DateFilterCellComponent */],
            __WEBPACK_IMPORTED_MODULE_11__shared_filtering_module__["a" /* SharedFilterModule */].exports()
        ];
    };
    return RowFilterModule;
}());

RowFilterModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [INTERNAL_COMPONENTS],
                entryComponents: ENTRY_COMPONENTS,
                exports: [INTERNAL_COMPONENTS, __WEBPACK_IMPORTED_MODULE_11__shared_filtering_module__["a" /* SharedFilterModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_11__shared_filtering_module__["a" /* SharedFilterModule */]]
            },] },
];
/** @nocollapse */
RowFilterModule.ctorParameters = function () { return []; };


/***/ }),
/* 182 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BooleanFilterMenuComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__boolean_filter_component__ = __webpack_require__(311);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(7);





/**
 * Represents a Boolean filter-menu component.
 *
 * @example
 *  ```ts-no-run
 *      <kendo-grid-column field="Discontinued" title="Discontinued">
 *          <ng-template kendoGridFilterMenuTemplate let-filter let-column="column" let-filterService="filterService">
 *            <kendo-grid-boolean-filter-menu
 *                [column]="column"
 *                [filter]="filter"
 *                [filterService]="filterService"
 *                >
 *            </kendo-grid-boolean-filter-menu>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var BooleanFilterMenuComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](BooleanFilterMenuComponent, _super);
    function BooleanFilterMenuComponent(localization) {
        var _this = _super.call(this, null, localization) || this;
        /**
         * The current menu filter.
         * @type {CompositeFilterDescriptor}
         */
        _this.filter = { filters: [], logic: "and" };
        _this.idPrefix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["m" /* guid */])();
        return _this;
    }
    Object.defineProperty(BooleanFilterMenuComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    BooleanFilterMenuComponent.prototype.radioId = function (value) {
        return this.idPrefix + "_" + value;
    };
    /**
     * @hidden
     */
    BooleanFilterMenuComponent.prototype.onChange = function (value) {
        this.applyFilter(this.updateFilter({
            field: this.column.field,
            operator: "eq",
            value: value
        }));
    };
    /**
     * @hidden
     */
    BooleanFilterMenuComponent.prototype.isSelected = function (radioValue) {
        return this.filtersByField(this.column.field).some(function (_a) {
            var value = _a.value;
            return value === radioValue;
        });
    };
    return BooleanFilterMenuComponent;
}(__WEBPACK_IMPORTED_MODULE_3__boolean_filter_component__["a" /* BooleanFilterComponent */]));

BooleanFilterMenuComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-boolean-filter-menu',
                template: "\n        <ul class=\"k-radio-list k-reset\">\n            <li *ngFor=\"let item of items\">\n                <input type=\"radio\"\n                    [name]=\"idPrefix\"\n                    class=\"k-radio\"\n                    [checked]=\"isSelected(item.value)\"\n                    [attr.id]=\"radioId(item.value)\"\n                    (change)=\"onChange(item.value)\"\n                />\n                <label class=\"k-radio-label\" [attr.for]=\"radioId(item.value)\">{{item.text}}</label>\n            </li>\n        </ul>\n    "
            },] },
];
/** @nocollapse */
BooleanFilterMenuComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
BooleanFilterMenuComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell',] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 183 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateFilterMenuComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__date_filter_component__ = __webpack_require__(316);





/**
 * Represents a date filter menu component.
 *
 * @example
 *  ```ts-no-run
 *      <kendo-grid-column field="OrderDate" title="Order Date">
 *          <ng-template kendoGridFilterMenuTemplate let-filter let-column="column" let-filterService="filterService">
 *            <kendo-grid-date-filter-menu
 *                [column]="column"
 *                [filter]="filter"
 *                [filterService]="filterService"
 *                >
 *            </kendo-grid-date-filter-menu>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var DateFilterMenuComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DateFilterMenuComponent, _super);
    function DateFilterMenuComponent(localization) {
        var _this = _super.call(this, null, localization) || this;
        _this.logicOperators = [
            { text: "And", value: "and" },
            { text: "Or", value: "or" }
        ];
        /**
         * The current menu filter.
         * @type {CompositeFilterDescriptor}
         */
        _this.filter = { filters: [], logic: "and" };
        /**
         * Determines if the second criterion inputs should be shown
         */
        _this.extra = true;
        return _this;
    }
    Object.defineProperty(DateFilterMenuComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateFilterMenuComponent.prototype, "firstFilter", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter.filters) && this.filter.filters.length) {
                return this.filter.filters[0];
            }
            else {
                return this.insertDefaultFilter(0, {
                    field: (this.column || {}).field,
                    operator: this.currentOperator
                });
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateFilterMenuComponent.prototype, "secondFilter", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter.filters) && this.filter.filters.length > 1) {
                return this.filter.filters[1];
            }
            else {
                return this.insertDefaultFilter(1, {
                    field: (this.column || {}).field,
                    operator: this.currentOperator
                });
            }
        },
        enumerable: true,
        configurable: true
    });
    DateFilterMenuComponent.prototype.logicChange = function (value) {
        this.filter.logic = value;
    };
    DateFilterMenuComponent.prototype.insertDefaultFilter = function (index, filter) {
        this.filter = (this.filter || { filters: [], logic: "and" });
        this.filter.filters[index] = filter;
        return filter;
    };
    return DateFilterMenuComponent;
}(__WEBPACK_IMPORTED_MODULE_4__date_filter_component__["a" /* DateFilterComponent */]));

DateFilterMenuComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-date-filter-menu',
                template: "\n        <kendo-grid-date-filter-menu-input\n            [currentFilter]=\"firstFilter\"\n            [operators]=\"operators\"\n            [filterService]=\"filterService\"\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [activeView]=\"activeView\"\n            [bottomView]=\"bottomView\"\n            [topView]=\"topView\"\n            [format]=\"format\"\n            [formatPlaceholder]=\"formatPlaceholder\"\n            [placeholder]=\"placeholder\"\n            [min]=\"min\"\n            [max]=\"max\"\n            >\n        </kendo-grid-date-filter-menu-input>\n        <kendo-dropdownlist\n            *ngIf=\"extra\"\n            class=\"k-filter-and\"\n            [data]=\"logicOperators\"\n            [valuePrimitive]=\"true\"\n            (valueChange)=\"logicChange($event)\"\n            [value]=\"filter?.logic\"\n            textField=\"text\"\n            valueField=\"value\">\n        </kendo-dropdownlist>\n        <kendo-grid-date-filter-menu-input\n            *ngIf=\"extra\"\n            [operators]=\"operators\"\n            [currentFilter]=\"secondFilter\"\n            [filterService]=\"filterService\"\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [activeView]=\"activeView\"\n            [bottomView]=\"bottomView\"\n            [topView]=\"topView\"\n            [format]=\"format\"\n            [formatPlaceholder]=\"formatPlaceholder\"\n            [placeholder]=\"placeholder\"\n            [min]=\"min\"\n            [max]=\"max\"\n            >\n        </kendo-grid-date-filter-menu-input>\n    "
            },] },
];
/** @nocollapse */
DateFilterMenuComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
DateFilterMenuComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell',] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'extra': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 184 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterMenuTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the filter-menu template.
 */
var FilterMenuTemplateDirective = (function () {
    function FilterMenuTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return FilterMenuTemplateDirective;
}());

FilterMenuTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridFilterMenuTemplate]'
            },] },
];
/** @nocollapse */
FilterMenuTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 185 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterMenuModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter_menu_component__ = __webpack_require__(586);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_menu_container_component__ = __webpack_require__(583);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filter_menu_input_wrapper_component__ = __webpack_require__(585);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__string_filter_menu_input_component__ = __webpack_require__(588);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__string_filter_menu_component__ = __webpack_require__(123);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__shared_filtering_module__ = __webpack_require__(337);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__filter_menu_template_directive__ = __webpack_require__(184);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__numeric_filter_menu_component__ = __webpack_require__(186);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__numeric_filter_menu_input_component__ = __webpack_require__(587);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__filter_menu_host_directive__ = __webpack_require__(584);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__date_filter_menu_input_component__ = __webpack_require__(581);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__date_filter_menu_component__ = __webpack_require__(183);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__boolean_filter_menu_component__ = __webpack_require__(182);














var INTERNAL_COMPONENTS = [
    __WEBPACK_IMPORTED_MODULE_1__filter_menu_component__["a" /* FilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_2__filter_menu_container_component__["a" /* FilterMenuContainerComponent */],
    __WEBPACK_IMPORTED_MODULE_3__filter_menu_input_wrapper_component__["a" /* FilterMenuInputWrapperComponent */],
    __WEBPACK_IMPORTED_MODULE_4__string_filter_menu_input_component__["a" /* StringFilterMenuInputComponent */],
    __WEBPACK_IMPORTED_MODULE_5__string_filter_menu_component__["a" /* StringFilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_7__filter_menu_template_directive__["a" /* FilterMenuTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_8__numeric_filter_menu_component__["a" /* NumericFilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_9__numeric_filter_menu_input_component__["a" /* NumericFilterMenuInputComponent */],
    __WEBPACK_IMPORTED_MODULE_11__date_filter_menu_input_component__["a" /* DateFilterMenuInputComponent */],
    __WEBPACK_IMPORTED_MODULE_12__date_filter_menu_component__["a" /* DateFilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_10__filter_menu_host_directive__["a" /* FilterMenuHostDirective */],
    __WEBPACK_IMPORTED_MODULE_13__boolean_filter_menu_component__["a" /* BooleanFilterMenuComponent */]
];
var ENTRY_COMPONENTS = [
    __WEBPACK_IMPORTED_MODULE_5__string_filter_menu_component__["a" /* StringFilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_8__numeric_filter_menu_component__["a" /* NumericFilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_12__date_filter_menu_component__["a" /* DateFilterMenuComponent */],
    __WEBPACK_IMPORTED_MODULE_13__boolean_filter_menu_component__["a" /* BooleanFilterMenuComponent */]
];
/**
 * @hidden
 */
var FilterMenuModule = (function () {
    function FilterMenuModule() {
    }
    FilterMenuModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_5__string_filter_menu_component__["a" /* StringFilterMenuComponent */],
            __WEBPACK_IMPORTED_MODULE_7__filter_menu_template_directive__["a" /* FilterMenuTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_8__numeric_filter_menu_component__["a" /* NumericFilterMenuComponent */],
            __WEBPACK_IMPORTED_MODULE_12__date_filter_menu_component__["a" /* DateFilterMenuComponent */],
            __WEBPACK_IMPORTED_MODULE_13__boolean_filter_menu_component__["a" /* BooleanFilterMenuComponent */],
            __WEBPACK_IMPORTED_MODULE_6__shared_filtering_module__["a" /* SharedFilterModule */].exports()
        ];
    };
    return FilterMenuModule;
}());

FilterMenuModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [INTERNAL_COMPONENTS],
                entryComponents: ENTRY_COMPONENTS,
                exports: [INTERNAL_COMPONENTS, __WEBPACK_IMPORTED_MODULE_6__shared_filtering_module__["a" /* SharedFilterModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_6__shared_filtering_module__["a" /* SharedFilterModule */]]
            },] },
];
/** @nocollapse */
FilterMenuModule.ctorParameters = function () { return []; };


/***/ }),
/* 186 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericFilterMenuComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__numeric_filter_component__ = __webpack_require__(320);





/**
 * Represents a numeric filter menu component.
 *
 * @example
 *  ```ts-no-run
 *      <kendo-grid-column field="UnitPrice" title="Unit Price">
 *          <ng-template kendoGridFilterMenuTemplate let-filter let-column="column" let-filterService="filterService">
 *          <kendo-grid-numeric-filter-menu
 *              [column]="column"
 *              [filter]="filter"
 *              [filterService]="filterService"
 *              >
 *          </kendo-grid-numeric-filter-menu>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var NumericFilterMenuComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](NumericFilterMenuComponent, _super);
    function NumericFilterMenuComponent(localization) {
        var _this = _super.call(this, null, localization) || this;
        _this.logicOperators = [
            { text: "And", value: "and" },
            { text: "Or", value: "or" }
        ];
        /**
         * The current menu filter.
         * @type {CompositeFilterDescriptor}
         */
        _this.filter = { filters: [], logic: "and" };
        /**
         * Determines if the second criterion inputs should be shown
         */
        _this.extra = true;
        return _this;
    }
    Object.defineProperty(NumericFilterMenuComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericFilterMenuComponent.prototype, "firstFilter", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter.filters) && this.filter.filters.length) {
                return this.filter.filters[0];
            }
            else {
                return this.insertDefaultFilter(0, {
                    field: (this.column || {}).field,
                    operator: this.currentOperator
                });
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericFilterMenuComponent.prototype, "secondFilter", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.filter.filters) && this.filter.filters.length > 1) {
                return this.filter.filters[1];
            }
            else {
                return this.insertDefaultFilter(1, {
                    field: (this.column || {}).field,
                    operator: this.currentOperator
                });
            }
        },
        enumerable: true,
        configurable: true
    });
    NumericFilterMenuComponent.prototype.logicChange = function (value) {
        this.filter.logic = value;
    };
    NumericFilterMenuComponent.prototype.insertDefaultFilter = function (index, filter) {
        this.filter = (this.filter || { filters: [], logic: "and" });
        this.filter.filters[index] = filter;
        return filter;
    };
    return NumericFilterMenuComponent;
}(__WEBPACK_IMPORTED_MODULE_4__numeric_filter_component__["a" /* NumericFilterComponent */]));

NumericFilterMenuComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-numeric-filter-menu',
                template: "\n        <kendo-grid-numeric-filter-menu-input\n            [currentFilter]=\"firstFilter\"\n            [operators]=\"operators\"\n            [filterService]=\"filterService\"\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [format]=\"format\"\n            [decimals]=\"decimals\"\n            [spinners]=\"spinners\"\n            [min]=\"min\"\n            [max]=\"max\"\n            [step]=\"step\"\n            >\n        </kendo-grid-numeric-filter-menu-input>\n        <kendo-dropdownlist\n            *ngIf=\"extra\"\n            class=\"k-filter-and\"\n            [data]=\"logicOperators\"\n            [valuePrimitive]=\"true\"\n            (valueChange)=\"logicChange($event)\"\n            [value]=\"filter?.logic\"\n            textField=\"text\"\n            valueField=\"value\">\n        </kendo-dropdownlist>\n        <kendo-grid-numeric-filter-menu-input\n            *ngIf=\"extra\"\n            [operators]=\"operators\"\n            [currentFilter]=\"secondFilter\"\n            [filterService]=\"filterService\"\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [format]=\"format\"\n            [decimals]=\"decimals\"\n            [spinners]=\"spinners\"\n            [min]=\"min\"\n            [max]=\"max\"\n            [step]=\"step\"\n            >\n        </kendo-grid-numeric-filter-menu-input>\n    "
            },] },
];
/** @nocollapse */
NumericFilterMenuComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
NumericFilterMenuComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell',] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'extra': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 187 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupConnectionService; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return GroupDragService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_from__ = __webpack_require__(240);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_from___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_from__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_timer__ = __webpack_require__(490);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_timer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_timer__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_delay__ = __webpack_require__(146);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_delay___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_delay__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_take__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_take___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_take__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_takeUntil__ = __webpack_require__(107);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_takeUntil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_takeUntil__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_switchMap__ = __webpack_require__(106);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_switchMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_switchMap__);









var getDocument = function (el) { return el.ownerDocument.documentElement; };
var getWindow = function (el) { return el.ownerDocument.defaultView; };
var hasClass = function (className) { return function (el) { return new RegExp("(^| )" + className + "( |$)").test(el.className); }; };
var isDeleteButton = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["i" /* or */])(hasClass("k-i-group-delete"), hasClass("k-button-icon"));
var isSortIcon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["i" /* or */])(hasClass("k-i-sort-asc-sm"), hasClass("k-i-sort-desc-sm"));
var skipButtons = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["j" /* and */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["k" /* not */])(isDeleteButton), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["k" /* not */])(isSortIcon));
var scrollPosition = function (element) {
    var documentElement = getDocument(element);
    var win = getWindow(element);
    return {
        x: win.pageXOffset || documentElement.scrollLeft || 0,
        y: win.pageYOffset || documentElement.scrollTop || 0
    };
};
var isOutside = function (target, _a) {
    var pageX = _a.pageX, pageY = _a.pageY;
    var _b = target.getBoundingClientRect(), right = _b.right, left = _b.left, top = _b.top, bottom = _b.bottom;
    var _c = scrollPosition(target), x = _c.x, y = _c.y;
    return !(pageX > left + x && pageX < right + x && pageY > top + y && pageY < bottom + y);
};
var preventDefault = function (e) { return e.originalEvent.preventDefault(); };
var createDropCue = function (container) {
    var cue = document.createElement("div");
    cue.className = "k-grouping-dropclue";
    cue.style.display = "none";
    container.appendChild(cue);
    return {
        hide: function () { return cue.style.display = "none"; },
        position: function (element, e, idx, isLast) {
            var left = element.offsetLeft - cue.offsetWidth;
            if (isLast && e.pageX > element.offsetLeft + element.offsetWidth / 2) {
                left = element.offsetLeft + element.offsetWidth;
                idx += 1;
            }
            cue.style.top = element.offsetTop + "px";
            cue.style.left = left + "px";
            cue.style.display = "";
            return idx;
        },
        remove: function () { return container.removeChild(cue); }
    };
};
/**
 * @hidden
 */
var GroupConnectionService = (function () {
    function GroupConnectionService() {
        this.change = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    GroupConnectionService.prototype.register = function (target) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["c" /* isUniversal */])() && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(target)) {
            this.target = target;
            this.cue = createDropCue(target);
        }
        return this.change.asObservable();
    };
    GroupConnectionService.prototype.isOutside = function (e) {
        return isOutside(this.target, e);
    };
    GroupConnectionService.prototype.showCue = function (e) {
        var item = this.items.filter(function (x) { return !isOutside(x, e); })[0];
        if (item) {
            var index = this.items.indexOf(item);
            this.currentIndex = this.cue.position(item, e, index, index === this.items.length - 1);
        }
        else {
            this.cue.hide();
            this.currentIndex = 0;
        }
    };
    GroupConnectionService.prototype.registerItems = function (items) {
        this.items = items;
    };
    GroupConnectionService.prototype.add = function (field, idx) {
        if (idx === void 0) { idx = this.currentIndex; }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNullOrEmptyString */])(field)) {
            this.change.emit({ field: field, idx: idx });
        }
    };
    GroupConnectionService.prototype.hideCue = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.cue)) {
            this.cue.hide();
        }
    };
    return GroupConnectionService;
}());

GroupConnectionService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
GroupConnectionService.ctorParameters = function () { return []; };
var append = function (element) {
    var appended = false;
    return function () {
        if (!appended) {
            document.body.appendChild(element);
            appended = true;
        }
        return element;
    };
};
var createHint = function (column) {
    var hint = document.createElement("div");
    hint.className = "k-header k-drag-clue";
    hint.style.cssText = "display:none;position:absolute;";
    hint.innerHTML = "" + (column.title || column.field);
    var getElement = append(hint);
    return {
        move: function (e) {
            preventDefault(e);
            var element = getElement();
            element.style.top = e.pageY + "px";
            element.style.left = e.pageX + "px";
            element.style.display = "";
            return function () { return document.body.removeChild(hint); };
        }
    };
};
/**
 * @hidden
 */
var GroupDragService = (function () {
    function GroupDragService(connection, ngzone) {
        this.connection = connection;
        this.ngzone = ngzone;
        this.subscriptions = [];
    }
    GroupDragService.prototype.connect = function (draggables, filter) {
        var _this = this;
        if (filter === void 0) { filter = function () { return true; }; }
        this.ngzone.runOutsideAngular(function () {
            _this.unsubscribe();
            _this.subscriptions = draggables.map(function (draggable) {
                var presses = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].from(draggable.kendo.press);
                var drags = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].from(draggable.kendo.drag);
                var releases = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].from(draggable.kendo.release);
                return presses
                    .filter(function (_a) {
                    var target = _a.originalEvent.target;
                    return skipButtons(target);
                })
                    .filter(filter)
                    .do(preventDefault)
                    .switchMap(function (x) { return __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].of(x).delay(150).takeUntil(releases.take(1)); })
                    .switchMap(function (_a) {
                    var column = _a.column;
                    return drags
                        .filter(filter)
                        .takeUntil(releases.take(1))
                        .do(function (e) { return _this.connection.showCue(e); })
                        .map(createHint(column).move);
                })
                    .switchMap(function (removeHint) { return releases.take(1).do(function () {
                    removeHint();
                    _this.connection.hideCue();
                }); })
                    .filter(function (e) { return !_this.connection.isOutside(e); })
                    .subscribe(function () { return _this.connection.add(draggable.column.field); });
            });
        });
    };
    GroupDragService.prototype.unsubscribe = function () {
        (this.subscriptions || []).forEach(function (x) { return x.unsubscribe(); });
        this.subscriptions = [];
    };
    return GroupDragService;
}());

GroupDragService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
GroupDragService.ctorParameters = function () { return [
    { type: GroupConnectionService, },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 188 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupFooterTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column group footer cell template of the Grid which helps to customize the group footer cell for the column.
 *
 * To define the group footer template, nest a `<ng-template>` tag with
 * the `kendoGridGroupFooterTemplate` directive inside `<kendo-grid-column>`.
 *
 * The template context is set to the current aggregates and the following additional fields are passed:
 * - `column`&mdash;Defines an instance of the `ColumnComponent` option.
 * - `field`&mdash;The current column field name.
 * - `group`&mdash;The current group data item.
 *
 * @example
 * ```ts-preview
 * import { process } from '@progress/kendo-data-query';
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *         <kendo-grid [data]="gridData" [group]="groups">
 *             <kendo-grid-column field="ProductName">
 *                 <ng-template kendoGridGroupFooterTemplate let-aggregates let-field="field">
 *                    Count: {{aggregates[field].count}}
 *                 </ng-template>
 *             </kendo-grid-column>
 *         </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public groups = [{ field: "ProductName", aggregates: [{ field: "ProductName", aggregate: "count" }] }];
 *
 *     public gridData = process([{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ], {
 *      group: this.groups
 *     });
 * }
 * ```
 */
var GroupFooterTemplateDirective = (function () {
    function GroupFooterTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return GroupFooterTemplateDirective;
}());

GroupFooterTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridGroupFooterTemplate]'
            },] },
];
/** @nocollapse */
GroupFooterTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 189 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupHeaderTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the group header cell template of the Grid which helps to customize the content of the group header item.
 *
 * To define the group header template, nest a `<ng-template>` tag with
 * the `kendoGridGroupHeaderTemplate` directive inside `<kendo-grid-column>`.
 *
 * The template context is set to the current data item and the following additional fields are passed:
 * - `group`&mdash;The current group item.
 * - `field`&mdash;The name of the field by which data is grouped.
 * - `value`&mdash;The current group value.
 * - `aggregates`&mdash;All aggregate values for the current group.
 *
 * @example
 * ```ts-preview
 * import { process } from '@progress/kendo-data-query';
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *         <kendo-grid [data]="gridData" [group]="groups">
 *             <kendo-grid-column field="ProductName">
 *                 <ng-template kendoGridGroupHeaderTemplate let-group let-field="field" let-value="value">
 *                    <strong>{{field}}</strong>: {{value}}
 *                 </ng-template>
 *             </kendo-grid-column>
 *         </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public groups = [{ field: "ProductName" }];
 *
 *     public gridData = process([{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ], {
 *      group: this.groups
 *     });
 * }
 *
 * ```
 */
var GroupHeaderTemplateDirective = (function () {
    function GroupHeaderTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return GroupHeaderTemplateDirective;
}());

GroupHeaderTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridGroupHeaderTemplate]'
            },] },
];
/** @nocollapse */
GroupHeaderTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 190 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupInfoService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__columns_column_component__ = __webpack_require__(49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__columns_column_list__ = __webpack_require__(299);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_column_common__ = __webpack_require__(27);



/**
 * @hidden
 */
var GroupInfoService = (function () {
    function GroupInfoService() {
        this._columnList = __WEBPACK_IMPORTED_MODULE_1__columns_column_list__["a" /* ColumnList */].empty;
    }
    Object.defineProperty(GroupInfoService.prototype, "columns", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__columns_column_common__["a" /* expandColumns */])(this._columnList().toArray()).filter(__WEBPACK_IMPORTED_MODULE_0__columns_column_component__["a" /* isColumnComponent */]);
        },
        enumerable: true,
        configurable: true
    });
    GroupInfoService.prototype.registerColumnsContainer = function (columns) {
        this._columnList = columns;
    };
    GroupInfoService.prototype.formatForGroup = function (item) {
        var column = this.columnForGroup(item);
        return column ? column.format : "";
    };
    GroupInfoService.prototype.groupTitle = function (item) {
        var column = this.columnForGroup(item);
        return column ? (column.title || column.field) : this.groupField(item);
    };
    GroupInfoService.prototype.groupHeaderTemplate = function (item) {
        var column = this.columnForGroup(item);
        return column ? column.groupHeaderTemplateRef : undefined;
    };
    GroupInfoService.prototype.groupField = function (group) {
        return group.data ? group.data.field : group.field;
    };
    GroupInfoService.prototype.columnForGroup = function (group) {
        var field = this.groupField(group);
        var column = this.columns.filter(function (x) { return x.field === field; })[0];
        return column;
    };
    return GroupInfoService;
}());



/***/ }),
/* 191 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResizeService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_throttleTime__ = __webpack_require__(245);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_throttleTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_throttleTime__);




/**
 * @hidden
 */
var ResizeService = (function () {
    function ResizeService() {
        this.resizeSubscription = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__["Subscription"](function () { });
        this.dispatcher = new __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__["Subject"]();
        // tslint:disable-next-line:member-ordering
        this.changes = this.dispatcher.asObservable().throttleTime(100);
    }
    ResizeService.prototype.connect = function (resizes) {
        this.resizeSubscription.add(resizes.subscribe(this.dispatcher));
    };
    ResizeService.prototype.destroy = function () {
        if (this.resizeSubscription) {
            this.resizeSubscription.unsubscribe();
        }
    };
    return ResizeService;
}());

ResizeService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ResizeService.ctorParameters = function () { return []; };


/***/ }),
/* 192 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFMarginComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_pdf_export__ = __webpack_require__(205);



var PDFMarginComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PDFMarginComponent, _super);
    function PDFMarginComponent() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return PDFMarginComponent;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_pdf_export__["a" /* PDFMarginComponent */]));

PDFMarginComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-pdf-margin',
                template: ''
            },] },
];
/** @nocollapse */
PDFMarginComponent.ctorParameters = function () { return []; };


/***/ }),
/* 193 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var PDFService = (function () {
    function PDFService() {
        this.savePDF = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.exportClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.dataChanged = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    PDFService.prototype.save = function (component) {
        if (this.savePDF.observers.length === 0) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
                throw new Error('Saving pdf requires including the PDFModule and adding the <kendo-grid-pdf> component.');
            }
        }
        else {
            this.savePDF.emit(component);
        }
    };
    return PDFService;
}());

PDFService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
PDFService.ctorParameters = function () { return []; };


/***/ }),
/* 194 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return hasClasses; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return matchesClasses; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return matchesNodeName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return closest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return closestInScope; });
/* unused harmony export isVisible */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isFocusable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return findElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return findFocusable; });
var focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
var NODE_NAME_PREDICATES = {};
var toClassList = function (classNames) { return String(classNames).trim().split(' '); };
/**
 * @hidden
 */
var hasClasses = function (element, classNames) {
    var namesList = toClassList(classNames);
    return Boolean(toClassList(element.className).find(function (className) { return namesList.indexOf(className) >= 0; }));
};
/**
 * @hidden
 */
var matchesClasses = function (classNames) {
    return function (element) { return hasClasses(element, classNames); };
};
/**
 * @hidden
 */
var matchesNodeName = function (nodeName) {
    if (!NODE_NAME_PREDICATES[nodeName]) {
        NODE_NAME_PREDICATES[nodeName] = function (element) {
            return String(element.nodeName).toLowerCase() === nodeName.toLowerCase();
        };
    }
    return NODE_NAME_PREDICATES[nodeName];
};
/**
 * @hidden
 */
var closest = function (node, predicate) {
    while (node && !predicate(node)) {
        node = node.parentNode;
    }
    return node;
};
/**
 * @hidden
 */
var closestInScope = function (node, predicate, scope) {
    while (node && node !== scope && !predicate(node)) {
        node = node.parentNode;
    }
    if (node !== scope) {
        return node;
    }
};
/**
 * @hidden
 */
var isVisible = function (element) {
    var rect = element.getBoundingClientRect();
    return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
};
/**
 * @hidden
 */
var isFocusable = function (element, checkVisibility) {
    if (checkVisibility === void 0) { checkVisibility = true; }
    if (element.tagName) {
        var tagName = element.tagName.toLowerCase();
        var tabIndex = element.getAttribute('tabIndex');
        var validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
        var focusable = false;
        if (focusableRegex.test(tagName)) {
            focusable = !element.disabled;
        }
        else {
            focusable = validTabIndex;
        }
        return focusable && (!checkVisibility || isVisible(element));
    }
    return false;
};
/**
 * @hidden
 */
var findElement = function (node, predicate) {
    if (!node) {
        return;
    }
    if (predicate(node)) {
        return node;
    }
    node = node.firstChild;
    while (node) {
        if (node.nodeType === 1) {
            var element = findElement(node, predicate);
            if (element) {
                return element;
            }
        }
        node = node.nextSibling;
    }
};
/**
 * @hidden
 */
var findFocusable = function (element) {
    return findElement(element, isFocusable);
};


/***/ }),
/* 195 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DetailTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the detail template of the Grid.
 * Provides additional details about a particular data row by expanding or collapsing its content.
 * The detail template does not work with locked columns and requires you to set the `detailRowHeight` option for virtual scrolling.
 *
 * To define the detail template, nest an `<ng-template>` tag with the `kendoGridDetailTemplate` directive inside a `<kendo-grid>` tag.
 * The template context is set to the current data item and the following additional fields are passed:
 * - `dataItem`&mdash;Defines the current data item.
 * - `rowIndex`&mdash;Defines the current row index.
 *
 * &nbsp;
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *   selector: 'my-app',
 *   template: `
 *       <kendo-grid
 *         [data]="data"
 *         selectable="true"
 *         style="height: 160px"
 *         >
 *         <kendo-grid-column field="ProductID"></kendo-grid-column>
 *         <kendo-grid-column field="ProductName"></kendo-grid-column>
 *         <kendo-grid-column field="UnitPrice"></kendo-grid-column>
 *         <ng-template kendoGridDetailTemplate let-dataItem>
 *           <div *ngIf="dataItem.Category">
 *             <header>{{dataItem.Category?.CategoryName}}</header>
 *             <span>{{dataItem.Category?.Description}}</span>
 *           </div>
 *         </ng-template>
 *       </kendo-grid>
 *   `
 * })
 *
 * class AppComponent {
 *     public data = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false,
 *         "Category": {
 *             "CategoryID": 1,
 *             "CategoryName": "Beverages",
 *             "Description": "Soft drinks, coffees, teas, beers, and ales"
 *         }
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": false,
 *         "Category": {
 *             "CategoryID": 1,
 *             "CategoryName": "Beverages",
 *             "Description": "Soft drinks, coffees, teas, beers, and ales"
 *         }
 *       }, {
 *         "ProductID": 3,
 *         "ProductName": "Aniseed Syrup",
 *         "UnitPrice": 10.0000,
 *         "Discontinued": false,
 *         "Category": {
 *             "CategoryID": 2,
 *             "CategoryName": "Condiments",
 *             "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"
 *         }
 *     }];
 *
 * }
 *
 * ```
 *
 * &nbsp;
 *
 * To indicate if a detail row should be displayed, specify the
 * [`DetailTemplateShowIfFn`]({% slug api_grid_detailtemplateshowiffn %}) setting.
 *
 * ```ts-no-run
 *    <div *kendoGridDetailTemplate="let dataItem, let rowIndex = rowIndex; showIf: myCondition">
 *       <category-details [category]="dataItem"></category-details>
 *    </div>
 * ```
 *
 * The following example demonstrates how to use `DetailTemplateShowIfFn` with the `<ng-template>` element.
 *
 * ```ts-no-run
 *    <ng-template kendoGridDetailTemplate let-dataItem let-rowIndex="rowIndex"
 *       [kendoGridDetailTemplateShowIf]="myCondition">
 *        <category-details [category]="dataItem"></category-details>
 *    </ng-template>
 * ```
 * &nbsp;
 *
 * @example
 * ```ts
 *
 * _@Component({
 *   selector: 'my-app',
 *   template: `
 *       <kendo-grid
 *         [data]="data"
 *         selectable="true"
 *         style="height: 160px"
 *         >
 *         <kendo-grid-column field="ProductID"></kendo-grid-column>
 *         <kendo-grid-column field="ProductName"></kendo-grid-column>
 *         <kendo-grid-column field="UnitPrice"></kendo-grid-column>
 *         <ng-template kendoGridDetailTemplate let-dataItem
 *              [kendoGridDetailTemplateShowIf]="showOnlyBeveragesDetails">
 *           <div *ngIf="dataItem.Category">
 *             <header>{{dataItem.Category?.CategoryName}}</header>
 *             <span>{{dataItem.Category?.Description}}</span>
 *           </div>
 *         </ng-template>
 *       </kendo-grid>
 *   `
 * })
 * class AppComponent {
 *     public data = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false,
 *         "Category": {
 *             "CategoryID": 1,
 *             "CategoryName": "Beverages",
 *             "Description": "Soft drinks, coffees, teas, beers, and ales"
 *         }
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": false,
 *         "Category": {
 *             "CategoryID": 1,
 *             "CategoryName": "Beverages",
 *             "Description": "Soft drinks, coffees, teas, beers, and ales"
 *         }
 *       }, {
 *         "ProductID": 3,
 *         "ProductName": "Aniseed Syrup",
 *         "UnitPrice": 10.0000,
 *         "Discontinued": false,
 *         "Category": {
 *             "CategoryID": 2,
 *             "CategoryName": "Condiments",
 *             "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"
 *         }
 *     }];
 *
 *     public showOnlyBeveragesDetails(dataItem: any, index: number): boolean {
 *        return dataItem.Category.CategoryID === 1;
 *     }
 * }
 *
 * ```
 *
 */
var DetailTemplateDirective = (function () {
    function DetailTemplateDirective(templateRef) {
        this.templateRef = templateRef;
        this._condition = function () { return true; };
    }
    Object.defineProperty(DetailTemplateDirective.prototype, "showIf", {
        get: function () {
            return this._condition;
        },
        /**
         * Defines the function that indicates if a given detail row and the associated **Expand** or **Collapse** button will be shown.
         */
        set: function (fn) {
            if (typeof fn !== 'function') {
                throw new Error("showIf must be a function, but received " + JSON.stringify(fn) + ".");
            }
            this._condition = fn;
        },
        enumerable: true,
        configurable: true
    });
    return DetailTemplateDirective;
}());

DetailTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridDetailTemplate]'
            },] },
];
/** @nocollapse */
DetailTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };
DetailTemplateDirective.propDecorators = {
    'showIf': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["kendoGridDetailTemplateShowIf",] },],
};


/***/ }),
/* 196 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DetailsService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_expand_state_service__ = __webpack_require__(302);



/**
 * @hidden
 */
var DetailsService = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DetailsService, _super);
    function DetailsService() {
        return _super.call(this, true) || this;
    }
    return DetailsService;
}(__WEBPACK_IMPORTED_MODULE_2__common_expand_state_service__["a" /* ExpandStateService */]));

DetailsService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Injectable"] },
];
/** @nocollapse */
DetailsService.ctorParameters = function () { return []; };


/***/ }),
/* 197 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FooterTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column footer cell template of the Grid.
 * It helps to customize the table footer cell for the column.
 *
 * To define the footer template, nest a `<ng-template>` tag with the `kendoGridFooterTemplate` directive
 * inside a `<kendo-grid-column>` tag.
 *
 * The template context is set to the current column and the following additional fields are passed:
 * - `column`&mdash;Defines an instance of the `ColumnComponent` option.
 * - `columnIndex`&mdash;Defines the current column index.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *         <kendo-grid [data]="gridData" [scrollable]="'none'">
 *             <kendo-grid-column field="ProductName">
 *                 <ng-template kendoGridFooterTemplate let-column let-columnIndex="columnIndex">
 *                   {{column.field}}({{columnIndex}})
 *                 </ng-template>
 *             </kendo-grid-column>
 *              <kendo-grid-column field="UnitPrice">
 *                 <ng-template kendoGridFooterTemplate let-column let-columnIndex="columnIndex">
 *                   {{column.field}}({{columnIndex}})
 *                 </ng-template>
 *             </kendo-grid-column>
 *         </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public gridData = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ];
 * }
 *
 * ```
 */
var FooterTemplateDirective = (function () {
    function FooterTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return FooterTemplateDirective;
}());

FooterTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridFooterTemplate]'
            },] },
];
/** @nocollapse */
FooterTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 198 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HeaderTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the column header cell template of the Grid.
 * It helps to customize the table header cell for the column.
 *
 * To define a header template, nest a `<ng-template>` tag with the `kendoGridHeaderTemplate` directive inside `<kendo-grid-column>`.
 * The template context is set to the current column and the following additional fields are passed:
 * - `column`&mdash;Defines an instance of the `ColumnComponent` option.
 * - `columnIndex`&mdash;Defines the current column index.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *         <kendo-grid [data]="gridData">
 *             <kendo-grid-column field="ProductName">
 *                 <ng-template kendoGridHeaderTemplate let-column let-columnIndex="columnIndex">
 *                   {{column.field}}({{columnIndex}})
 *                 </ng-template>
 *             </kendo-grid-column>
 *              <kendo-grid-column field="UnitPrice">
 *                 <ng-template kendoGridHeaderTemplate let-column let-columnIndex="columnIndex">
 *                   {{column.field}}({{columnIndex}})
 *                 </ng-template>
 *             </kendo-grid-column>
 *         </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public gridData = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ];
 * }
 *
 * ```
 */
var HeaderTemplateDirective = (function () {
    function HeaderTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return HeaderTemplateDirective;
}());

HeaderTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridHeaderTemplate]'
            },] },
];
/** @nocollapse */
HeaderTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 199 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NoRecordsTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the no-records template of the Grid.
 * Provides a way to customize the appearance of the item that is displayed when no data is present.
 *
 * To define the no-record template, nest a `<ng-template>` tag with the `kendoGridNoRecordsTemplate` directive inside `<kendo-grid>`.
 *
 * > When the locked columns of the Grid are in use, the template is displayed in the non-locked part of the content.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *   selector: 'my-app',
 *   template: `
 *       <kendo-grid [data]="data">
 *         <kendo-grid-column field="ProductID"></kendo-grid-column>
 *         <kendo-grid-column field="ProductName"></kendo-grid-column>
 *         <kendo-grid-column field="UnitPrice"></kendo-grid-column>
 *         <ng-template kendoGridNoRecordsTemplate>
 *            There are not products. <a href="#" (click)="refresh()">Click here to refresh</a>.
 *         </ng-template>
 *       </kendo-grid>
 *   `
 * })
 *
 * class AppComponent {
 *     public data = [];
 *     public refresh() {
 *       this.data = [{
 *            "ProductID": 1,
 *            "ProductName": "Chai",
 *            "UnitPrice": 18.0000,
 *            "Discontinued": false,
 *            "Category": {
 *                "CategoryID": 1,
 *                "CategoryName": "Beverages",
 *                "Description": "Soft drinks, coffees, teas, beers, and ales"
 *            }
 *          }, {
 *            "ProductID": 2,
 *            "ProductName": "Chang",
 *            "UnitPrice": 19.0000,
 *            "Discontinued": false,
 *            "Category": {
 *                "CategoryID": 1,
 *                "CategoryName": "Beverages",
 *                "Description": "Soft drinks, coffees, teas, beers, and ales"
 *            }
 *          }, {
 *            "ProductID": 3,
 *            "ProductName": "Aniseed Syrup",
 *            "UnitPrice": 10.0000,
 *            "Discontinued": false,
 *            "Category": {
 *                "CategoryID": 2,
 *                "CategoryName": "Condiments",
 *                "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"
 *            }
 *        }];
 *
 *     }
 * }
 *
 * ```
 */
var NoRecordsTemplateDirective = (function () {
    function NoRecordsTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return NoRecordsTemplateDirective;
}());

NoRecordsTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridNoRecordsTemplate]'
            },] },
];
/** @nocollapse */
NoRecordsTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 200 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the toolbar template of the Grid.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *       <div class="example-config">
 *         <input type="radio" id="top" name="position" class="k-radio" value="top" checked (click)="positionChange($event)"/>
 *         <label class="k-radio-label" for="top">Top</label><br/>
 *         <input type="radio" id="bottom" name="position" class="k-radio" value="bottom" (click)="positionChange($event)"/>
 *         <label class="k-radio-label" for="bottom">Bottom</label><br/>
 *         <input type="radio" id="both" name="position" value="both" class="k-radio" (click)="positionChange($event)"/>
 *         <label class="k-radio-label" for="both">Both</label><br/>
 *       </div>
 *       <kendo-grid [data]="gridData" style="height: 200px">
 *            <ng-template kendoGridToolbarTemplate [position]="position">
 *                <button (click)="onClick()" class="k-button">Custom action</button>
 *            </ng-template>
 *            <kendo-grid-column field="ProductName">
 *            </kendo-grid-column>
 *            <kendo-grid-column field="UnitPrice">
 *            </kendo-grid-column>
 *        </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public position: 'top' | 'bottom' | 'both' = 'top';
 *
 *     public gridData = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ];
 *
 *     public onClick(): void {
 *         console.log("button was clicked");
 *     }
 *
 *     public positionChange({ target }): void {
 *        this.position = target.value;
 *     }
 * }
 *
 * ```
 */
var ToolbarTemplateDirective = (function () {
    function ToolbarTemplateDirective(templateRef) {
        this.templateRef = templateRef;
        this._position = "top";
    }
    Object.defineProperty(ToolbarTemplateDirective.prototype, "position", {
        get: function () {
            return this._position;
        },
        /**
         * The position of the toolbar.
         * The possible values are:
         * - `top`&mdash;Positions the toolbar above the group panel or header.
         * - `bottom`&mdash;Positions the toolbar below the pager.
         * - `both`&mdash;Displays two toolbar instances. Positions the first one above
         * the group panel or header and the second one below the pager.
         */
        set: function (position) {
            this._position = position;
        },
        enumerable: true,
        configurable: true
    });
    return ToolbarTemplateDirective;
}());

ToolbarTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridToolbarTemplate]'
            },] },
];
/** @nocollapse */
ToolbarTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };
ToolbarTemplateDirective.propDecorators = {
    'position': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["position",] },],
};


/***/ }),
/* 201 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SuspendService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var SuspendService = (function () {
    function SuspendService() {
        this.scroll = false;
    }
    return SuspendService;
}());

SuspendService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
SuspendService.ctorParameters = function () { return []; };


/***/ }),
/* 202 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isChanged; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return anyChanged; });
/**
 * @hidden
 */
/**
 * @hidden
 */ var isChanged = function (propertyName, changes, skipFirstChange) {
    if (skipFirstChange === void 0) { skipFirstChange = true; }
    return (changes[propertyName] && (!changes[propertyName].isFirstChange() || !skipFirstChange) &&
        changes[propertyName].previousValue !== changes[propertyName].currentValue);
};
/**
 * @hidden
 */
var anyChanged = function (propertyNames, changes, skipFirstChange) {
    if (skipFirstChange === void 0) { skipFirstChange = true; }
    return propertyNames.some(function (name) { return isChanged(name, changes, skipFirstChange); });
};


/***/ }),
/* 203 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Keys; });
/**
 * @hidden
 */
var Keys;
(function (Keys) {
    Keys[Keys["backspace"] = 8] = "backspace";
    Keys[Keys["tab"] = 9] = "tab";
    Keys[Keys["enter"] = 13] = "enter";
    Keys[Keys["shift"] = 16] = "shift";
    Keys[Keys["ctrl"] = 17] = "ctrl";
    Keys[Keys["alt"] = 18] = "alt";
    Keys[Keys["space"] = 32] = "space";
    Keys[Keys["page up"] = 33] = "page up";
    Keys[Keys["page down"] = 34] = "page down";
    Keys[Keys["end"] = 35] = "end";
    Keys[Keys["home"] = 36] = "home";
    Keys[Keys["left"] = 37] = "left";
    Keys[Keys["up"] = 38] = "up";
    Keys[Keys["right"] = 39] = "right";
    Keys[Keys["down"] = 40] = "down";
    Keys[Keys["delete"] = 46] = "delete";
    Keys[Keys["numpad_dot"] = 110] = "numpad_dot";
})(Keys || (Keys = {}));


/***/ }),
/* 204 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TextBoxDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the Kendo UI TextBox directive for the Inputs components for Angular.
 * Used to style the textbox of any `input` element.
 *
 * @example
 * ```ts-no-run
 * <input kendoTextBox />
 * <input kendoTextBox type="email" />
 * <input kendoTextBox type="password" />
 * ```
 */
var TextBoxDirective = (function () {
    function TextBoxDirective(renderer, inputElement) {
        this.renderer = renderer;
        this.inputElement = inputElement;
        /**
         * Fires each time the user focuses the `input` element.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the `input` element gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        this.listeners = [];
    }
    Object.defineProperty(TextBoxDirective.prototype, "hostClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TextBoxDirective.prototype, "value", {
        /**
         * Gets the value of the `input` element.
         */
        get: function () {
            return this.inputElement.nativeElement.value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TextBoxDirective.prototype, "id", {
        get: function () {
            return this.inputElement.nativeElement.id;
        },
        set: function (id) {
            this.renderer.setAttribute(this.inputElement.nativeElement, 'id', id);
        },
        enumerable: true,
        configurable: true
    });
    TextBoxDirective.prototype.ngAfterViewInit = function () {
        var _this = this;
        var input = this.inputElement.nativeElement;
        this.listeners = [
            this.renderer.listen(input, 'focus', function () { return _this.onFocus.emit(); }),
            this.renderer.listen(input, 'blur', function () { return _this.onBlur.emit(); })
        ];
    };
    TextBoxDirective.prototype.ngOnDestroy = function () {
        this.listeners.forEach(function (listener) { return listener(); });
    };
    return TextBoxDirective;
}());

TextBoxDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: 'input[kendoTextBox]'
            },] },
];
/** @nocollapse */
TextBoxDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
]; };
TextBoxDirective.propDecorators = {
    'hostClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-textbox',] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
};


/***/ }),
/* 205 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__pdf_export_component__ = __webpack_require__(398);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__pdf_export_component__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pdf_export_module__ = __webpack_require__(626);
/* unused harmony reexport PDFExportModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__ = __webpack_require__(206);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pdf_template_directive__ = __webpack_require__(207);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_3__pdf_template_directive__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compile_template__ = __webpack_require__(397);
/* unused harmony reexport compileTemplate */







/***/ }),
/* 206 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFMarginComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

var FIELDS = ['bottom', 'left', 'right', 'top'];
var PDFMarginComponent = (function () {
    function PDFMarginComponent() {
    }
    Object.defineProperty(PDFMarginComponent.prototype, "options", {
        /**
         * @hidden
         */
        get: function () {
            var options = {};
            for (var idx = 0; idx < FIELDS.length; idx++) {
                var field = FIELDS[idx];
                var value = this[field];
                if (typeof value !== 'undefined') {
                    options[field] = value;
                }
            }
            return options;
        },
        enumerable: true,
        configurable: true
    });
    return PDFMarginComponent;
}());

PDFMarginComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-pdf-export-margin',
                template: ""
            },] },
];
/** @nocollapse */
PDFMarginComponent.ctorParameters = function () { return []; };
PDFMarginComponent.propDecorators = {
    'left': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'top': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'right': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'bottom': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 207 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

var PDFTemplateDirective = (function () {
    function PDFTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return PDFTemplateDirective;
}());

PDFTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoPDFTemplate]'
            },] },
];
/** @nocollapse */
PDFTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 208 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopupComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_align_service__ = __webpack_require__(628);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_dom_service__ = __webpack_require__(92);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_position_service__ = __webpack_require__(629);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_resize_service__ = __webpack_require__(630);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_scrollable_service__ = __webpack_require__(631);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(71);







var DEFAULT_OFFSET = { left: -10000, top: 0 };
var ANIMATION_CONTAINER = 'k-animation-container';
var ANIMATION_CONTAINER_FIXED = 'k-animation-container-fixed';
/**
 * Represents the Kendo UI Popup component for Angular.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <button #anchor (click)="show=!show">Toggle</button>
 *  <kendo-popup *ngIf="show" [anchor]="anchor">
 *      <strong>Popup content!</strong>
 *  </kendo-popup>
 * `
 * })
 * class AppComponent {
 *   public show: boolean = false;
 * }
 * ```
 */
var PopupComponent = (function () {
    function PopupComponent(container, _alignService, _domService, _cdr, _positionService, _resizeService, _scrollableService, _renderer, _zone) {
        this.container = container;
        this._alignService = _alignService;
        this._domService = _domService;
        this._cdr = _cdr;
        this._positionService = _positionService;
        this._resizeService = _resizeService;
        this._scrollableService = _scrollableService;
        this._renderer = _renderer;
        this._zone = _zone;
        /**
         * Controls the Popup animation. By default, the opening and closing animations are enabled.
         *
         * For more information about how to enable and disable them,
         * refer to the section on [Popup animations]({% slug overview_popup %}#toc-animations).
         */
        this.animate = true;
        /**
         * Specifies the anchor pivot point.
         *
         * For more information, refer to the section on
         * [positioning]({% slug overview_popup %}#toc-position).
         */
        this.anchorAlign = { horizontal: 'left', vertical: 'bottom' };
        /**
         * Configures the collision behavior of the Popup.
         *
         * For more information, refer to the section on
         * [viewport boundary detection]({% slug overview_popup %}#toc-viewport-boundary-detection).
         */
        this.collision = { horizontal: 'fit', vertical: 'flip' };
        /**
         * Specifies the pivot point of the Popup.
         *
         * For more information, refer to the section on
         * [positioning]({% slug overview_popup %}#toc-position).
         */
        this.popupAlign = { horizontal: 'left', vertical: 'top' };
        /**
         * Controls whether the component should copy anchor styles.
         */
        this.copyAnchorStyles = false;
        /**
         * Specifies the position mode of the component. By default the Popup uses *fixed* mode.
         * Set the option to `absolute` to use an *absolute* positioning.
         *
         * > Use the 'absolute' positioning if mobile browsers with zoom support is targeted.
         *
         * @example
         * ```html
         * <style>
         *  .parent-content {
         *     position: relative;
         *     width: 200px;
         *     height: 200px;
         *     overflow: auto;
         *     margin: 200px auto;
         *     border: 1px solid red;
         *  }
         *  .content {
         *     position: relative;
         *     width: 100px;
         *     height: 100px;
         *     overflow: auto;
         *     margin: 300px;
         *     border: 1px solid blue;
         *  }
         *  .anchor {
         *     position: absolute;
         *     top: 200px;
         *     left: 200px;
         *  }
         * </style>
         * ```
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *   <div class="example-config">
         *      Position mode:
         *      <label><input type="radio" value="fixed" [(ngModel)]="mode" /> Fixed</label>
         *      <label><input type="radio" value="absolute" [(ngModel)]="mode" /> Absolute</label>
         *   </div>
         *   <div class="example-config">
         *       Append to
         *       <label>
         *           <input type="radio" name="place" [value]="1" [(ngModel)]="checked" />
         *           Root component
         *       </label>
         *       <label>
         *           <input type="radio" name="place" [value]="2" [(ngModel)]="checked" />
         *           <span style="color: red">Red Container</span>
         *       </label>
         *       <label>
         *           <input type="radio" name="place" [value]="3" [(ngModel)]="checked" />
         *           <span style="color: blue">Blue Container</span>
         *       </label>
         *   </div>
         *   <div class="example">
         *     <div class="parent-content" [scrollLeft]="250" [scrollTop]="230">
         *         <div class="content" [scrollLeft]="170" [scrollTop]="165">
         *           <button #anchor class="anchor" (click)="show = !show">Toggle</button>
         *           <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 3">
         *             <ul>
         *                 <li>Item1</li>
         *                 <li>Item2</li>
         *                 <li>Item3</li>
         *             </ul>
         *           </kendo-popup>
         *           <span style="position: absolute; top: 400px; left: 400px">Bottom/Right</span>
         *         </div>
         *         <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 2">
         *           <ul>
         *               <li>Item1</li>
         *               <li>Item2</li>
         *               <li>Item3</li>
         *           </ul>
         *         </kendo-popup>
         *         <span style="position: absolute; top: 600px; left: 600px">Bottom/Right</span>
         *     </div>
         *     <kendo-popup [positionMode]="mode" [anchor]="anchor" (anchorViewportLeave)="show=false" *ngIf="show && checked === 1">
         *       <ul>
         *           <li>Item1</li>
         *           <li>Item2</li>
         *           <li>Item3</li>
         *       </ul>
         *     </kendo-popup>
         *   </div>
         * `
         * })
         * class AppComponent {
         *   public checked: number = 3;
         *   public mode: string = 'absolute';
         *   public show: boolean = true;
         * }
         * ```
         */
        this.positionMode = 'fixed';
        /**
         * Specifies the absolute position of the element. The Popup opens next to that point.
         *
         * The Popup pivot point is defined by the `popupAlign` configuration option.
         * The boundary detection is applied by using the window viewport.
         *
         * For more information, refer to the section on
         * [aligning to specific absolute points]({% slug overview_popup %}#toc-align-to-absolute-points).
         */
        this.offset = DEFAULT_OFFSET;
        /**
         * Fires when the anchor is scrolled outside the screen boundaries.
         *
         * For more information, refer to the section on
         * [closing the Popup after leaving the viewport]({% slug overview_popup %}#toc-closing-after-leaving-the-viewport).
         */
        this.anchorViewportLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires after the component is closed.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires after the component is opened and the opening animation ends.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * @hidden
         */
        this.direction = 'down';
        this._renderer.addClass(container.nativeElement, ANIMATION_CONTAINER);
        this.updateFixedClass();
    }
    PopupComponent.prototype.ngOnInit = function () {
        var repositionCallback = this.reposition.bind(this);
        this._resizeService.subscribe(repositionCallback);
        this._scrollableService.forElement(this.anchor || this.container).subscribe(this.onScroll.bind(this));
        this.currentOffset = DEFAULT_OFFSET;
        this.setZIndex();
        this.copyFontStyles();
        this.updateFixedClass();
    };
    PopupComponent.prototype.ngOnChanges = function (changes) {
        if (changes.copyAnchorStyles) {
            this.copyFontStyles();
        }
        if (changes.positionMode) {
            this.updateFixedClass();
        }
    };
    PopupComponent.prototype.ngAfterViewChecked = function () {
        this.reposition();
    };
    PopupComponent.prototype.ngOnDestroy = function () {
        this.anchorViewportLeave.complete();
        this.close.emit();
        this.close.complete();
        this._resizeService.unsubscribe();
        this._scrollableService.unsubscribe();
    };
    /**
     * @hidden
     */
    PopupComponent.prototype.triggerOpen = function (_event) {
        this._renderer.addClass(this.container.nativeElement, 'k-animation-container-shown');
        this.open.emit();
        this.open.complete();
    };
    Object.defineProperty(PopupComponent.prototype, "currentOffset", {
        get: function () {
            return this._currentOffset;
        },
        set: function (offset) {
            if (!this._currentOffset || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["a" /* isDifferentOffset */])(this._currentOffset, offset)) {
                this.setContainerStyle('left', offset.left + "px");
                this.setContainerStyle('top', offset.top + "px");
                this._currentOffset = offset;
            }
        },
        enumerable: true,
        configurable: true
    });
    PopupComponent.prototype.setZIndex = function () {
        if (this.anchor) {
            this.setContainerStyle('z-index', String(this._domService.zIndex(this.anchor, this.container)));
        }
    };
    PopupComponent.prototype.reposition = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["b" /* isDocumentAvailable */])()) {
            return;
        }
        var _a = this.position(), flipped = _a.flipped, offset = _a.offset;
        var newDirection = this.getDirection(flipped);
        this.currentOffset = offset;
        if (this.direction !== newDirection) {
            this.direction = newDirection;
            this._cdr.detectChanges();
        }
    };
    PopupComponent.prototype.position = function () {
        var alignedOffset = this._alignService.alignElement({
            anchor: this.anchor,
            anchorAlign: this.anchorAlign,
            element: this.container,
            elementAlign: this.popupAlign,
            offset: this.offset,
            positionMode: this.positionMode
        });
        return this._positionService.positionElement({
            anchor: this.anchor,
            anchorAlign: this.anchorAlign,
            collisions: this.collision,
            currentLocation: alignedOffset,
            element: this.container,
            elementAlign: this.popupAlign,
            positionMode: this.positionMode
        });
    };
    PopupComponent.prototype.getDirection = function (flipped) {
        return this.animate ? (flipped ? 'up' : 'down') : 'none';
    };
    PopupComponent.prototype.onScroll = function (isInViewPort) {
        var _this = this;
        var hasObservers = this.anchorViewportLeave.observers.length;
        if (isInViewPort || !hasObservers) {
            this.reposition();
        }
        else if (hasObservers) {
            this._zone.run(function () {
                _this.anchorViewportLeave.emit();
            });
        }
    };
    PopupComponent.prototype.copyFontStyles = function () {
        var _this = this;
        if (!this.anchor || !this.copyAnchorStyles) {
            return;
        }
        this._domService.getFontStyles(this.anchor)
            .forEach(function (s) { return _this.setContainerStyle(s.key, s.value); });
    };
    PopupComponent.prototype.updateFixedClass = function () {
        var action = this.positionMode === 'fixed' ? 'addClass' : 'removeClass';
        this._renderer[action](this.container.nativeElement, ANIMATION_CONTAINER_FIXED);
    };
    PopupComponent.prototype.setContainerStyle = function (name, value) {
        this._renderer.setStyle(this.container.nativeElement, name, value);
    };
    return PopupComponent;
}());

PopupComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                animations: [
                    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["trigger"])('toggle', [
                        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["transition"])('void => down, up => down', [
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(-100%)' }),
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["animate"])('0.1s ease-in', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(0)' }))
                        ]),
                        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["transition"])('down => void', [
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(0)' }),
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["animate"])('0.1s ease-in', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(-100%)' }))
                        ]),
                        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["transition"])('void => up, down => up', [
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(100%)' }),
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["animate"])('0.1s ease-in', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(0)' }))
                        ]),
                        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["transition"])('up => void', [
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(0)' }),
                            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["animate"])('0.1s ease-in', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["style"])({ transform: 'translateY(100%)' }))
                        ])
                    ])
                ],
                exportAs: 'kendo-popup',
                providers: [__WEBPACK_IMPORTED_MODULE_1__services_align_service__["a" /* AlignService */], __WEBPACK_IMPORTED_MODULE_2__services_dom_service__["a" /* DOMService */], __WEBPACK_IMPORTED_MODULE_3__services_position_service__["a" /* PositionService */], __WEBPACK_IMPORTED_MODULE_4__services_resize_service__["a" /* ResizeService */], __WEBPACK_IMPORTED_MODULE_5__services_scrollable_service__["a" /* ScrollableService */]],
                selector: 'kendo-popup',
                template: "\n        <div class=\"k-popup\" [ngClass]=\"popupClass\" [@toggle]=\"direction\" (@toggle.done)=\"triggerOpen($event)\">\n            <ng-content></ng-content>\n            <ng-template [ngTemplateOutlet]=\"content\" [ngIf]=\"content\"></ng-template>\n        </div>\n     "
            },] },
];
/** @nocollapse */
PopupComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_1__services_align_service__["a" /* AlignService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__services_dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_3__services_position_service__["a" /* PositionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__services_resize_service__["a" /* ResizeService */], },
    { type: __WEBPACK_IMPORTED_MODULE_5__services_scrollable_service__["a" /* ScrollableService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };
PopupComponent.propDecorators = {
    'animate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'anchor': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'anchorAlign': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'collision': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupAlign': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'copyAnchorStyles': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'positionMode': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'offset': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'anchorViewportLeave': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
};


/***/ }),
/* 209 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return compileFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return filterBy; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter_descriptor_interface__ = __webpack_require__(74);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operators__ = __webpack_require__(210);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filter_no_eval__ = __webpack_require__(634);




/**
 * Creates a [`Predicate`]({% slug api_kendo-data-query_predicate %}) function
 * for the specified [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor %}).
 *
 * @param {CompositeFilterDescriptor} descriptor - The descriptor for which the predicate is created.
 * @returns {Predicate} - The created function instance.
 *
 * @example
 * ```ts-no-run
 * import { compileFilter } from '@progress/kendo-data-query';
 *
 * const data = [{ name: "Pork" }, { name: "Pepper" }, { name: "Beef" } ];
 * const predicate = compileFilter({ logic: "and", filters: [{ field: "name", operator: "startswith", value: "P" }] });
 * const result = data.filter(predicate);
 *
 * ```
 */
var compileFilter = function (descriptor) {
    if (!descriptor || descriptor.filters.length === 0) {
        return function () { return true; };
    }
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__filter_no_eval__["a" /* transformCompositeFilter */])(descriptor);
};
/**
 * Filters the provided array according to the specified
 * [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor %}).
 *
 * @param {T[]} data - The data that will be filtered.
 * @param {(CompositeFilterDescriptor | FilterDescriptor)} descriptor - The filter criteria that will be applied.
 * @returns {T[]} - The filtered data.
 *
 * @example
 * ```ts-no-run
 * import { filterBy } from '@progress/kendo-data-query';
 *
 * const data = [
 *  { name: "Pork", category: "Food", subcategory: "Meat" },
 *  { name: "Pepper", category: "Food", subcategory: "Vegetables" },
 *  { name: "Beef", category: "Food", subcategory: "Meat" }
 * ];
 *
 * const result = filterBy(data, {
 *     logic: 'and',
 *     filters: [
 *           { field: "name", operator: "startswith", value: "p", ignoreCase: true },
 *           { field: "subcategory", operator: "eq", value: "Meat" },
 *     ]
 * });
 *
 * // output:
 * // [{ "name": "Pork", "category": "Food", "subcategory": "Meat" }]
 * ```
 */
var filterBy = function (data, descriptor) {
    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(descriptor) || (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */])(descriptor) && descriptor.filters.length === 0)) {
        return data;
    }
    return data.filter(compileFilter(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__filter_operators__["a" /* normalizeFilters */])(descriptor)));
};


/***/ }),
/* 210 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeFilters; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter_descriptor_interface__ = __webpack_require__(74);


var operatorMap = function (key) { return ({
    "!=": "neq",
    "<": "lt",
    "<=": "lte",
    "==": "eq",
    ">": "gt",
    ">=": "gte",
    equal: "eq",
    equals: "eq",
    equalto: "eq",
    ge: "gte",
    greater: "gt",
    greaterthan: "gt",
    greaterthanequal: "gte",
    isempty: "isempty",
    isequalto: "eq",
    isgreaterthan: "gt",
    isgreaterthanorequalto: "gte",
    islessthan: "lt",
    islessthanorequalto: "lte",
    isnotempty: "isnotempty",
    isnotequalto: "neq",
    isnull: "isnull",
    le: "lte",
    less: "lt",
    lessthan: "lt",
    lessthanequal: "lte",
    ne: "neq",
    notequal: "neq",
    notequals: "neq",
    notequalto: "neq",
    notsubstringof: "doesnotcontain"
}[key.toLowerCase()] || key); };
var normalizeOperator = function (descriptor) {
    var filters = descriptor.filters || [];
    filters.forEach(function (filter) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */])(filter) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["d" /* isString */])(filter.operator)) {
            filter.operator = operatorMap(filter.operator);
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */])(filter)) {
            normalizeOperator(filter);
        }
    });
};
var normalizeDescriptor = function (descriptor) {
    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */])(descriptor)) {
        return {
            filters: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["e" /* isArray */])(descriptor) ? descriptor : [descriptor],
            logic: "and"
        };
    }
    return descriptor;
};
/**
 * Converts a [`FilterDescriptor`]({% slug api_kendo-data-query_filterdescriptor %}) into a
 * [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor %}).
 *
 * If a `CompositeFilterDescriptor` is passed, no modifications will be made.
 *
 * @param {CompositeFilterDescriptor | FilterDescriptor} descriptor - The descriptor that will be normalized.
 * @returns {CompositeFilterDescriptor} - The normalized descriptor.
 */
var normalizeFilters = function (descriptor) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(descriptor)) {
        descriptor = normalizeDescriptor(descriptor);
        normalizeOperator(descriptor);
    }
    return descriptor;
};


/***/ }),
/* 211 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeGroups; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return groupBy; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__transducers__ = __webpack_require__(212);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__aggregate_operators__ = __webpack_require__(402);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filtering_filter_expression_factory__ = __webpack_require__(209);




/**
 * @hidden
 */
var normalizeGroups = function (descriptors) {
    descriptors = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["e" /* isArray */])(descriptors) ? descriptors : [descriptors];
    return descriptors.map(function (x) { return Object.assign({ dir: "asc" }, x); });
};
var identity = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["a" /* map */])(function (x) { return x; });
/**
 * Groups the provided data according to the specified descriptors.
 *
 * @param {Array} data - The data that will be grouped.
 * @param {GroupDescriptor[]} descriptors - The descriptors.
 * @param {any} transformers - For internal use.
 * @param {Array} originalData - For internal use.
 * @returns {(Array<GroupResult<T>> | T[])} - The grouped data.
 *
 * @example
 * ```ts-no-run
 *
 * import { groupBy } from '@progress/kendo-data-query';
 *
 * const data = [
 *     { name: "Pork", category: "Food", subcategory: "Meat" },
 *     { name: "Pepper", category: "Food", subcategory: "Vegetables" },
 *     { name: "Beef", category: "Food", subcategory: "Meat" }
 * ];
 *
 * const result = groupBy(data, [{ field: "subcategory" }]);
 * ```
 */
var groupBy = function (data, descriptors, transformers, originalData) {
    if (descriptors === void 0) { descriptors = []; }
    if (transformers === void 0) { transformers = identity; }
    if (originalData === void 0) { originalData = data; }
    descriptors = normalizeGroups(descriptors);
    if (!descriptors.length) {
        return data;
    }
    var descriptor = descriptors[0];
    var initialValue = {};
    var view = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["b" /* exec */])(transformers(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["e" /* groupCombinator */])(descriptor.field)), initialValue, data);
    var result = [];
    Object.keys(view).forEach(function (field) {
        Object.keys(view[field]).forEach(function (value) {
            var group = view[field][value];
            var aggregateResult = {};
            var filteredData = originalData;
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* isPresent */])(descriptor.aggregates)) {
                filteredData = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__filtering_filter_expression_factory__["a" /* filterBy */])(originalData, {
                    field: descriptor.field,
                    ignoreCase: false,
                    operator: 'eq',
                    value: group.value
                });
                aggregateResult = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__aggregate_operators__["a" /* aggregateBy */])(filteredData, descriptor.aggregates);
            }
            result[group.__position] = {
                aggregates: aggregateResult,
                field: field,
                items: descriptors.length > 1 ?
                    groupBy(group.items, descriptors.slice(1), identity, filteredData)
                    : group.items,
                value: group.value
            };
        });
    });
    return result;
};


/***/ }),
/* 212 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return groupCombinator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return expandAggregates; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return aggregatesCombinator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return concat; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return map; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return filter; });
/* unused harmony export isTransformerResult */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return take; });
/* unused harmony export takeWhile */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return skip; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return exec; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__accessor__ = __webpack_require__(73);


var valueToString = function (value) {
    value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(value) && value.getTime ? value.getTime() : value;
    return value + "";
};
/**
 * @hidden
 */
var groupCombinator = function (field) {
    var prop = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__accessor__["a" /* getter */])(field, true);
    var position = 0;
    return function (agg, value) {
        agg[field] = agg[field] || {};
        var groupValue = prop(value);
        var key = valueToString(groupValue);
        var values = agg[field][key] || { __position: position++, aggregates: {}, items: [], value: groupValue };
        values.items.push(value);
        agg[field][key] = values;
        return agg;
    };
};
/**
 * @hidden
 */
var expandAggregates = function (result) {
    if (result === void 0) { result = {}; }
    Object.keys(result).forEach(function (field) {
        var aggregates = result[field];
        Object.keys(aggregates).forEach(function (aggregate) {
            aggregates[aggregate] = aggregates[aggregate].result();
        });
    });
    return result;
};
var aggregatesFuncs = function (name) { return ({
    average: function () {
        var value = 0;
        var count = 0;
        return {
            calc: function (curr) {
                if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isNumeric */])(curr)) {
                    value += curr;
                    count++;
                }
                else {
                    value = curr;
                }
            },
            result: function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isNumeric */])(value) ? value / count : value; }
        };
    },
    count: function () {
        var state = 0;
        return {
            calc: function () { return state++; },
            result: function () { return state; }
        };
    },
    max: function () {
        var state = Number.NEGATIVE_INFINITY;
        return {
            calc: function (value) {
                state = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isNumeric */])(state) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* isDate */])(state) ? state : value;
                if (state < value && (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isNumeric */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* isDate */])(value))) {
                    state = value;
                }
            },
            result: function () { return state; }
        };
    },
    min: function () {
        var state = Number.POSITIVE_INFINITY;
        return {
            calc: function (value) {
                state = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isNumeric */])(state) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* isDate */])(state) ? state : value;
                if (state > value && (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isNumeric */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* isDate */])(value))) {
                    state = value;
                }
            },
            result: function () { return state; }
        };
    },
    sum: function () {
        var state = 0;
        return {
            calc: function (value) { return state += value; },
            result: function () { return state; }
        };
    }
}[name]()); };
/**
 * @hidden
 */
var aggregatesCombinator = function (descriptors) {
    var functions = descriptors.map(function (descriptor) {
        var fieldAccessor = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__accessor__["a" /* getter */])(descriptor.field, true);
        var aggregateName = (descriptor.aggregate || "").toLowerCase();
        var aggregateAccessor = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__accessor__["a" /* getter */])(aggregateName, true);
        return function (state, value) {
            var fieldAggregates = fieldAccessor(state) || {};
            var aggregateFunction = aggregateAccessor(fieldAggregates)
                || aggregatesFuncs(aggregateName);
            aggregateFunction.calc(fieldAccessor(value));
            fieldAggregates[descriptor.aggregate] = aggregateFunction;
            state[descriptor.field] = fieldAggregates;
            return state;
        };
    });
    return function (state, value) { return functions.reduce(function (agg, calc) { return calc(agg, value); }, state); };
};
/**
 * @hidden
 * Adds the value to the `arr` and produces a new array.
 *
 * > The original array will be modified.
 */
var concat = function (arr, value) {
    arr.push(value);
    return arr;
};
/**
 * @hidden
 * Returns a reducer that will apply the specified transformation to the value.
 */
var map = function (transform) { return (function (reduce) { return (function (acc, curr, index) { return reduce(acc, transform(curr, index)); }); }); };
/**
 * @hidden
 * Returns a reducer that will filter out items which do not match the `Predicate`.
 */
var filter = function (predicate) { return (function (reduce) { return (function (acc, curr) { return predicate(curr) ? reduce(acc, curr) : acc; }); }); };
/**
 * @hidden
 */
var isTransformerResult = function (source) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(source.__value);
};
var reduced = function (x) {
    if (isTransformerResult(x)) {
        return x;
    }
    return {
        __value: x,
        reduced: true
    };
};
/**
 * @hidden
 * Returns a reducer that will take the specified number of items.
 */
var take = function (count) { return (function (reduce) { return (function (acc, curr) { return count-- > 0 ? reduce(acc, curr) : reduced(acc); }); }); };
/**
 * @hidden
 * Returns a reducer that will take the specified number of items.
 */
var takeWhile = function (predicate) { return (function (reduce) { return (function (acc, curr) { return predicate(curr) ? reduce(acc, curr) : reduced(acc); }); }); };
/**
 * @hidden
 * Returns a reducer that will skip the specified number of items.
 */
var skip = function (count) { return (function (reduce) { return (function (acc, curr) { return count-- <= 0 ? reduce(acc, curr) : acc; }); }); };
/**
 * @hidden
 * Transforms the data by applying the supplied transformer.
 */
var exec = function (transform, initialValue, data) {
    var result = initialValue;
    for (var idx = 0, length_1 = data.length; idx < length_1; idx++) {
        result = transform(result, data[idx], idx);
        if (isTransformerResult(result)) {
            result = result.__value;
            break;
        }
    }
    return result;
};


/***/ }),
/* 213 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addMonths; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adjust_dst__ = __webpack_require__(76);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_date__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__last_day_of_month__ = __webpack_require__(130);



var MONTHS_LENGTH = 12;
var normalize = function (date, expectedMonth) { return (date.getMonth() !== expectedMonth ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__last_day_of_month__["a" /* lastDayOfMonth */])(addMonths(date, -1)) : date //tslint:disable-line:no-use-before-declare
); };
/**
 * A function that adds and subtracts months from a `Date` object.
 *
 * @param date - The initial date value.
 * @param offset - The number of months to add or subtract from the date.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * addMonths(new Date(2016, 5, 1), 5); // 2016-11-1
 * addMonths(new Date(2016, 5, 1), -5); // 2015-1-1
 * ```
 */
var addMonths = function (date, offset) {
    var newDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__clone_date__["a" /* cloneDate */])(date);
    var diff = (newDate.getMonth() + offset) % MONTHS_LENGTH;
    var expectedMonth = (MONTHS_LENGTH + diff) % MONTHS_LENGTH;
    newDate.setMonth(newDate.getMonth() + offset);
    return normalize(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__adjust_dst__["a" /* adjustDST */])(newDate, date.getHours()), expectedMonth);
};


/***/ }),
/* 214 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addYears; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adjust_dst__ = __webpack_require__(76);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__set_year__ = __webpack_require__(411);


/**
 * A function that adds and subtracts years from a `Date` object.
 *
 * @param date - The initial date value.
 * @param offset - The number of years to add or subtract from the date.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * addYears(new Date(2016, 5, 1), 5); // 2011-6-1
 * addYears(new Date(2016, 5, 1), -5); // 2021-6-1
 * ```
 */
var addYears = function (value, offset) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__adjust_dst__["a" /* adjustDST */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__set_year__["a" /* setYear */])(value, value.getFullYear() + offset), value.getHours());
};


/***/ }),
/* 215 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dayOfWeek; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__direction_enum__ = __webpack_require__(129);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adjust_dst__ = __webpack_require__(76);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__clone_date__ = __webpack_require__(77);



/**
 * @hidden
 *
 * A function which returns the next or previous date for a specific week day.
 * For example, `Day.Monday`.
 *
 * @param date - The date to calculate from.
 * @param weekDay - The `Day` enum specifying the desired week day.
 * @param direction - The `Direction` enum specifying the calculation direction.
 * @returns - A `Date` instance.
 *
 * @example
 * ```ts-no-run
 * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Forward); // 2016-01-06, Wednesday
 * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Backward); // 2015-12-30, Wednesday
 * ```
 */
var dayOfWeek = function (date, weekDay, direction) {
    if (direction === void 0) { direction = __WEBPACK_IMPORTED_MODULE_0__direction_enum__["a" /* Direction */].Forward; }
    var newDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__clone_date__["a" /* cloneDate */])(date);
    var newDay = ((weekDay - newDate.getDay()) + (7 * direction)) % 7;
    newDate.setDate(newDate.getDate() + newDay);
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__adjust_dst__["a" /* adjustDST */])(newDate, date.getHours());
};


/***/ }),
/* 216 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Day; });
/**
 * Enumeration which represents the week days.
 */
var Day;
(function (Day) {
    /**
     * The Sunday value with an underlying `0` number value.
     */
    Day[Day["Sunday"] = 0] = "Sunday";
    /**
     * The Monday value with an underlying `1` number value.
     */
    Day[Day["Monday"] = 1] = "Monday";
    /**
     * The Tuesday value with an underlying `2` number value.
     */
    Day[Day["Tuesday"] = 2] = "Tuesday";
    /**
     * The Wednesday value with an underlying `3` number value.
     */
    Day[Day["Wednesday"] = 3] = "Wednesday";
    /**
     * The Thursday value with an underlying `4` number value.
     */
    Day[Day["Thursday"] = 4] = "Thursday";
    /**
     * The Friday value with an underlying `5` number value.
     */
    Day[Day["Friday"] = 5] = "Friday";
    /**
     * The Saturday value with an underlying `6` number value.
     */
    Day[Day["Saturday"] = 6] = "Saturday";
})(Day || (Day = {}));


/***/ }),
/* 217 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = stackElements;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__translate_to_point__ = __webpack_require__(135);



function stackElements(elements, stackAxis, otherAxis, sizeField) {
    if (elements.length > 1) {
        var origin = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */]();
        var previousBBox = elements[0].bbox;

        for (var idx = 1; idx < elements.length; idx++) {
            var element = elements[idx].element;
            var bbox = elements[idx].bbox;
            origin[stackAxis] = previousBBox.origin[stackAxis] + previousBBox.size[sizeField];
            origin[otherAxis] = bbox.origin[otherAxis];
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__translate_to_point__["a" /* default */])(origin, bbox, element);
            bbox.origin[stackAxis] = origin[stackAxis];
            previousBBox = bbox;
        }
    }
}
//# sourceMappingURL=stack-elements.js.map


/***/ }),
/* 218 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_base_node__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_render_path__ = __webpack_require__(136);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);





var Node = (function (BaseNode) {
    function Node(srcElement) {
        BaseNode.call(this, srcElement);
        if (srcElement) {
            this.initClip();
        }
    }

    if ( BaseNode ) Node.__proto__ = BaseNode;
    Node.prototype = Object.create( BaseNode && BaseNode.prototype );
    Node.prototype.constructor = Node;

    Node.prototype.initClip = function initClip () {
        var clip = this.srcElement.clip();
        if (clip) {
            this.clip = clip;
            clip.addObserver(this);
        }
    };

    Node.prototype.clear = function clear () {
        if (this.srcElement) {
            this.srcElement.removeObserver(this);
        }

        this.clearClip();

        BaseNode.prototype.clear.call(this);
    };

    Node.prototype.clearClip = function clearClip () {
        if (this.clip) {
            this.clip.removeObserver(this);
            delete this.clip;
        }
    };

    Node.prototype.setClip = function setClip (ctx) {
        if (this.clip) {
            ctx.beginPath();
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_path__["a" /* default */])(ctx, this.clip);
            ctx.clip();
        }
    };

    Node.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "clip") {
            this.clearClip();
            this.initClip();
        }

        BaseNode.prototype.optionsChange.call(this, e);
    };

    Node.prototype.setTransform = function setTransform (ctx) {
        if (this.srcElement) {
            var transform = this.srcElement.transform();
            if (transform) {
                ctx.transform.apply(ctx, transform.matrix().toArray(6));
            }
        }
    };

    Node.prototype.loadElements = function loadElements (elements, pos, cors) {
        var this$1 = this;

        for (var i = 0; i < elements.length; i++) {
            var srcElement = elements[i];
            var children = srcElement.children;

            var childNode = new __WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */][srcElement.nodeType](srcElement, cors);

            if (children && children.length > 0) {
                childNode.load(children, pos, cors);
            }

            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(pos)) {
                this$1.insertAt(childNode, pos);
            } else {
                this$1.append(childNode);
            }
        }
    };

    Node.prototype.load = function load (elements, pos, cors) {
        this.loadElements(elements, pos, cors);

        this.invalidate();
    };

    Node.prototype.setOpacity = function setOpacity (ctx) {
        if (this.srcElement) {
            var opacity = this.srcElement.opacity();
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(opacity)) {
                this.globalAlpha(ctx, opacity);
            }
        }
    };

    Node.prototype.globalAlpha = function globalAlpha (ctx, value) {
        var opactity = value;
        if (opactity && ctx.globalAlpha) {
            opactity *= ctx.globalAlpha;
        }
        ctx.globalAlpha = opactity;
    };

    Node.prototype.visible = function visible () {
        var src = this.srcElement;
        return !src || (src && src.options.visible !== false);
    };

    return Node;
}(__WEBPACK_IMPORTED_MODULE_0__core_base_node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (Node);
//# sourceMappingURL=node.js.map


/***/ }),
/* 219 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);




var toString = {}.toString;

var OptionsStore = (function (Class) {
    function OptionsStore(options, prefix) {
        var this$1 = this;
        if ( prefix === void 0 ) prefix = "";

        Class.call(this);

        this.prefix = prefix;

        for (var field in options) {
            var member = options[field];
            member = this$1._wrap(member, field);
            this$1[field] = member;
        }
    }

    if ( Class ) OptionsStore.__proto__ = Class;
    OptionsStore.prototype = Object.create( Class && Class.prototype );
    OptionsStore.prototype.constructor = OptionsStore;

    OptionsStore.prototype.get = function get (field) {
        var parts = field.split(".");
        var result = this;

        while (parts.length && result) {
            var part = parts.shift();
            result = result[part];
        }

        return result;
    };

    OptionsStore.prototype.set = function set (field, value) {
        var current = this.get(field);

        if (current !== value) {
            this._set(field, this._wrap(value, field));
            this.optionsChange({
                field: this.prefix + field,
                value: value
            });
        }
    };

    OptionsStore.prototype._set = function _set (field, value) {
        var this$1 = this;

        var composite = field.indexOf(".") >= 0;
        var parentObj = this;
        var fieldName = field;

        if (composite) {
            var parts = fieldName.split(".");
            var prefix = this.prefix;

            while (parts.length > 1) {
                fieldName = parts.shift();
                prefix += fieldName + ".";

                var obj = parentObj[fieldName];

                if (!obj) {
                    obj = new OptionsStore({}, prefix);
                    obj.addObserver(this$1);
                    parentObj[fieldName] = obj;
                }
                parentObj = obj;
            }
            fieldName = parts[0];
        }

        parentObj._clear(fieldName);
        parentObj[fieldName] = value;
    };

    OptionsStore.prototype._clear = function _clear (field) {
        var current = this[field];
        if (current && current.removeObserver) {
            current.removeObserver(this);
        }
    };

    OptionsStore.prototype._wrap = function _wrap (object, field) {
        var type = toString.call(object);
        var wrapped = object;

        if (wrapped !== null && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* defined */])(wrapped) && type === "[object Object]") {
            if (!(object instanceof OptionsStore) && !(object instanceof Class)) {
                wrapped = new OptionsStore(wrapped, this.prefix + field + ".");
            }

            wrapped.addObserver(this);
        }

        return wrapped;
    };

    return OptionsStore;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

__WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__["a" /* default */].extend(OptionsStore.prototype);

/* harmony default export */ __webpack_exports__["a"] = (OptionsStore);
//# sourceMappingURL=options-store.js.map


/***/ }),
/* 220 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shapes_group__ = __webpack_require__(98);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__surface_factory__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(5);






var events = [
    "click",
    "mouseenter",
    "mouseleave",
    "mousemove",
    "resize"
];

var Surface = (function (Observable) {
    function Surface(element, options) {
        Observable.call(this);

        this.options = Object.assign({}, options);
        this.element = element;
        this.element._kendoExportVisual = this.exportVisual.bind(this);

        this._click = this._handler("click");
        this._mouseenter = this._handler("mouseenter");
        this._mouseleave = this._handler("mouseleave");
        this._mousemove = this._handler("mousemove");

        this._visual = new __WEBPACK_IMPORTED_MODULE_0__shapes_group__["a" /* default */]();

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["k" /* elementSize */])(element, this.options);

        this.bind(events, this.options);

        this._enableTracking();
    }

    if ( Observable ) Surface.__proto__ = Observable;
    Surface.prototype = Object.create( Observable && Observable.prototype );
    Surface.prototype.constructor = Surface;

    Surface.prototype.draw = function draw (element) {
        this._visual.children.push(element);
    };

    Surface.prototype.clear = function clear () {
        this._visual.children = [];
    };

    Surface.prototype.destroy = function destroy () {
        this._visual = null;
        this.element._kendoExportVisual = null;
        this.unbind();
    };

    Surface.prototype.eventTarget = function eventTarget (e) {
        var this$1 = this;

        var domNode = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["o" /* eventElement */])(e);
        var node;

        while (!node && domNode) {
            node = domNode._kendoNode;
            if (domNode === this$1.element) {
                break;
            }

            domNode = domNode.parentElement;
        }

        if (node) {
            return node.srcElement;
        }
    };

    Surface.prototype.exportVisual = function exportVisual () {
        return this._visual;
    };

    Surface.prototype.getSize = function getSize () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["k" /* elementSize */])(this.element);
    };

    Surface.prototype.currentSize = function currentSize (size) {
        if (size) {
            this._size = size;
        } else {
            return this._size;
        }
    };

    Surface.prototype.setSize = function setSize (size) {
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["k" /* elementSize */])(this.element, size);

        this.currentSize(size);
        this._resize();
    };

    Surface.prototype.resize = function resize (force) {
        var size = this.getSize();
        var currentSize = this.currentSize();

        if (force || (size.width > 0 || size.height > 0) && (!currentSize || size.width !== currentSize.width || size.height !== currentSize.height)) {
            this.currentSize(size);
            this._resize(size, force);
            this.trigger("resize", size);
        }
    };

    Surface.prototype.size = function size (value) {
        if (!value) {
            return this.getSize();
        }

        this.setSize(value);
    };

    Surface.prototype.suspendTracking = function suspendTracking () {
        this._suspendedTracking = true;
    };

    Surface.prototype.resumeTracking = function resumeTracking () {
        this._suspendedTracking = false;
    };

    Surface.prototype._enableTracking = function _enableTracking () {};

    Surface.prototype._resize = function _resize () {};

    Surface.prototype._handler = function _handler (eventName) {
        var this$1 = this;

        return function (e) {
            var node = this$1.eventTarget(e);
            if (node && !this$1._suspendedTracking) {
                this$1.trigger(eventName, {
                    element: node,
                    originalEvent: e,
                    type: eventName
                });
            }
        };
    };

    Surface.prototype._elementOffset = function _elementOffset () {
        var element = this.element;
        var ref = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["p" /* elementStyles */])(element, [ "paddingLeft", "paddingTop" ]);
        var paddingLeft = ref.paddingLeft;
        var paddingTop = ref.paddingTop;
        var ref$1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["q" /* elementOffset */])(element);
        var left = ref$1.left;
        var top = ref$1.top;

        return {
            left: left + parseInt(paddingLeft, 10),
            top: top + parseInt(paddingTop, 10)
        };
    };

    Surface.prototype._surfacePoint = function _surfacePoint (e) {
        var offset = this._elementOffset();
        var coord = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["r" /* eventCoordinates */])(e);
        var x = coord.x - offset.left;
        var y = coord.y - offset.top;

        return new __WEBPACK_IMPORTED_MODULE_1__geometry_point__["a" /* default */](x, y);
    };

    return Surface;
}(__WEBPACK_IMPORTED_MODULE_3__common__["f" /* Observable */]));

Surface.create = function(element, options) {
    return __WEBPACK_IMPORTED_MODULE_2__surface_factory__["a" /* default */].current.create(element, options);
};

Surface.support = {};

/* harmony default export */ __webpack_exports__["a"] = (Surface);

//# sourceMappingURL=surface.js.map


/***/ }),
/* 221 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__ = __webpack_require__(132);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__math_close_or_less__ = __webpack_require__(687);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__math_line_intersection__ = __webpack_require__(692);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__math_ellipse_extreme_angles__ = __webpack_require__(426);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__transform__ = __webpack_require__(39);














var MAX_INTERVAL = 45;
var pow = Math.pow;

var Arc = (function (Class) {
    function Arc(center, options) {
        if ( center === void 0 ) center = new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */]();
        if ( options === void 0 ) options = {};

        Class.call(this);

        this.setCenter(center);

        this.radiusX = options.radiusX;
        this.radiusY = options.radiusY || options.radiusX;
        this.startAngle = options.startAngle;
        this.endAngle = options.endAngle;
        this.anticlockwise = options.anticlockwise || false;
        this.xRotation = options.xRotation;
    }

    if ( Class ) Arc.__proto__ = Class;
    Arc.prototype = Object.create( Class && Class.prototype );
    Arc.prototype.constructor = Arc;

    Arc.prototype.clone = function clone () {
        return new Arc(this.center, {
            radiusX: this.radiusX,
            radiusY: this.radiusY,
            startAngle: this.startAngle,
            endAngle: this.endAngle,
            anticlockwise: this.anticlockwise
        });
    };

    Arc.prototype.setCenter = function setCenter (value) {
        this._observerField("center", __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */].create(value));
        this.geometryChange();
        return this;
    };

    Arc.prototype.getCenter = function getCenter () {
        return this.center;
    };

    Arc.prototype.pointAt = function pointAt (angle) {
        var center = this.center;
        var radian = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["h" /* rad */])(angle);

        return new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */](
            center.x + this.radiusX * Math.cos(radian),
            center.y + this.radiusY * Math.sin(radian)
        );
    };

    Arc.prototype.curvePoints = function curvePoints () {
        var this$1 = this;

        var startAngle = this.startAngle;
        var dir = this.anticlockwise ? -1 : 1;
        var curvePoints = [ this.pointAt(startAngle) ];
        var interval = this._arcInterval();
        var intervalAngle = interval.endAngle - interval.startAngle;
        var subIntervalsCount = Math.ceil(intervalAngle / MAX_INTERVAL);
        var subIntervalAngle = intervalAngle / subIntervalsCount;
        var currentAngle = startAngle;
        var transformation;
        if (this.xRotation) {
            transformation = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__transform__["a" /* default */])().rotate(this.xRotation, this.center);
        }

        for (var i = 1; i <= subIntervalsCount; i++) {
            var nextAngle = currentAngle + dir * subIntervalAngle;
            var points = this$1._intervalCurvePoints(currentAngle, nextAngle, transformation);

            curvePoints.push(points.cp1, points.cp2, points.p2);
            currentAngle = nextAngle;
        }

        return curvePoints;
    };

    Arc.prototype.bbox = function bbox (matrix) {
        var this$1 = this;

        var interval = this._arcInterval();
        var startAngle = interval.startAngle;
        var endAngle = interval.endAngle;
        var extremeAngles = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__math_ellipse_extreme_angles__["a" /* default */])(this.center, this.radiusX, this.radiusY, matrix);
        var extremeX = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* deg */])(extremeAngles.x);
        var extremeY = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* deg */])(extremeAngles.y);
        var endPoint = this.pointAt(endAngle).transformCopy(matrix);
        var currentAngleX = bboxStartAngle(extremeX, startAngle);
        var currentAngleY = bboxStartAngle(extremeY, startAngle);
        var currentPoint = this.pointAt(startAngle).transformCopy(matrix);
        var minPoint = __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */].min(currentPoint, endPoint);
        var maxPoint = __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */].max(currentPoint, endPoint);

        while (currentAngleX < endAngle || currentAngleY < endAngle) {
            var currentPointX;
            if (currentAngleX < endAngle) {
                currentPointX = this$1.pointAt(currentAngleX).transformCopy(matrix);
                currentAngleX += 90;
            }

            var currentPointY;
            if (currentAngleY < endAngle) {
                currentPointY = this$1.pointAt(currentAngleY).transformCopy(matrix);
                currentAngleY += 90;
            }

            currentPoint = new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */](currentPointX.x, currentPointY.y);
            minPoint = __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */].min(minPoint, currentPoint);
            maxPoint = __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */].max(maxPoint, currentPoint);
        }

        return __WEBPACK_IMPORTED_MODULE_9__rect__["a" /* default */].fromPoints(minPoint, maxPoint);
    };

    Arc.prototype._arcInterval = function _arcInterval () {
        var ref = this;
        var startAngle = ref.startAngle;
        var endAngle = ref.endAngle;
        var anticlockwise = ref.anticlockwise;

        if (anticlockwise) {
            var oldStart = startAngle;
            startAngle = endAngle;
            endAngle = oldStart;
        }

        if (startAngle > endAngle || (anticlockwise && startAngle === endAngle)) {
            endAngle += 360;
        }

        return {
            startAngle: startAngle,
            endAngle: endAngle
        };
    };

    Arc.prototype._intervalCurvePoints = function _intervalCurvePoints (startAngle, endAngle, transformation) {
        var p1 = this.pointAt(startAngle);
        var p2 = this.pointAt(endAngle);
        var p1Derivative = this._derivativeAt(startAngle);
        var p2Derivative = this._derivativeAt(endAngle);
        var t = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["h" /* rad */])(endAngle) - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["h" /* rad */])(startAngle)) / 3;
        var cp1 = new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */](p1.x + t * p1Derivative.x, p1.y + t * p1Derivative.y);
        var cp2 = new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */](p2.x - t * p2Derivative.x, p2.y - t * p2Derivative.y);
        if (transformation) {
            p1.transform(transformation);
            p2.transform(transformation);
            cp1.transform(transformation);
            cp2.transform(transformation);
        }

        return {
            p1: p1,
            cp1: cp1,
            cp2: cp2,
            p2: p2
        };
    };

    Arc.prototype._derivativeAt = function _derivativeAt (angle) {
        var radian = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["h" /* rad */])(angle);

        return new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */](-this.radiusX * Math.sin(radian), this.radiusY * Math.cos(radian));
    };

    Arc.prototype.containsPoint = function containsPoint (point) {
        var interval = this._arcInterval();
        var intervalAngle = interval.endAngle - interval.startAngle;
        var ref = this;
        var center = ref.center;
        var radiusX = ref.radiusX;
        var radiusY = ref.radiusY;
        var distance = center.distanceTo(point);
        var angleRad = Math.atan2(point.y - center.y, point.x - center.x);
        var pointRadius = (radiusX * radiusY) /
            Math.sqrt(pow(radiusX, 2) * pow(Math.sin(angleRad), 2) + pow(radiusY, 2) * pow(Math.cos(angleRad), 2));
        var startPoint = this.pointAt(this.startAngle).round(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* PRECISION */]);
        var endPoint = this.pointAt(this.endAngle).round(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* PRECISION */]);
        var intersection = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__math_line_intersection__["a" /* default */])(center, point.round(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* PRECISION */]), startPoint, endPoint);
        var containsPoint;

        if (intervalAngle < 180) {
            containsPoint = intersection && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__math_close_or_less__["a" /* default */])(center.distanceTo(intersection), distance) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__math_close_or_less__["a" /* default */])(distance, pointRadius);
        } else {
            var angle = calculateAngle(center.x, center.y, radiusX, radiusY, point.x, point.y);
            if (angle !== 360) {
                angle = (360 + angle) % 360;
            }

            var inAngleRange = interval.startAngle <= angle && angle <= interval.endAngle;
            containsPoint = (inAngleRange && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__math_close_or_less__["a" /* default */])(distance, pointRadius)) || (!inAngleRange && (!intersection || intersection.equals(point)));
        }
        return containsPoint;
    };

    Arc.prototype._isOnPath = function _isOnPath (point, width) {
        var interval = this._arcInterval();
        var center = this.center;
        var angle = calculateAngle(center.x, center.y, this.radiusX, this.radiusY, point.x, point.y);
        if (angle !== 360) {
            angle = (360 + angle) % 360;
        }

        var inAngleRange = interval.startAngle <= angle && angle <= interval.endAngle;

        return inAngleRange && this.pointAt(angle).distanceTo(point) <= width;
    };

    Arc.fromPoints = function fromPoints (start, end, rx, ry, largeArc, swipe, rotation) {// eslint-disable-line max-params
        var arcParameters = normalizeArcParameters({
            x1: start.x,
            y1: start.y,
            x2: end.x,
            y2: end.y,
            rx: rx,
            ry: ry,
            largeArc: largeArc,
            swipe: swipe,
            rotation: rotation
        });

        return new Arc(arcParameters.center, {
            startAngle: arcParameters.startAngle,
            endAngle: arcParameters.endAngle,
            radiusX: arcParameters.radiusX,
            radiusY: arcParameters.radiusY,
            xRotation: arcParameters.xRotation,
            anticlockwise: swipe === 0
        });
    };

    return Arc;
}(__WEBPACK_IMPORTED_MODULE_2__common__["d" /* Class */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__["a" /* default */])(Arc.prototype, [ "radiusX", "radiusY", "startAngle", "endAngle", "anticlockwise" ]);
__WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__["a" /* default */].extend(Arc.prototype);

function calculateAngle(cx, cy, rx, ry, x, y) {
    var cos = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])((x - cx) / rx, 3);
    var sin = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])((y - cy) / ry, 3);

    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* deg */])(Math.atan2(sin, cos)));
}

function normalizeArcParameters(parameters) {
    var x1 = parameters.x1;
    var y1 = parameters.y1;
    var x2 = parameters.x2;
    var y2 = parameters.y2;
    var rx = parameters.rx;
    var ry = parameters.ry;
    var largeArc = parameters.largeArc;
    var swipe = parameters.swipe;
    var rotation = parameters.rotation; if ( rotation === void 0 ) rotation = 0;

    var radians = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["h" /* rad */])(rotation);
    var cosine = Math.cos(radians);
    var sine = Math.sin(radians);

    var xT = cosine * (x1 - x2) / 2 + sine * (y1 - y2) / 2;
    var yT = -sine * (x1 - x2) / 2 + cosine * (y1 - y2) / 2;

    var sign = largeArc !== swipe ? 1 : -1;

    var xt2 = Math.pow(xT, 2);
    var yt2 = Math.pow(yT, 2);
    var rx2 = Math.pow(rx, 2);
    var ry2 = Math.pow(ry, 2);

    var delta = xt2 / rx2 + yt2 / ry2;

    if (delta > 1) {
        delta = Math.sqrt(xt2 / rx2 + yt2 / ry2);
        rx = delta * rx;
        rx2 = Math.pow(rx, 2);

        ry = delta * ry;
        ry2 = Math.pow(ry, 2);
    }

    var constT = sign * Math.sqrt((rx2 * ry2 - rx2 * yt2 - ry2 * xt2) / (rx2 * yt2 + ry2 * xt2));
    // due to rounding errors the value could become NaN even after radii correction
    if (isNaN(constT)) {
        constT = 0;
    }

    var cxT = constT * (rx * yT) / ry;
    var cyT = - constT * (ry * xT) / rx;

    var cx = cosine * cxT - sine * cyT + (x1 + x2) / 2;
    var cy = sine * cxT + cosine * cyT + (y1 + y2) / 2;


    var uX = (xT - cxT) / rx;
    var uY = (yT - cyT) / ry;
    var vX = -(xT + cxT) / rx;
    var vY = -(yT + cyT) / ry;

    var startAngle = (uY >= 0 ? 1 : -1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* deg */])(Math.acos(uX / Math.sqrt(uX * uX + uY * uY)));

    var angleCosine = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* round */])((uX * vX + uY * vY) / (Math.sqrt(uX * uX + uY * uY) * Math.sqrt(vX * vX + vY * vY)), 10);
    var angle = (uX * vY - uY * vX >= 0 ? 1 : -1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* deg */])(Math.acos(angleCosine));

    if (!swipe && angle > 0) {
        angle -= 360;
    }

    if (swipe && angle < 0) {
        angle += 360;
    }
    var endAngle = startAngle + angle;
    var signEndAngle = endAngle >= 0 ? 1 : -1;
    endAngle = (Math.abs(endAngle) % 360) * signEndAngle;

    return {
        center: new __WEBPACK_IMPORTED_MODULE_8__point__["a" /* default */](cx, cy),
        startAngle: startAngle,
        endAngle: endAngle,
        radiusX: rx,
        radiusY: ry,
        xRotation: rotation
    };
}

function bboxStartAngle(angle, start) {
    var startAngle = angle;

    while (startAngle < start) {
        startAngle += 90;
    }

    return startAngle;
}

/* harmony default export */ __webpack_exports__["a"] = (Arc);

//# sourceMappingURL=arc.js.map


/***/ }),
/* 222 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = calculateCurveAt;
function calculateCurveAt(t, field, points) {
    var t1 = 1 - t;
    return Math.pow(t1, 3) * points[0][field] +
        3 * Math.pow(t1, 2) * t * points[1][field] +
        3 * Math.pow(t, 2) * t1 * points[2][field] +
        Math.pow(t, 3) * points[3][field];
}
//# sourceMappingURL=calculate-curve-at.js.map


/***/ }),
/* 223 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stops_array__ = __webpack_require__(694);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gradient_stop__ = __webpack_require__(432);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(5);






var Gradient = (function (Class) {
    function Gradient(options) {
        if ( options === void 0 ) options = {};

        Class.call(this);

        this.stops = new __WEBPACK_IMPORTED_MODULE_1__stops_array__["a" /* default */](this._createStops(options.stops));
        this.stops.addObserver(this);
        this._userSpace = options.userSpace;
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["j" /* definitionId */])();
    }

    if ( Class ) Gradient.__proto__ = Class;
    Gradient.prototype = Object.create( Class && Class.prototype );
    Gradient.prototype.constructor = Gradient;

    Gradient.prototype.userSpace = function userSpace (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["e" /* defined */])(value)) {
            this._userSpace = value;
            this.optionsChange();
            return this;
        }

        return this._userSpace;
    };

    Gradient.prototype._createStops = function _createStops (stops) {
        if ( stops === void 0 ) stops = [];

        var result = [];
        for (var idx = 0; idx < stops.length; idx++) {
            result.push(__WEBPACK_IMPORTED_MODULE_2__gradient_stop__["a" /* default */].create(stops[idx]));
        }

        return result;
    };

    Gradient.prototype.addStop = function addStop (offset, color, opacity) {
        this.stops.push(new __WEBPACK_IMPORTED_MODULE_2__gradient_stop__["a" /* default */](offset, color, opacity));
    };

    Gradient.prototype.removeStop = function removeStop (stop) {
        var index = this.stops.indexOf(stop);
        if (index >= 0) {
            this.stops.splice(index, 1);
        }
    };

    return Gradient;
}(__WEBPACK_IMPORTED_MODULE_3__common__["d" /* Class */]));

Gradient.prototype.nodeType = "Gradient";

__WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__["a" /* default */].extend(Gradient.prototype);

Object.assign(Gradient.prototype, {
    optionsChange: function(e) {
        this.trigger("optionsChange", {
            field: "gradient" + (e ? "." + e.field : ""),
            value: this
        });
    },

    geometryChange: function() {
        this.optionsChange();
    }
});

/* harmony default export */ __webpack_exports__["a"] = (Gradient);
//# sourceMappingURL=gradient.js.map


/***/ }),
/* 224 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_point_accessors__ = __webpack_require__(134);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gradient__ = __webpack_require__(223);




var LinearGradient = (function (Gradient) {
    function LinearGradient(options) {
        if ( options === void 0 ) options = {};

        Gradient.call(this, options);

        this.start(options.start || new __WEBPACK_IMPORTED_MODULE_1__geometry_point__["a" /* default */]());

        this.end(options.end || new __WEBPACK_IMPORTED_MODULE_1__geometry_point__["a" /* default */](1, 0));
    }

    if ( Gradient ) LinearGradient.__proto__ = Gradient;
    LinearGradient.prototype = Object.create( Gradient && Gradient.prototype );
    LinearGradient.prototype.constructor = LinearGradient;

    return LinearGradient;
}(__WEBPACK_IMPORTED_MODULE_2__gradient__["a" /* default */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_point_accessors__["a" /* default */])(LinearGradient.prototype, [ "start", "end" ]);

/* harmony default export */ __webpack_exports__["a"] = (LinearGradient);
//# sourceMappingURL=linear-gradient.js.map


/***/ }),
/* 225 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_point_accessors__ = __webpack_require__(134);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gradient__ = __webpack_require__(223);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);





var RadialGradient = (function (Gradient) {
    function RadialGradient(options) {
        if ( options === void 0 ) options = {};

        Gradient.call(this, options);

        this.center(options.center || new __WEBPACK_IMPORTED_MODULE_1__geometry_point__["a" /* default */]());
        this._radius = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(options.radius) ? options.radius : 1;
        this._fallbackFill = options.fallbackFill;
    }

    if ( Gradient ) RadialGradient.__proto__ = Gradient;
    RadialGradient.prototype = Object.create( Gradient && Gradient.prototype );
    RadialGradient.prototype.constructor = RadialGradient;

    RadialGradient.prototype.radius = function radius (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(value)) {
            this._radius = value;
            this.geometryChange();
            return this;
        }

        return this._radius;
    };

    RadialGradient.prototype.fallbackFill = function fallbackFill (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["e" /* defined */])(value)) {
            this._fallbackFill = value;
            this.optionsChange();
            return this;
        }

        return this._fallbackFill;
    };

    return RadialGradient;
}(__WEBPACK_IMPORTED_MODULE_2__gradient__["a" /* default */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_point_accessors__["a" /* default */])(RadialGradient.prototype, [ "center" ]);

/* harmony default export */ __webpack_exports__["a"] = (RadialGradient);
//# sourceMappingURL=radial-gradient.js.map


/***/ }),
/* 226 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

var Traversable = {
    extend: function(proto, childrenField) {
        proto.traverse = function(callback) {
            var children = this[childrenField];

            for (var i = 0; i < children.length; i++) {
                var child = children[i];

                if (child.traverse) {
                    child.traverse(callback);
                } else {
                    callback(child);
                }
            }

            return this;
        };
    }
};

/* harmony default export */ __webpack_exports__["a"] = (Traversable);
//# sourceMappingURL=traversable.js.map


/***/ }),
/* 227 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__pdf_core__ = __webpack_require__(433);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__pdf_core__["h"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__pdf_core__["i"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pdf_drawing__ = __webpack_require__(701);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__pdf_drawing__["a"]; });



//# sourceMappingURL=pdf.js.map


/***/ }),
/* 228 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_base_node__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__definition_node__ = __webpack_require__(445);




var RootNode = (function (Node) {
    function RootNode(options) {
        Node.call(this);
        this.options = options;
        this.defs = new __WEBPACK_IMPORTED_MODULE_2__definition_node__["a" /* default */]();
    }

    if ( Node ) RootNode.__proto__ = Node;
    RootNode.prototype = Object.create( Node && Node.prototype );
    RootNode.prototype.constructor = RootNode;

    RootNode.prototype.attachTo = function attachTo (domElement) {
        this.element = domElement;
        this.defs.attachTo(domElement.firstElementChild);
    };

    RootNode.prototype.clear = function clear () {
        __WEBPACK_IMPORTED_MODULE_0__core_base_node__["a" /* default */].prototype.clear.call(this);
    };

    RootNode.prototype.template = function template () {
        return this.defs.render() + this.renderChildren();
    };

    RootNode.prototype.definitionChange = function definitionChange (e) {
        this.defs.definitionChange(e);
    };

    return RootNode;
}(__WEBPACK_IMPORTED_MODULE_1__node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (RootNode);
//# sourceMappingURL=root-node.js.map


/***/ }),
/* 229 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DEG_TO_RAD; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_NUM; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return MIN_NUM; });
var DEG_TO_RAD = Math.PI / 180;
var MAX_NUM = Number.MAX_VALUE;
var MIN_NUM = -Number.MAX_VALUE;


//# sourceMappingURL=constants.js.map


/***/ }),
/* 230 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__save_as__ = __webpack_require__(742);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__save_as__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base64__ = __webpack_require__(741);
/* unused harmony reexport encodeBase64 */



//# sourceMappingURL=main.js.map


/***/ }),
/* 231 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
    "bottom": "bottom",
    "center": "center",
    "middle": "middle",
    "left": "left",
    "right": "right",
    "top": "top"
});

//# sourceMappingURL=align-point.js.map


/***/ }),
/* 232 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var getDocument = function (element) { return ( element.ownerDocument.documentElement ); };

/* harmony default export */ __webpack_exports__["a"] = (getDocument);

//# sourceMappingURL=document.js.map


/***/ }),
/* 233 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__SliderModel__ = __webpack_require__(759);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__SliderModel__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__SliderUtil__ = __webpack_require__(472);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__SliderUtil__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__SwitchController__ = __webpack_require__(760);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__SwitchController__["a"]; });




//# sourceMappingURL=main.js.map


/***/ }),
/* 234 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = localeTerritory;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);


function territoryFromName(name) {
    var parts = name.split("-");
    var length = parts.length;

    if (length > 1) {
        var territory = parts[ length - 1 ];
        return territory.toUpperCase();
    }
}

function territoryFromName(name, identity) {
    var likelySubtags = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental.likelySubtags;
    var parts = name.split("-");
    if (likelySubtags) {
        var likelyName = likelySubtags[name] || likelySubtags[parts[0]];
        if (likelyName) {
            parts = likelyName.split("-");
        }
    }

    if (identity) {
        for (var idx = parts.length - 1; idx >= 1; idx--) {
            var part = parts[idx];
            if (part === identity.variant || part === identity.script) {
                parts.splice(idx, 1);
            }
        }
    }

    var length = parts.length;

    if (length > 1) {
        var territory = parts[length - 1];
        return territory.toUpperCase();
    }
}

function localeTerritory(info) {
    if (info.territory) {
        return info.territory;
    }

    var name = info.name;
    var identity = info.identity;
    var territory;

    if (identity && identity.territory) {
        territory = identity.territory;
    } else {
        territory = territoryFromName(name, identity);
    }

    info.territory = territory;

    return territory;
}

//# sourceMappingURL=territory.js.map


/***/ }),
/* 235 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isDate;
var objectToString = {}.toString;
var DATE_STRING = "[object Date]";

function isDate(value) {
    return objectToString.call(value) === DATE_STRING;
}
//# sourceMappingURL=is-date.js.map


/***/ }),
/* 236 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isNumber;
function isNumber(value) {
    return typeof value === "number";
}
//# sourceMappingURL=is-number.js.map


/***/ }),
/* 237 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isString;
function isString(value) {
    return typeof value === "string";
}
//# sourceMappingURL=is-string.js.map


/***/ }),
/* 238 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = round;
var MAX_PRECISION = 20;

function round(value, precision) {
    var result = value;
    var decimals = precision || 0;

    result = result.toString().split('e');
    result = Math.round(Number(result[0] + 'e' + (result[1] ? (Number(result[1]) + decimals) : decimals)));

    result = result.toString().split('e');
    result = Number(result[0] + 'e' + (result[1] ? (Number(result[1]) - decimals) : -decimals));

    return result.toFixed(Math.min(decimals, MAX_PRECISION));
}
//# sourceMappingURL=round.js.map


/***/ }),
/* 239 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = datePattern;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_format_string__ = __webpack_require__(474);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_is_string__ = __webpack_require__(237);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_constants__ = __webpack_require__(22);




var REMOVAL_PENALTY = 120;
var ADDITION_PENALTY = 20;
var LENGHT_DELTA = [ 2, 1, 5, 3, 4 ];
var LONG_LESS_PENALTY_DELTA = -2;
var SHORT_LESS_PENALTY_DELTA = -1;
var SHORT_MORE_PENALTY_DELTA = 1;
var LONG_MORE_PENALTY_DELTA = 2;

var PENALTIES = {};
PENALTIES[LONG_LESS_PENALTY_DELTA] = 8;
PENALTIES[SHORT_LESS_PENALTY_DELTA] = 6;
PENALTIES[LONG_MORE_PENALTY_DELTA] = 6;
PENALTIES[SHORT_MORE_PENALTY_DELTA] = 3;

var VALUE_FORMAT_LENGTH = {
    numeric: 1,
    "2-digit": 2,
    short: 3,
    long: 4,
    narrow: 5
};

var TIME_SPECIFIERS_REGEX = /[hHmsSzZoOvVxX]/;

function getHourSpecifier(options) {
    return options.hour12 ? "h" : "H";
}

var DATE_OPTIONS_MAP = [ {
    key: "era",
    specifier: "G"
}, {
    key: "year",
    specifier: "y"
}, {
    key: "month",
    specifier: "M"
}, {
    key: "day",
    specifier: "d"
}, {
    key: "weekday",
    specifier: "E"
}, {
    key: "hour",
    getSpecifier: getHourSpecifier
}, {
    key: "minute",
    specifier: "m"
}, {
    key: "second",
    specifier: "s"
}, {
    key: "timeZoneName",
    specifier: "z"
} ];

var STAND_ALONE_SPECIFIERS = {
    e: 'c',
    E: 'c',
    M: 'L',
    Q: 'q'
};

var specifiersRegex = {};
var resolvedFormats = {};

function getSpecifierRegex(specifier) {
    if (!specifiersRegex[specifier]) {
        specifiersRegex[specifier] = new RegExp(specifier + "+");
    }
    return specifiersRegex[specifier];
}

function skeletonSpecifiers(skeleton) {
    var result = [];
    var current = skeleton.charAt(0);
    var specifier = current;
    for (var idx = 1; idx < skeleton.length; idx++) {
        var character = skeleton.charAt(idx);
        if (character === specifier) {
            current += character;
        } else {
            result.push(current);
            current = specifier = character;
        }
    }

    result.push(current);

    return result;
}

function findBestMatch(specifiers, availableFormats) {
    var specifiersLength = specifiers.length;
    var maxScore = -Number.MAX_VALUE;
    var bestMatches, result;
    for (var format in availableFormats) {
        var matches = [];
        var currentFormat = format.replace("v", "z");
        var score = 0;
        for (var idx = 0; idx < specifiersLength; idx++) {
            var specifier = specifiers[idx];
            var specifierRegex = getSpecifierRegex(specifier[0]);
            var match = (specifierRegex.exec(currentFormat) || [])[0];

            if (!match) {
                score -= REMOVAL_PENALTY;
            } else {
                currentFormat = currentFormat.replace(match, __WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */]);
                if (match.length !== specifier.length) {
                    var delta = Math.max(Math.min(LENGHT_DELTA[match.length] - LENGHT_DELTA[specifier.length], 2), -2);
                    score -= PENALTIES[delta];
                }
            }

            matches.push(match);

            if (score < maxScore) {
                break;
            }
        }

        if (currentFormat.length) {
            score -= skeletonSpecifiers(currentFormat).length * ADDITION_PENALTY;
        }

        if (score > maxScore) {
            maxScore = score;
            bestMatches = matches;
            result = availableFormats[format];
        }
    }

    result = result.replace("v", "z");

    for (var idx$1 = 0; idx$1 < specifiersLength; idx$1++) {
        var bestMatch = bestMatches[idx$1];
        if (bestMatch && bestMatch !== specifiers[idx$1]) {
            var matchSpecifier = bestMatches[idx$1][0];
            result = result.replace(getSpecifierRegex(matchSpecifier), specifiers[idx$1]);
            if (STAND_ALONE_SPECIFIERS[matchSpecifier]) {
                result = result.replace(getSpecifierRegex(STAND_ALONE_SPECIFIERS[matchSpecifier]), specifiers[idx$1]);
            }
        }
    }

    return result;
}

function cacheFormat(skeleton, format, locale) {
    if (!resolvedFormats[locale]) {
        resolvedFormats[locale] = {};
    }
    resolvedFormats[locale][skeleton] = format;
}


function skeletonFormat(skeleton, info) {
    var availableFormats = info.calendar.dateTimeFormats.availableFormats;
    if (availableFormats[skeleton]) {
        return availableFormats[skeleton];
    }
    if (resolvedFormats[info.name] && resolvedFormats[info.name][skeleton]) {
        return resolvedFormats[info.name][skeleton];
    }
    var timeStartIndex = skeleton.search(TIME_SPECIFIERS_REGEX);
    var result;
    if (timeStartIndex > 0) {
        var dateSkeleton = skeleton.substr(0, timeStartIndex);
        var timeSkeleton = skeleton.substr(timeStartIndex);

        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_format_string__["a" /* default */])(info.calendar.dateTimeFormats.short, //should be deterimed based on specifiers
            availableFormats[timeSkeleton] || findBestMatch(skeletonSpecifiers(timeSkeleton), availableFormats),
            availableFormats[dateSkeleton] || findBestMatch(skeletonSpecifiers(dateSkeleton), availableFormats));
    } else {
        result = findBestMatch(skeletonSpecifiers(skeleton), availableFormats);
    }

    cacheFormat(skeleton, result, info.name);
    return result;
}

function skeletonFromOptions(options) {
    var result = [];
    for (var idx = 0; idx < DATE_OPTIONS_MAP.length; idx++) {
        var option = DATE_OPTIONS_MAP[idx];
        var field = option.key;
        var value = options[field];
        if (value) {
            var spcifier = option.specifier || option.getSpecifier(options);
            result.push(spcifier.repeat(VALUE_FORMAT_LENGTH[value]));
        }
    }

    return result.join(__WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */]);
}

function datePattern(format, info) {
    var calendar = info.calendar;
    var result;
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_is_string__["a" /* default */])(format)) {
        if (calendar.patterns[format]) {
            result = calendar.patterns[format];
        } else {
            result = format;
        }
    } else if (format) {
        if (format.pattern) {
            return format.pattern;
        }

        var skeleton = format.skeleton;
        if (!skeleton) {
            if (format.datetime) {
                result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_format_string__["a" /* default */])(calendar.dateTimeFormats[format.datetime], calendar.timeFormats[format.datetime], calendar.dateFormats[format.datetime]);
            } else if (format.date) {
                result = calendar.dateFormats[format.date];
            } else if (format.time) {
                result = calendar.timeFormats[format.time];
            } else {
                skeleton = skeletonFromOptions(format);
            }
        }

        if (skeleton) {
            result = skeletonFormat(skeleton, info);
        }
    }

    if (!result) {
        result = calendar.patterns.d;
    }

    return result;
}

//# sourceMappingURL=date-pattern.js.map


/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var from_1 = __webpack_require__(1059);
Observable_1.Observable.from = from_1.from;
//# sourceMappingURL=from.js.map

/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var of_1 = __webpack_require__(1061);
Observable_1.Observable.of = of_1.of;
//# sourceMappingURL=of.js.map

/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var bufferCount_1 = __webpack_require__(948);
Observable_1.Observable.prototype.bufferCount = bufferCount_1.bufferCount;
//# sourceMappingURL=bufferCount.js.map

/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var concatMap_1 = __webpack_require__(1064);
Observable_1.Observable.prototype.concatMap = concatMap_1.concatMap;
//# sourceMappingURL=concatMap.js.map

/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var debounceTime_1 = __webpack_require__(956);
Observable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime;
//# sourceMappingURL=debounceTime.js.map

/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var throttleTime_1 = __webpack_require__(1009);
Observable_1.Observable.prototype.throttleTime = throttleTime_1.throttleTime;
//# sourceMappingURL=throttleTime.js.map

/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 ArrayObservable_1 = __webpack_require__(82);
var isArray_1 = __webpack_require__(83);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
var none = {};
/* tslint:enable:max-line-length */
/**
 * Combines multiple Observables to create an Observable whose values are
 * calculated from the latest values of each of its input Observables.
 *
 * <span class="informal">Whenever any input Observable emits a value, it
 * computes a formula using the latest values from all the inputs, then emits
 * the output of that formula.</span>
 *
 * <img src="./img/combineLatest.png" width="100%">
 *
 * `combineLatest` combines the values from this Observable with values from
 * Observables passed as arguments. This is done by subscribing to each
 * Observable, in order, and collecting an array of each of the most recent
 * values any time any of the input Observables emits, then either taking that
 * array and passing it as arguments to an optional `project` function and
 * emitting the return value of that, or just emitting the array of recent
 * values directly if there is no `project` function.
 *
 * @example <caption>Dynamically calculate the Body-Mass Index from an Observable of weight and one for height</caption>
 * var weight = Rx.Observable.of(70, 72, 76, 79, 75);
 * var height = Rx.Observable.of(1.76, 1.77, 1.78);
 * var bmi = weight.combineLatest(height, (w, h) => w / (h * h));
 * bmi.subscribe(x => console.log('BMI is ' + x));
 *
 * // With output to console:
 * // BMI is 24.212293388429753
 * // BMI is 23.93948099205209
 * // BMI is 23.671253629592222
 *
 * @see {@link combineAll}
 * @see {@link merge}
 * @see {@link withLatestFrom}
 *
 * @param {ObservableInput} other An input Observable to combine with the source
 * Observable. More than one input Observables may be given as argument.
 * @param {function} [project] An optional function to project the values from
 * the combined latest values into a new value on the output Observable.
 * @return {Observable} An Observable of projected values from the most recent
 * values from each input Observable, or an array of the most recent values from
 * each input Observable.
 * @method combineLatest
 * @owner Observable
 */
function combineLatest() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    var project = null;
    if (typeof observables[observables.length - 1] === 'function') {
        project = observables.pop();
    }
    // if the first and only other argument besides the resultSelector is an array
    // assume it's been called with `combineLatest([obs1, obs2, obs3], project)`
    if (observables.length === 1 && isArray_1.isArray(observables[0])) {
        observables = observables[0].slice();
    }
    observables.unshift(this);
    return this.lift.call(new ArrayObservable_1.ArrayObservable(observables), new CombineLatestOperator(project));
}
exports.combineLatest = combineLatest;
var CombineLatestOperator = (function () {
    function CombineLatestOperator(project) {
        this.project = project;
    }
    CombineLatestOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new CombineLatestSubscriber(subscriber, this.project));
    };
    return CombineLatestOperator;
}());
exports.CombineLatestOperator = CombineLatestOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var CombineLatestSubscriber = (function (_super) {
    __extends(CombineLatestSubscriber, _super);
    function CombineLatestSubscriber(destination, project) {
        _super.call(this, destination);
        this.project = project;
        this.active = 0;
        this.values = [];
        this.observables = [];
    }
    CombineLatestSubscriber.prototype._next = function (observable) {
        this.values.push(none);
        this.observables.push(observable);
    };
    CombineLatestSubscriber.prototype._complete = function () {
        var observables = this.observables;
        var len = observables.length;
        if (len === 0) {
            this.destination.complete();
        }
        else {
            this.active = len;
            this.toRespond = len;
            for (var i = 0; i < len; i++) {
                var observable = observables[i];
                this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i));
            }
        }
    };
    CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
        if ((this.active -= 1) === 0) {
            this.destination.complete();
        }
    };
    CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var values = this.values;
        var oldVal = values[outerIndex];
        var toRespond = !this.toRespond
            ? 0
            : oldVal === none ? --this.toRespond : this.toRespond;
        values[outerIndex] = innerValue;
        if (toRespond === 0) {
            if (this.project) {
                this._tryProject(values);
            }
            else {
                this.destination.next(values.slice());
            }
        }
    };
    CombineLatestSubscriber.prototype._tryProject = function (values) {
        var result;
        try {
            result = this.project.apply(this, values);
        }
        catch (err) {
            this.destination.error(err);
            return;
        }
        this.destination.next(result);
    };
    return CombineLatestSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.CombineLatestSubscriber = CombineLatestSubscriber;
//# sourceMappingURL=combineLatest.js.map

/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var isScheduler_1 = __webpack_require__(57);
var ArrayObservable_1 = __webpack_require__(82);
var mergeAll_1 = __webpack_require__(521);
/* tslint:enable:max-line-length */
/**
 * Creates an output Observable which sequentially emits all values from every
 * given input Observable after the current Observable.
 *
 * <span class="informal">Concatenates multiple Observables together by
 * sequentially emitting their values, one Observable after the other.</span>
 *
 * <img src="./img/concat.png" width="100%">
 *
 * Joins this Observable with multiple other Observables by subscribing to them
 * one at a time, starting with the source, and merging their results into the
 * output Observable. Will wait for each Observable to complete before moving
 * on to the next.
 *
 * @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>
 * var timer = Rx.Observable.interval(1000).take(4);
 * var sequence = Rx.Observable.range(1, 10);
 * var result = timer.concat(sequence);
 * result.subscribe(x => console.log(x));
 *
 * // results in:
 * // 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10
 *
 * @example <caption>Concatenate 3 Observables</caption>
 * var timer1 = Rx.Observable.interval(1000).take(10);
 * var timer2 = Rx.Observable.interval(2000).take(6);
 * var timer3 = Rx.Observable.interval(500).take(10);
 * var result = timer1.concat(timer2, timer3);
 * result.subscribe(x => console.log(x));
 *
 * // results in the following:
 * // (Prints to console sequentially)
 * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9
 * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5
 * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9
 *
 * @see {@link concatAll}
 * @see {@link concatMap}
 * @see {@link concatMapTo}
 *
 * @param {ObservableInput} other An input Observable to concatenate after the source
 * Observable. More than one input Observables may be given as argument.
 * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each
 * Observable subscription on.
 * @return {Observable} All values of each passed Observable merged into a
 * single Observable, in order, in serial fashion.
 * @method concat
 * @owner Observable
 */
function concat() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    return this.lift.call(concatStatic.apply(void 0, [this].concat(observables)));
}
exports.concat = concat;
/* tslint:enable:max-line-length */
/**
 * Creates an output Observable which sequentially emits all values from given
 * Observable and then moves on to the next.
 *
 * <span class="informal">Concatenates multiple Observables together by
 * sequentially emitting their values, one Observable after the other.</span>
 *
 * <img src="./img/concat.png" width="100%">
 *
 * `concat` joins multiple Observables together, by subscribing to them one at a time and
 * merging their results into the output Observable. You can pass either an array of
 * Observables, or put them directly as arguments. Passing an empty array will result
 * in Observable that completes immediately.
 *
 * `concat` will subscribe to first input Observable and emit all its values, without
 * changing or affecting them in any way. When that Observable completes, it will
 * subscribe to then next Observable passed and, again, emit its values. This will be
 * repeated, until the operator runs out of Observables. When last input Observable completes,
 * `concat` will complete as well. At any given moment only one Observable passed to operator
 * emits values. If you would like to emit values from passed Observables concurrently, check out
 * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,
 * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.
 *
 * Note that if some input Observable never completes, `concat` will also never complete
 * and Observables following the one that did not complete will never be subscribed. On the other
 * hand, if some Observable simply completes immediately after it is subscribed, it will be
 * invisible for `concat`, which will just move on to the next Observable.
 *
 * If any Observable in chain errors, instead of passing control to the next Observable,
 * `concat` will error immediately as well. Observables that would be subscribed after
 * the one that emitted error, never will.
 *
 * If you pass to `concat` the same Observable many times, its stream of values
 * will be "replayed" on every subscription, which means you can repeat given Observable
 * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,
 * you can always use {@link repeat}.
 *
 * @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>
 * var timer = Rx.Observable.interval(1000).take(4);
 * var sequence = Rx.Observable.range(1, 10);
 * var result = Rx.Observable.concat(timer, sequence);
 * result.subscribe(x => console.log(x));
 *
 * // results in:
 * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10
 *
 *
 * @example <caption>Concatenate an array of 3 Observables</caption>
 * var timer1 = Rx.Observable.interval(1000).take(10);
 * var timer2 = Rx.Observable.interval(2000).take(6);
 * var timer3 = Rx.Observable.interval(500).take(10);
 * var result = Rx.Observable.concat([timer1, timer2, timer3]); // note that array is passed
 * result.subscribe(x => console.log(x));
 *
 * // results in the following:
 * // (Prints to console sequentially)
 * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9
 * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5
 * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9
 *
 *
 * @example <caption>Concatenate the same Observable to repeat it</caption>
 * const timer = Rx.Observable.interval(1000).take(2);
 *
 * Rx.Observable.concat(timer, timer) // concating the same Observable!
 * .subscribe(
 *   value => console.log(value),
 *   err => {},
 *   () => console.log('...and it is done!')
 * );
 *
 * // Logs:
 * // 0 after 1s
 * // 1 after 2s
 * // 0 after 3s
 * // 1 after 4s
 * // "...and it is done!" also after 4s
 *
 * @see {@link concatAll}
 * @see {@link concatMap}
 * @see {@link concatMapTo}
 *
 * @param {ObservableInput} input1 An input Observable to concatenate with others.
 * @param {ObservableInput} input2 An input Observable to concatenate with others.
 * More than one input Observables may be given as argument.
 * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each
 * Observable subscription on.
 * @return {Observable} All values of each passed Observable merged into a
 * single Observable, in order, in serial fashion.
 * @static true
 * @name concat
 * @owner Observable
 */
function concatStatic() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    var scheduler = null;
    var args = observables;
    if (isScheduler_1.isScheduler(args[observables.length - 1])) {
        scheduler = args.pop();
    }
    if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) {
        return observables[0];
    }
    return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new mergeAll_1.MergeAllOperator(1));
}
exports.concatStatic = concatStatic;
//# sourceMappingURL=concat.js.map

/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 ArrayObservable_1 = __webpack_require__(82);
var isArray_1 = __webpack_require__(83);
var Subscriber_1 = __webpack_require__(6);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
var iterator_1 = __webpack_require__(112);
/* tslint:enable:max-line-length */
/**
 * @param observables
 * @return {Observable<R>}
 * @method zip
 * @owner Observable
 */
function zipProto() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    return this.lift.call(zipStatic.apply(void 0, [this].concat(observables)));
}
exports.zipProto = zipProto;
/* tslint:enable:max-line-length */
/**
 * Combines multiple Observables to create an Observable whose values are calculated from the values, in order, of each
 * of its input Observables.
 *
 * If the latest parameter is a function, this function is used to compute the created value from the input values.
 * Otherwise, an array of the input values is returned.
 *
 * @example <caption>Combine age and name from different sources</caption>
 *
 * let age$ = Observable.of<number>(27, 25, 29);
 * let name$ = Observable.of<string>('Foo', 'Bar', 'Beer');
 * let isDev$ = Observable.of<boolean>(true, true, false);
 *
 * Observable
 *     .zip(age$,
 *          name$,
 *          isDev$,
 *          (age: number, name: string, isDev: boolean) => ({ age, name, isDev }))
 *     .subscribe(x => console.log(x));
 *
 * // outputs
 * // { age: 27, name: 'Foo', isDev: true }
 * // { age: 25, name: 'Bar', isDev: true }
 * // { age: 29, name: 'Beer', isDev: false }
 *
 * @param observables
 * @return {Observable<R>}
 * @static true
 * @name zip
 * @owner Observable
 */
function zipStatic() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    var project = observables[observables.length - 1];
    if (typeof project === 'function') {
        observables.pop();
    }
    return new ArrayObservable_1.ArrayObservable(observables).lift(new ZipOperator(project));
}
exports.zipStatic = zipStatic;
var ZipOperator = (function () {
    function ZipOperator(project) {
        this.project = project;
    }
    ZipOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ZipSubscriber(subscriber, this.project));
    };
    return ZipOperator;
}());
exports.ZipOperator = ZipOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ZipSubscriber = (function (_super) {
    __extends(ZipSubscriber, _super);
    function ZipSubscriber(destination, project, values) {
        if (values === void 0) { values = Object.create(null); }
        _super.call(this, destination);
        this.iterators = [];
        this.active = 0;
        this.project = (typeof project === 'function') ? project : null;
        this.values = values;
    }
    ZipSubscriber.prototype._next = function (value) {
        var iterators = this.iterators;
        if (isArray_1.isArray(value)) {
            iterators.push(new StaticArrayIterator(value));
        }
        else if (typeof value[iterator_1.iterator] === 'function') {
            iterators.push(new StaticIterator(value[iterator_1.iterator]()));
        }
        else {
            iterators.push(new ZipBufferIterator(this.destination, this, value));
        }
    };
    ZipSubscriber.prototype._complete = function () {
        var iterators = this.iterators;
        var len = iterators.length;
        if (len === 0) {
            this.destination.complete();
            return;
        }
        this.active = len;
        for (var i = 0; i < len; i++) {
            var iterator = iterators[i];
            if (iterator.stillUnsubscribed) {
                this.add(iterator.subscribe(iterator, i));
            }
            else {
                this.active--; // not an observable
            }
        }
    };
    ZipSubscriber.prototype.notifyInactive = function () {
        this.active--;
        if (this.active === 0) {
            this.destination.complete();
        }
    };
    ZipSubscriber.prototype.checkIterators = function () {
        var iterators = this.iterators;
        var len = iterators.length;
        var destination = this.destination;
        // abort if not all of them have values
        for (var i = 0; i < len; i++) {
            var iterator = iterators[i];
            if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
                return;
            }
        }
        var shouldComplete = false;
        var args = [];
        for (var i = 0; i < len; i++) {
            var iterator = iterators[i];
            var result = iterator.next();
            // check to see if it's completed now that you've gotten
            // the next value.
            if (iterator.hasCompleted()) {
                shouldComplete = true;
            }
            if (result.done) {
                destination.complete();
                return;
            }
            args.push(result.value);
        }
        if (this.project) {
            this._tryProject(args);
        }
        else {
            destination.next(args);
        }
        if (shouldComplete) {
            destination.complete();
        }
    };
    ZipSubscriber.prototype._tryProject = function (args) {
        var result;
        try {
            result = this.project.apply(this, args);
        }
        catch (err) {
            this.destination.error(err);
            return;
        }
        this.destination.next(result);
    };
    return ZipSubscriber;
}(Subscriber_1.Subscriber));
exports.ZipSubscriber = ZipSubscriber;
var StaticIterator = (function () {
    function StaticIterator(iterator) {
        this.iterator = iterator;
        this.nextResult = iterator.next();
    }
    StaticIterator.prototype.hasValue = function () {
        return true;
    };
    StaticIterator.prototype.next = function () {
        var result = this.nextResult;
        this.nextResult = this.iterator.next();
        return result;
    };
    StaticIterator.prototype.hasCompleted = function () {
        var nextResult = this.nextResult;
        return nextResult && nextResult.done;
    };
    return StaticIterator;
}());
var StaticArrayIterator = (function () {
    function StaticArrayIterator(array) {
        this.array = array;
        this.index = 0;
        this.length = 0;
        this.length = array.length;
    }
    StaticArrayIterator.prototype[iterator_1.iterator] = function () {
        return this;
    };
    StaticArrayIterator.prototype.next = function (value) {
        var i = this.index++;
        var array = this.array;
        return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
    };
    StaticArrayIterator.prototype.hasValue = function () {
        return this.array.length > this.index;
    };
    StaticArrayIterator.prototype.hasCompleted = function () {
        return this.array.length === this.index;
    };
    return StaticArrayIterator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ZipBufferIterator = (function (_super) {
    __extends(ZipBufferIterator, _super);
    function ZipBufferIterator(destination, parent, observable) {
        _super.call(this, destination);
        this.parent = parent;
        this.observable = observable;
        this.stillUnsubscribed = true;
        this.buffer = [];
        this.isComplete = false;
    }
    ZipBufferIterator.prototype[iterator_1.iterator] = function () {
        return this;
    };
    // NOTE: there is actually a name collision here with Subscriber.next and Iterator.next
    //    this is legit because `next()` will never be called by a subscription in this case.
    ZipBufferIterator.prototype.next = function () {
        var buffer = this.buffer;
        if (buffer.length === 0 && this.isComplete) {
            return { value: null, done: true };
        }
        else {
            return { value: buffer.shift(), done: false };
        }
    };
    ZipBufferIterator.prototype.hasValue = function () {
        return this.buffer.length > 0;
    };
    ZipBufferIterator.prototype.hasCompleted = function () {
        return this.buffer.length === 0 && this.isComplete;
    };
    ZipBufferIterator.prototype.notifyComplete = function () {
        if (this.buffer.length > 0) {
            this.isComplete = true;
            this.parent.notifyInactive();
        }
        else {
            this.destination.complete();
        }
    };
    ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.buffer.push(innerValue);
        this.parent.checkIterators();
    };
    ZipBufferIterator.prototype.subscribe = function (value, index) {
        return subscribeToResult_1.subscribeToResult(this, this.observable, this, index);
    };
    return ZipBufferIterator;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=zip.js.map

/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(28);

/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(39);

/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(6);

/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(84);

/***/ }),
/* 253 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export CALENDAR_VALUE_ACCESSOR */
/* unused harmony export CALENDAR_RANGE_VALIDATORS */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CalendarComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_component__ = __webpack_require__(256);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__view_list_component__ = __webpack_require__(263);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__services_dom_service__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__services_bus_view_service__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_navigation_service__ = __webpack_require__(260);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__services_scroll_sync_service__ = __webpack_require__(537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__templates_cell_template_directive__ = __webpack_require__(154);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__templates_month_cell_template_directive__ = __webpack_require__(157);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__templates_year_cell_template_directive__ = __webpack_require__(159);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__templates_decade_cell_template_directive__ = __webpack_require__(156);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__templates_century_cell_template_directive__ = __webpack_require__(155);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__templates_weeknumber_cell_template_directive__ = __webpack_require__(158);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__models_view_enum__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__validators_min_validator__ = __webpack_require__(165);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__validators_max_validator__ = __webpack_require__(164);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__util__ = __webpack_require__(14);
/* tslint:disable:no-forward-ref */





















var BOTTOM_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';
var TOP_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';
var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';
var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-max';
var VALUE_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/calendar/#toc-using-with-json';
var virtualizationProp = function (x) { return x ? x.virtualization : null; };
/**
 * @hidden
 */
var CALENDAR_VALUE_ACCESSOR = {
    multi: true,
    provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],
    useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare
};
/**
 * @hidden
 */
var CALENDAR_RANGE_VALIDATORS = {
    multi: true,
    provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALIDATORS"],
    useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare
};
/**
 * Represents the Kendo UI Calendar component for Angular.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-calendar></kendo-calendar>
 * `
 * })
 * class AppComponent { }
 * ```
 */
var CalendarComponent = (function () {
    function CalendarComponent(bus, dom, element, navigator, renderer, cdr, scrollSyncService) {
        this.bus = bus;
        this.dom = dom;
        this.element = element;
        this.navigator = navigator;
        this.renderer = renderer;
        this.cdr = cdr;
        this.scrollSyncService = scrollSyncService;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["g" /* guid */])();
        /**
         * Determines whether the built-in min or max validators are enforced when validating a form.
         */
        this.rangeValidation = false;
        /**
         * Sets or gets the `disabled` property of the Calendar and determines whether the component is active.
         */
        this.disabled = false;
        /**
         * Sets or gets the `tabIndex` property of the Calendar. Based on the
         * [HTML `tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) behavior,
         * it determines whether the component is focusable.
         * .
         */
        this.tabIndex = 0;
        /**
         * Sets or gets the `navigation` property of the Calendar.
         * and determines whether the navigation side-bar is displayed.
         */
        this.navigation = true;
        /**
         * Defines the active view that the Calendar initially renders.
         * By default, the active view is `month`.
         *
         * > You have to set `activeView` within the `topView`-`bottomView` range.
         */
        this.activeView = __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].month];
        /**
         * Defines the bottommost view, to which the user can navigate.
         */
        this.bottomView = __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].month];
        /**
         * Defines the topmost view, to which the user can navigate.
         */
        this.topView = __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].century];
        /**
         * Determines whether to display a week number column in the `month` view.
         */
        this.weekNumber = false;
        /**
         * Fires when the active view is changed.
         *
         * For more details, refer to the section on [events]({% slug overview_calendar %}#toc-events).
         */
        this.activeViewChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the active view date is changed.
         *
         * For more details, refer to the section on [events]({% slug overview_calendar %}#toc-events).
         */
        this.activeViewDateChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the value is changed.
         *
         * For more details, refer to the section on [events]({% slug overview_calendar %}#toc-events).
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.isActive = false;
        this.cellUID = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["g" /* guid */])();
        this._min = new Date(__WEBPACK_IMPORTED_MODULE_19__defaults__["d" /* MIN_DATE */]);
        this._max = new Date(__WEBPACK_IMPORTED_MODULE_19__defaults__["e" /* MAX_DATE */]);
        this._focusedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["r" /* getToday */])();
        this.propagateChange = __WEBPACK_IMPORTED_MODULE_20__util__["h" /* noop */];
        this.propagateTouched = __WEBPACK_IMPORTED_MODULE_20__util__["h" /* noop */];
        this.minValidateFn = __WEBPACK_IMPORTED_MODULE_20__util__["h" /* noop */];
        this.maxValidateFn = __WEBPACK_IMPORTED_MODULE_20__util__["h" /* noop */];
        this.syncNavigation = true;
        this.setClasses(element.nativeElement);
    }
    Object.defineProperty(CalendarComponent.prototype, "focusedDate", {
        get: function () {
            return this._focusedDate;
        },
        /**
         * Sets or gets the `focusedDate` property of the Calendar and defines the focused date of the component.
         *
         * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
         */
        set: function (focusedDate) {
            this._focusedDate = focusedDate || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["r" /* getToday */])();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "min", {
        get: function () {
            return this._min;
        },
        /**
         * Sets or gets the `min` property of the Calendar and defines the minimum allowed date value.
         * By default, the `min` value is `1900-1-1`.
         */
        set: function (min) {
            this._min = min || new Date(__WEBPACK_IMPORTED_MODULE_19__defaults__["d" /* MIN_DATE */]);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "max", {
        get: function () {
            return this._max;
        },
        /**
         * Sets or gets the `max` property of the Calendar and defines the maximum allowed date value.
         * By default, the `max` value is `2099-12-31`.
         */
        set: function (max) {
            this._max = max || new Date(__WEBPACK_IMPORTED_MODULE_19__defaults__["e" /* MAX_DATE */]);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "value", {
        /**
         * Sets or gets the `value` property of the Calendar and defines the selected value of the component.
         *
         * > The `value` has to be a valid
         * [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
         */
        get: function () {
            return this._value;
        },
        set: function (candidate) {
            this.verifyValue(candidate);
            this._value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "activeViewEnum", {
        get: function () {
            var activeView = __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][this.activeView];
            return activeView < this.bottomViewEnum ? this.bottomViewEnum : activeView;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "bottomViewEnum", {
        get: function () {
            return __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][this.bottomView];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "topViewEnum", {
        get: function () {
            return __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][this.topView];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "widgetId", {
        get: function () {
            return this.id;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "widgetRole", {
        get: function () {
            return 'grid';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
        get: function () {
            return this.disabled ? undefined : this.tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CalendarComponent.prototype, "ariaActivedescendant", {
        get: function () {
            return this.cellUID + this.focusedDate.getTime();
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    CalendarComponent.prototype.handleBlur = function () {
        this.propagateTouched();
        this.isActive = false;
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.handleFocus = function () {
        this.isActive = true;
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.handleMousedown = function (event) {
        event.preventDefault();
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.handleClick = function () {
        if (!this.isActive) {
            if (this.monthView.isScrolled()) {
                this.focusedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(this.focusedDate); //XXX: forces change detect
            }
            this.focus();
        }
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.keydown = function (event) {
        var candidate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["l" /* dateInRange */])(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["b" /* isEqual */])(this.focusedDate, candidate)) {
            return;
        }
        this.focusedDate = candidate;
        event.preventDefault();
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.enter = function () {
        this.handleDateChange(this.focusedDate);
    };
    CalendarComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.dom.calculateHeights(this.element.nativeElement);
        this.scrollSyncService.configure(this.activeViewEnum);
        this.bus.viewChanged.subscribe(function (_a) {
            var view = _a.view;
            _this.activeView = __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */][view];
            _this.activeViewChange.emit(_this.activeView);
            _this.scrollSyncService.configure(view);
        });
    };
    CalendarComponent.prototype.ngOnChanges = function (changes) {
        this.verifyChanges();
        this.bus.configure(this.bottomViewEnum, this.topViewEnum);
        this.scrollSyncService.configure(this.activeViewEnum);
        var useValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["u" /* hasExistingValue */])(changes, 'value') && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["u" /* hasExistingValue */])(changes, 'focusedDate');
        var focusedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["l" /* dateInRange */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(useValue ? this.value : this.focusedDate), this.min, this.max);
        this.focusedDate = !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["b" /* isEqual */])(this.focusedDate, focusedDate) ? focusedDate : this.focusedDate;
        if (changes.navigation) {
            this.syncNavigation = true;
        }
        if (changes.min || changes.max) {
            this.minValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_17__validators_min_validator__["a" /* minValidator */])(this.min) : __WEBPACK_IMPORTED_MODULE_20__util__["h" /* noop */];
            this.maxValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_18__validators_max_validator__["a" /* maxValidator */])(this.max) : __WEBPACK_IMPORTED_MODULE_20__util__["h" /* noop */];
        }
    };
    CalendarComponent.prototype.ngAfterViewChecked = function () {
        if (!this.syncNavigation) {
            return;
        }
        this.syncNavigation = false;
        this.scrollSyncService.sync(virtualizationProp(this.navigationView), virtualizationProp(this.monthView));
    };
    CalendarComponent.prototype.ngOnDestroy = function () {
        this.scrollSyncService.destroy();
    };
    /**
     * Focuses the host element of the Calendar.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="calendar.focus()">Focus calendar</button>
     *  <kendo-calendar #calendar></kendo-calendar>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    CalendarComponent.prototype.focus = function () {
        if (!this.element) {
            return;
        }
        this.element.nativeElement.focus();
    };
    /**
     * Blurs the Calendar component.
     */
    CalendarComponent.prototype.blur = function () {
        if (!this.element) {
            return;
        }
        this.element.nativeElement.blur();
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.handleNavigation = function (candidate) {
        if (this.disabled) {
            return;
        }
        this.focusedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate) || this.focusedDate;
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.handleDateChange = function (candidate) {
        var canNavigateDown = this.bus.canMoveDown(this.activeViewEnum);
        var isSameDate = !canNavigateDown && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["b" /* isEqual */])(candidate, this.value);
        this.focusedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate) || this.focusedDate;
        if (this.disabled || isSameDate) {
            return;
        }
        if (canNavigateDown) {
            this.bus.moveDown(this.activeViewEnum);
            return;
        }
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate);
        this.propagateChange(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate));
        this.valueChange.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate));
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.writeValue = function (candidate) {
        this.verifyValue(candidate);
        this.focusedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_20__util__["l" /* dateInRange */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate) || this.focusedDate, this.min, this.max);
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(candidate);
        this.cdr.markForCheck();
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.registerOnChange = function (fn) {
        this.propagateChange = fn;
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.registerOnTouched = function (fn) {
        this.propagateTouched = fn;
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.validate = function (control) {
        return this.minValidateFn(control) || this.maxValidateFn(control);
    };
    /**
     * @hidden
     */
    CalendarComponent.prototype.activeCellTemplate = function () {
        switch (this.activeViewEnum) {
            case __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].month:
                return this.monthCellTemplate || this.cellTemplate;
            case __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].year:
                return this.yearCellTemplate;
            case __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].decade:
                return this.decadeCellTemplate;
            case __WEBPACK_IMPORTED_MODULE_16__models_view_enum__["a" /* CalendarViewEnum */].century:
                return this.centuryCellTemplate;
            default:
                return null;
        }
    };
    CalendarComponent.prototype.setClasses = function (element) {
        this.renderer.addClass(element, 'k-widget');
        this.renderer.addClass(element, 'k-calendar');
        this.renderer.addClass(element, 'k-calendar-infinite');
    };
    CalendarComponent.prototype.verifyChanges = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (this.min > this.max) {
            throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + ".");
        }
        if (this.bottomViewEnum > this.topViewEnum) {
            throw new Error("The topView should be greater than bottomView. See " + BOTTOM_VIEW_DOC_LINK + " and " + TOP_VIEW_DOC_LINK + ".");
        }
    };
    CalendarComponent.prototype.verifyValue = function (candidate) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (candidate && !(candidate instanceof Date)) {
            throw new Error("The 'value' should be a valid JavaScript Date instance. Check " + VALUE_DOC_LINK + " for possible resolution.");
        }
    };
    return CalendarComponent;
}());

CalendarComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                exportAs: 'kendo-calendar',
                providers: [
                    CALENDAR_VALUE_ACCESSOR,
                    CALENDAR_RANGE_VALIDATORS,
                    __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */],
                        useValue: 'kendo.calendar'
                    },
                    __WEBPACK_IMPORTED_MODULE_9__services_scroll_sync_service__["a" /* ScrollSyncService */]
                ],
                selector: 'kendo-calendar',
                template: "\n    <ng-container kendoCalendarLocalizedMessages\n        i18n-today=\"kendo.calendar.today|The label for the today button in the calendar header\"\n        today=\"TODAY\"\n    >\n    </ng-container>\n    <kendo-calendar-navigation\n        *ngIf=\"navigation\"\n        [activeView]=\"activeViewEnum\"\n        [focusedDate]=\"focusedDate\"\n        [min]=\"min\"\n        [max]=\"max\"\n        (valueChange)=\"handleNavigation($event)\"\n    >\n    </kendo-calendar-navigation>\n    <kendo-calendar-viewlist\n        [activeView]=\"activeViewEnum\"\n        [isActive]=\"isActive\"\n        [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n        [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n        [cellUID]=\"cellUID\"\n        [min]=\"min\"\n        [max]=\"max\"\n        [focusedDate]=\"focusedDate\"\n        [weekNumber]=\"weekNumber\"\n        [value]=\"value\"\n        (valueChange)=\"handleDateChange($event)\"\n        (activeDateChange)=\"activeViewDateChange.emit($event)\"\n    >\n    </kendo-calendar-viewlist>\n  "
            },] },
];
/** @nocollapse */
CalendarComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_7__services_bus_view_service__["a" /* BusViewService */], },
    { type: __WEBPACK_IMPORTED_MODULE_6__services_dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_8__services_navigation_service__["a" /* NavigationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_9__services_scroll_sync_service__["a" /* ScrollSyncService */], },
]; };
CalendarComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focusedDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rangeValidation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'navigation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'bottomView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'topView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'weekNumber': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeViewChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'activeViewDateChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'cellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_10__templates_cell_template_directive__["a" /* CellTemplateDirective */],] },],
    'monthCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_11__templates_month_cell_template_directive__["a" /* MonthCellTemplateDirective */],] },],
    'yearCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_12__templates_year_cell_template_directive__["a" /* YearCellTemplateDirective */],] },],
    'decadeCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_13__templates_decade_cell_template_directive__["a" /* DecadeCellTemplateDirective */],] },],
    'centuryCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_14__templates_century_cell_template_directive__["a" /* CenturyCellTemplateDirective */],] },],
    'weekNumberTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_15__templates_weeknumber_cell_template_directive__["a" /* WeekNumberCellTemplateDirective */],] },],
    'navigationView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_4__navigation_component__["a" /* NavigationComponent */],] },],
    'monthView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_5__view_list_component__["a" /* ViewListComponent */],] },],
    'widgetId': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.id',] },],
    'widgetRole': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.role',] },],
    'calendarTabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.tabindex',] },],
    'ariaDisabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-disabled',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'ariaActivedescendant': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-activedescendant',] },],
    'handleBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["blur",] },],
    'handleFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["focus",] },],
    'handleMousedown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["mousedown", ['$event'],] },],
    'handleClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["click",] },],
    'keydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["keydown", ["$event"],] },],
    'enter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["keydown.enter",] },],
};


/***/ }),
/* 254 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CalendarCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(255);




/**
 * Custom component messages override default component messages.
 */
var CalendarCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](CalendarCustomMessagesComponent, _super);
    function CalendarCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(CalendarCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return CalendarCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

CalendarCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return CalendarCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-calendar-messages',
                template: ""
            },] },
];
/** @nocollapse */
CalendarCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 255 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'today': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 256 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavigationComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_bus_view_service__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_dom_service__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__virtualization_virtualization_component__ = __webpack_require__(115);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(14);
/* tslint:disable:component-selector-name  component-selector-type */







var ITEMS_COUNT = 30;
/**
 * @hidden
 */
var NavigationComponent = (function () {
    function NavigationComponent(bus, dom) {
        this.bus = bus;
        this.dom = dom;
        this.min = new Date(__WEBPACK_IMPORTED_MODULE_4__defaults__["d" /* MIN_DATE */]);
        this.max = new Date(__WEBPACK_IMPORTED_MODULE_4__defaults__["e" /* MAX_DATE */]);
        this.focusedDate = new Date();
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.dates = [];
        this.take = ITEMS_COUNT;
        this.indexToScroll = -1;
    }
    Object.defineProperty(NavigationComponent.prototype, "getComponentClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    NavigationComponent.prototype.ngOnInit = function () {
        this.dom.ensureHeights();
        var calendarHeight = this.dom.calendarHeight;
        this.itemHeight = this.dom.navigationItemHeight;
        this.maxViewHeight = this.dom.monthViewHeight;
        this.topOffset = (calendarHeight - this.itemHeight) / 2;
        this.bottomOffset = calendarHeight - this.itemHeight;
    };
    NavigationComponent.prototype.ngOnChanges = function (changes) {
        this.service = this.bus.service(this.activeView);
        if (!this.service) {
            return;
        }
        var viewDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["l" /* dateInRange */])(this.focusedDate, this.min, this.max);
        var total = this.service.total(this.min, this.max);
        var totalChanged = this.total && this.total !== total;
        this.skip = this.service.skip(viewDate, this.min);
        this.total = total;
        if (totalChanged || !this.service.isInArray(viewDate, this.dates)) {
            this.dates = this.service.datesList(viewDate, this.getTake(this.skip));
        }
        if (!!changes.focusedDate || totalChanged) {
            this.indexToScroll = this.service.skip(this.focusedDate, this.min);
        }
    };
    NavigationComponent.prototype.ngAfterViewInit = function () {
        if (this.indexToScroll === -1) {
            return;
        }
        this.virtualization.scrollToIndex(this.indexToScroll);
        this.indexToScroll = -1;
    };
    NavigationComponent.prototype.ngAfterViewChecked = function () {
        if (this.indexToScroll === -1) {
            return;
        }
        this.virtualization.scrollToIndex(this.indexToScroll);
        this.indexToScroll = -1;
    };
    NavigationComponent.prototype.pageChange = function (_a) {
        var skip = _a.skip;
        this.dates = this.service.datesList(this.service.addToDate(this.min, skip), this.getTake(skip));
    };
    NavigationComponent.prototype.scrollChange = function (_a) {
        var offset = _a.offset;
        var translate = "translateY(" + offset + "px)";
        this.style = { transform: translate, '-ms-transform': translate };
    };
    NavigationComponent.prototype.handleDateChange = function (candidate) {
        this.valueChange.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__progress_kendo_date_math__["a" /* cloneDate */])(candidate));
    };
    NavigationComponent.prototype.getTake = function (skip) {
        return Math.min(this.total - skip, this.take);
    };
    return NavigationComponent;
}());

NavigationComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-calendar-navigation',
                template: "\n    <span class=\"k-calendar-navigation-highlight\"></span>\n    <kendo-virtualization\n        [skip]=\"skip\"\n        [take]=\"take\"\n        [total]=\"total\"\n        [itemHeight]=\"itemHeight\"\n        [topOffset]=\"topOffset\"\n        [bottomOffset]=\"bottomOffset\"\n        [maxScrollDifference]=\"maxViewHeight\"\n        (pageChange)=\"pageChange($event)\"\n        (scrollChange)=\"scrollChange($event)\"\n    >\n        <ul [ngStyle]=\"style\" class=\"k-reset\">\n            <li *kFor=\"let date of dates\" (click)=\"handleDateChange(date)\">\n                <span [class.k-calendar-navigation-marker]=\"service.isRangeStart(date)\">\n                    {{service.navigationTitle(date)}}\n                </span>\n            </li>\n        </ul>\n    </kendo-virtualization>\n  "
            },] },
];
/** @nocollapse */
NavigationComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__services_bus_view_service__["a" /* BusViewService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__services_dom_service__["a" /* DOMService */], },
]; };
NavigationComponent.propDecorators = {
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focusedDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'virtualization': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_3__virtualization_virtualization_component__["a" /* VirtualizationComponent */],] },],
    'getComponentClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-navigation",] },],
};


/***/ }),
/* 257 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CenturyViewService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__ = __webpack_require__(85);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(14);




var EMPTY_DATA = [[]];
var CELLS_LENGTH = 5;
var ROWS_LENGTH = 2;
var ACTIONS = (_a = {},
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Left] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Up] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, -5); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Right] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Down] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, 5); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].PrevView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["t" /* addCenturies */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].NextView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["t" /* addCenturies */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].FirstInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["u" /* firstDecadeOfCentury */])(date); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].LastInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["v" /* lastDecadeOfCentury */])(date); },
    _a);
/**
 * @hidden
 */
var CenturyViewService = (function () {
    function CenturyViewService() {
    }
    CenturyViewService.prototype.addToDate = function (min, skip) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["t" /* addCenturies */])(min, skip);
    };
    CenturyViewService.prototype.datesList = function (start, count) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* range */])(0, count).map(function (i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["t" /* addCenturies */])(start, i); });
    };
    CenturyViewService.prototype.data = function (options) {
        var _this = this;
        var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, viewDate = options.viewDate;
        if (!viewDate) {
            return EMPTY_DATA;
        }
        var cells = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* range */])(0, CELLS_LENGTH);
        var firstDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["u" /* firstDecadeOfCentury */])(viewDate);
        var isSelectedDateInRange = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* isInRange */])(selectedDate, min, max);
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* range */])(0, ROWS_LENGTH).map(function (rowOffset) {
            var baseDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(firstDate, rowOffset * CELLS_LENGTH);
            return cells.map(function (cellOffset) {
                var cellDate = _this.normalize(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(baseDate, cellOffset), min, max);
                if (!_this.isInRange(cellDate, min, max)) {
                    return null;
                }
                return {
                    formattedValue: _this.value(cellDate),
                    id: "" + cellUID + cellDate.getTime(),
                    isFocused: _this.isEqual(cellDate, focusedDate),
                    isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),
                    isWeekend: false,
                    title: _this.cellTitle(cellDate),
                    value: cellDate
                };
            });
        });
    };
    CenturyViewService.prototype.isEqual = function (candidate, expected) {
        if (!candidate || !expected) {
            return false;
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(candidate).getFullYear() === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(expected).getFullYear();
    };
    CenturyViewService.prototype.isInArray = function (date, dates) {
        if (!dates.length) {
            return false;
        }
        var year = date.getFullYear();
        return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 99);
    };
    CenturyViewService.prototype.isInRange = function (candidate, min, max) {
        var year = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(candidate).getFullYear();
        var aboveMin = !min || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(min).getFullYear() <= year;
        var belowMax = !max || year <= __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(max).getFullYear();
        return aboveMin && belowMax;
    };
    CenturyViewService.prototype.isRangeStart = function (value) {
        return value.getFullYear() % 1000 === 0;
    };
    CenturyViewService.prototype.move = function (value, action) {
        var modifier = ACTIONS[action];
        if (!modifier) {
            return value;
        }
        return modifier(value);
    };
    CenturyViewService.prototype.cellTitle = function (value) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(value).getFullYear().toString();
    };
    CenturyViewService.prototype.navigationTitle = function (value) {
        return value ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["u" /* firstDecadeOfCentury */])(value).getFullYear().toString() : '';
    };
    CenturyViewService.prototype.title = function (value) {
        if (!value) {
            return '';
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["u" /* firstDecadeOfCentury */])(value).getFullYear() + " - " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["v" /* lastDecadeOfCentury */])(value).getFullYear();
    };
    CenturyViewService.prototype.rowLength = function (_) {
        return CELLS_LENGTH;
    };
    CenturyViewService.prototype.skip = function (value, min) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["w" /* durationInCenturies */])(min, value);
    };
    CenturyViewService.prototype.total = function (min, max) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["w" /* durationInCenturies */])(min, max) + 1;
    };
    CenturyViewService.prototype.value = function (current) {
        return current ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(current).getFullYear().toString() : '';
    };
    CenturyViewService.prototype.viewDate = function (date, max, border) {
        if (border === void 0) { border = 1; }
        var renderTwoViews = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["w" /* durationInCenturies */])(date, max) < border;
        return renderTwoViews ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["t" /* addCenturies */])(date, -1) : date;
    };
    CenturyViewService.prototype.normalize = function (cellDate, min, max) {
        if (cellDate < min && this.isEqual(cellDate, min)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["a" /* cloneDate */])(min);
        }
        if (cellDate > max && this.isEqual(cellDate, max)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["a" /* cloneDate */])(max);
        }
        return cellDate;
    };
    return CenturyViewService;
}());

CenturyViewService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
CenturyViewService.ctorParameters = function () { return []; };
var _a;


/***/ }),
/* 258 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DecadeViewService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__ = __webpack_require__(85);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(14);




var EMPTY_DATA = [[]];
var CELLS_LENGTH = 5;
var ROWS_LENGTH = 2;
var ACTIONS = (_a = {},
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Left] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["h" /* addYears */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Up] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["h" /* addYears */])(date, -5); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Right] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["h" /* addYears */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].Down] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["h" /* addYears */])(date, 5); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].PrevView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].NextView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].FirstInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(date); },
    _a[__WEBPACK_IMPORTED_MODULE_2__models_navigation_action_enum__["a" /* Action */].LastInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["r" /* lastYearOfDecade */])(date); },
    _a);
/**
 * @hidden
 */
var DecadeViewService = (function () {
    function DecadeViewService() {
    }
    DecadeViewService.prototype.addToDate = function (min, skip) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(min, skip);
    };
    DecadeViewService.prototype.datesList = function (start, count) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* range */])(0, count).map(function (i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(start, i); });
    };
    DecadeViewService.prototype.data = function (options) {
        var _this = this;
        var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, viewDate = options.viewDate;
        if (!viewDate) {
            return EMPTY_DATA;
        }
        var cells = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* range */])(0, CELLS_LENGTH);
        var firstDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(viewDate);
        var isSelectedDateInRange = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["i" /* isInRange */])(selectedDate, min, max);
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* range */])(0, ROWS_LENGTH).map(function (rowOffset) {
            var baseDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["h" /* addYears */])(firstDate, rowOffset * CELLS_LENGTH);
            return cells.map(function (cellOffset) {
                var cellDate = _this.normalize(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["h" /* addYears */])(baseDate, cellOffset), min, max);
                if (!_this.isInRange(cellDate, min, max)) {
                    return null;
                }
                return {
                    formattedValue: _this.value(cellDate),
                    id: "" + cellUID + cellDate.getTime(),
                    isFocused: _this.isEqual(cellDate, focusedDate),
                    isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),
                    isWeekend: false,
                    title: _this.cellTitle(cellDate),
                    value: cellDate
                };
            });
        });
    };
    DecadeViewService.prototype.isEqual = function (candidate, expected) {
        if (!candidate || !expected) {
            return false;
        }
        return candidate.getFullYear() === expected.getFullYear();
    };
    DecadeViewService.prototype.isInArray = function (date, dates) {
        if (!dates.length) {
            return false;
        }
        var year = date.getFullYear();
        return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 9);
    };
    DecadeViewService.prototype.isInRange = function (candidate, min, max) {
        var year = candidate.getFullYear();
        var aboveMin = !min || min.getFullYear() <= year;
        var belowMax = !max || year <= max.getFullYear();
        return aboveMin && belowMax;
    };
    DecadeViewService.prototype.isRangeStart = function (value) {
        return value.getFullYear() % 100 === 0;
    };
    DecadeViewService.prototype.move = function (value, action) {
        var modifier = ACTIONS[action];
        if (!modifier) {
            return value;
        }
        return modifier(value);
    };
    DecadeViewService.prototype.cellTitle = function (value) {
        return value.getFullYear().toString();
    };
    DecadeViewService.prototype.navigationTitle = function (value) {
        return value ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(value).getFullYear().toString() : '';
    };
    DecadeViewService.prototype.title = function (value) {
        if (!value) {
            return '';
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["q" /* firstYearOfDecade */])(value).getFullYear() + " - " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["r" /* lastYearOfDecade */])(value).getFullYear();
    };
    DecadeViewService.prototype.rowLength = function (_) {
        return CELLS_LENGTH;
    };
    DecadeViewService.prototype.skip = function (value, min) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["s" /* durationInDecades */])(min, value);
    };
    DecadeViewService.prototype.total = function (min, max) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["s" /* durationInDecades */])(min, max) + 1;
    };
    DecadeViewService.prototype.value = function (current) {
        return current ? current.getFullYear().toString() : '';
    };
    DecadeViewService.prototype.viewDate = function (date, max, border) {
        if (border === void 0) { border = 1; }
        var renderTwoViews = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["s" /* durationInDecades */])(date, max) < border;
        return renderTwoViews ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["p" /* addDecades */])(date, -1) : date;
    };
    DecadeViewService.prototype.normalize = function (cellDate, min, max) {
        if (cellDate < min && this.isEqual(cellDate, min)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["a" /* cloneDate */])(min);
        }
        if (cellDate > max && this.isEqual(cellDate, max)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["a" /* cloneDate */])(max);
        }
        return cellDate;
    };
    return DecadeViewService;
}());

DecadeViewService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
DecadeViewService.ctorParameters = function () { return []; };
var _a;


/***/ }),
/* 259 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MonthViewService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__ = __webpack_require__(85);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(14);





var EMPTY_DATA = [[]];
var CELLS_LENGTH = 7;
var ROWS_LENGTH = 6;
var SATURDAY = 6;
var SUNDAY = 0;
var ACTIONS = (_a = {},
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Left] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["c" /* addDays */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Up] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["l" /* addWeeks */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Right] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["c" /* addDays */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Down] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["l" /* addWeeks */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].PrevView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].NextView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].FirstInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["m" /* firstDayOfMonth */])(date); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].LastInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["f" /* lastDayOfMonth */])(date); },
    _a);
/**
 * @hidden
 */
var MonthViewService = (function () {
    function MonthViewService(_intlService) {
        this._intlService = _intlService;
    }
    MonthViewService.prototype.addToDate = function (min, skip) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(min, skip);
    };
    MonthViewService.prototype.datesList = function (start, count) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, count).map(function (i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(start, i); });
    };
    MonthViewService.prototype.data = function (options) {
        var _this = this;
        var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, viewDate = options.viewDate;
        if (!viewDate) {
            return EMPTY_DATA;
        }
        var firstMonthDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["m" /* firstDayOfMonth */])(viewDate);
        var lastMonthDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["f" /* lastDayOfMonth */])(viewDate);
        var backward = -1;
        var isSelectedDateInRange = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["i" /* isInRange */])(selectedDate, min, max);
        var date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["n" /* dayOfWeek */])(firstMonthDate, this._intlService.firstDay(), backward);
        var cells = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, CELLS_LENGTH);
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, ROWS_LENGTH).map(function (rowOffset) {
            var baseDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["c" /* addDays */])(date, rowOffset * CELLS_LENGTH);
            return cells.map(function (cellOffset) {
                var cellDate = _this.normalize(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["c" /* addDays */])(baseDate, cellOffset), min, max);
                var otherMonth = cellDate < firstMonthDate || cellDate > lastMonthDate;
                var outOfRange = cellDate < min || cellDate > max;
                if (otherMonth || outOfRange) {
                    return null;
                }
                return {
                    formattedValue: _this.value(cellDate),
                    id: "" + cellUID + cellDate.getTime(),
                    isFocused: _this.isEqual(cellDate, focusedDate),
                    isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),
                    isWeekend: _this.isWeekend(cellDate),
                    title: _this.cellTitle(cellDate),
                    value: cellDate
                };
            });
        });
    };
    MonthViewService.prototype.isEqual = function (candidate, expected) {
        if (!candidate || !expected) {
            return false;
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(candidate).getTime() === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(expected).getTime();
    };
    MonthViewService.prototype.isInArray = function (date, dates) {
        return !!dates.length && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["m" /* firstDayOfMonth */])(dates[0]) <= date && date <= __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["f" /* lastDayOfMonth */])(dates[dates.length - 1]);
    };
    MonthViewService.prototype.isInRange = function (candidate, min, max) {
        var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(candidate);
        var aboveMin = !min || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(min) <= value;
        var belowMax = !max || value <= __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(max);
        return aboveMin && belowMax;
    };
    MonthViewService.prototype.isRangeStart = function (value) {
        return !value.getMonth();
    };
    MonthViewService.prototype.move = function (value, action) {
        var modifier = ACTIONS[action];
        if (!modifier) {
            return value;
        }
        return modifier(value);
    };
    MonthViewService.prototype.cellTitle = function (value) {
        return this._intlService.formatDate(value, 'D');
    };
    MonthViewService.prototype.navigationTitle = function (value) {
        if (!value) {
            return '';
        }
        return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];
    };
    MonthViewService.prototype.title = function (current) {
        return this.wideMonthNames()[current.getMonth()] + " " + current.getFullYear();
    };
    MonthViewService.prototype.rowLength = function (prependCell) {
        return CELLS_LENGTH + (prependCell ? 1 : 0);
    };
    MonthViewService.prototype.skip = function (value, min) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["o" /* durationInMonths */])(min, value);
    };
    MonthViewService.prototype.total = function (min, max) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["o" /* durationInMonths */])(min, max) + 1;
    };
    MonthViewService.prototype.value = function (current) {
        return current ? current.getDate().toString() : "";
    };
    MonthViewService.prototype.viewDate = function (date, max, border) {
        if (border === void 0) { border = 1; }
        var renderTwoViews = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["o" /* durationInMonths */])(date, max) < border;
        return renderTwoViews ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, -1) : date;
    };
    MonthViewService.prototype.isWeekend = function (date) {
        var day = date.getDay();
        return day === SATURDAY || day === SUNDAY;
    };
    MonthViewService.prototype.abbrMonthNames = function () {
        return this._intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' });
    };
    MonthViewService.prototype.normalize = function (cellDate, min, max) {
        if (cellDate < min && this.isEqual(cellDate, min)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["a" /* cloneDate */])(min);
        }
        if (cellDate > max && this.isEqual(cellDate, max)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["a" /* cloneDate */])(max);
        }
        return cellDate;
    };
    MonthViewService.prototype.wideMonthNames = function () {
        return this._intlService.dateFormatNames({ nameType: 'wide', type: 'months' });
    };
    return MonthViewService;
}());

MonthViewService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
MonthViewService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };
var _a;


/***/ }),
/* 260 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavigationService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__ = __webpack_require__(85);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_bus_view_service__ = __webpack_require__(48);



var KEY_TO_ACTION = {
    '33': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].PrevView,
    '34': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].NextView,
    '35': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].LastInView,
    '36': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].FirstInView,
    '37': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].Left,
    '38': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].Up,
    '39': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].Right,
    '40': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].Down,
    'meta+38': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].UpperView,
    'meta+40': __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].LowerView
};
/**
 * @hidden
 */
var NavigationService = (function () {
    function NavigationService(bus) {
        this.bus = bus;
    }
    NavigationService.prototype.action = function (event) {
        var action = "" + (event.ctrlKey || event.metaKey ? 'meta+' : '') + event.keyCode;
        return KEY_TO_ACTION[action];
    };
    NavigationService.prototype.move = function (value, action, activeView) {
        var service = this.bus.service(activeView);
        if (!service) {
            return value;
        }
        if (action === __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].UpperView && this.bus.canMoveUp(activeView)) {
            this.bus.moveUp(activeView);
            return value;
        }
        if (action === __WEBPACK_IMPORTED_MODULE_1__models_navigation_action_enum__["a" /* Action */].LowerView && this.bus.canMoveDown(activeView)) {
            this.bus.moveDown(activeView);
            return value;
        }
        return service.move(value, action);
    };
    return NavigationService;
}());

NavigationService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
NavigationService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__services_bus_view_service__["a" /* BusViewService */], },
]; };


/***/ }),
/* 261 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return YearViewService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__ = __webpack_require__(85);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(14);





var EMPTY_DATA = [[]];
var CELLS_LENGTH = 5;
var ROWS_LENGTH = 3;
var upStep = function (month) {
    if (month > 4) {
        return -5;
    }
    if (month < 2) {
        return -2;
    }
    return -7;
};
var downStep = function (month) {
    if (month < 7) {
        return 5;
    }
    if (month < 10) {
        return 7;
    }
    return 2;
};
var ACTIONS = (_a = {},
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Left] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Up] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, upStep(date.getMonth())); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Right] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].Down] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(date, downStep(date.getMonth())); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].PrevView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["h" /* addYears */])(date, -1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].NextView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["h" /* addYears */])(date, 1); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].FirstInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["i" /* firstMonthOfYear */])(date); },
    _a[__WEBPACK_IMPORTED_MODULE_3__models_navigation_action_enum__["a" /* Action */].LastInView] = function (date) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["j" /* lastMonthOfYear */])(date); },
    _a);
/**
 * @hidden
 */
var YearViewService = (function () {
    function YearViewService(_intlService) {
        this._intlService = _intlService;
    }
    YearViewService.prototype.addToDate = function (min, skip) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["h" /* addYears */])(min, skip);
    };
    YearViewService.prototype.datesList = function (start, count) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, count).map(function (i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["h" /* addYears */])(start, i); });
    };
    YearViewService.prototype.data = function (options) {
        var _this = this;
        var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, viewDate = options.viewDate;
        if (!viewDate) {
            return EMPTY_DATA;
        }
        var months = this.abbrMonthNames();
        var isSelectedDateInRange = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["i" /* isInRange */])(selectedDate, min, max);
        var firstDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["i" /* firstMonthOfYear */])(viewDate);
        var currentYear = firstDate.getFullYear();
        var cells = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, CELLS_LENGTH);
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, ROWS_LENGTH).map(function (rowOffset) {
            var baseDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(firstDate, rowOffset * CELLS_LENGTH);
            return cells.map(function (cellOffset) {
                var cellDate = _this.normalize(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["e" /* addMonths */])(baseDate, cellOffset), min, max);
                var changedYear = currentYear < cellDate.getFullYear();
                if (!_this.isInRange(cellDate, min, max) || changedYear) {
                    return null;
                }
                return {
                    formattedValue: months[cellDate.getMonth()],
                    id: "" + cellUID + cellDate.getTime(),
                    isFocused: _this.isEqual(cellDate, focusedDate),
                    isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),
                    isWeekend: false,
                    title: _this.cellTitle(cellDate),
                    value: cellDate
                };
            });
        });
    };
    YearViewService.prototype.isEqual = function (candidate, expected) {
        if (!candidate || !expected) {
            return false;
        }
        return candidate.getFullYear() === expected.getFullYear() &&
            candidate.getMonth() === expected.getMonth();
    };
    YearViewService.prototype.isInArray = function (date, dates) {
        if (!dates.length) {
            return false;
        }
        var year = date.getFullYear();
        return dates[0].getFullYear() <= year && year <= dates[dates.length - 1].getFullYear();
    };
    YearViewService.prototype.isInRange = function (candidate, min, max) {
        var candidateValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["g" /* createDate */])(candidate.getFullYear(), candidate.getMonth(), 1);
        var aboveMin = !min || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["g" /* createDate */])(min.getFullYear(), min.getMonth(), 1) <= candidateValue;
        var belowMax = !max || candidateValue <= __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["g" /* createDate */])(max.getFullYear(), max.getMonth(), 1);
        return aboveMin && belowMax;
    };
    YearViewService.prototype.isRangeStart = function (value) {
        return value.getFullYear() % 10 === 0;
    };
    YearViewService.prototype.move = function (value, action) {
        var modifier = ACTIONS[action];
        if (!modifier) {
            return value;
        }
        return modifier(value);
    };
    YearViewService.prototype.cellTitle = function (value) {
        return value.getFullYear() + " " + this.value(value);
    };
    YearViewService.prototype.navigationTitle = function (value) {
        return this.title(value);
    };
    YearViewService.prototype.title = function (current) {
        return current ? current.getFullYear().toString() : '';
    };
    YearViewService.prototype.rowLength = function (_) {
        return CELLS_LENGTH;
    };
    YearViewService.prototype.skip = function (value, min) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["k" /* durationInYears */])(min, value);
    };
    YearViewService.prototype.total = function (min, max) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["k" /* durationInYears */])(min, max) + 1;
    };
    YearViewService.prototype.value = function (current) {
        return current ? this.abbrMonthNames()[current.getMonth()] : '';
    };
    YearViewService.prototype.viewDate = function (date, max, border) {
        if (border === void 0) { border = 1; }
        var renderTwoViews = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["k" /* durationInYears */])(date, max) < border;
        return renderTwoViews ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["h" /* addYears */])(date, -1) : date;
    };
    YearViewService.prototype.abbrMonthNames = function () {
        return this._intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' });
    };
    YearViewService.prototype.normalize = function (cellDate, min, max) {
        if (cellDate < min && this.isEqual(cellDate, min)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["a" /* cloneDate */])(min);
        }
        if (cellDate > max && this.isEqual(cellDate, max)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["a" /* cloneDate */])(max);
        }
        return cellDate;
    };
    return YearViewService;
}());

YearViewService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
YearViewService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };
var _a;


/***/ }),
/* 262 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TemplatesModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__templates_cell_template_directive__ = __webpack_require__(154);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templates_month_cell_template_directive__ = __webpack_require__(157);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templates_year_cell_template_directive__ = __webpack_require__(159);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__templates_decade_cell_template_directive__ = __webpack_require__(156);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__templates_century_cell_template_directive__ = __webpack_require__(155);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__templates_weeknumber_cell_template_directive__ = __webpack_require__(158);







var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__templates_cell_template_directive__["a" /* CellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_2__templates_month_cell_template_directive__["a" /* MonthCellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_3__templates_year_cell_template_directive__["a" /* YearCellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_4__templates_decade_cell_template_directive__["a" /* DecadeCellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_5__templates_century_cell_template_directive__["a" /* CenturyCellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_6__templates_weeknumber_cell_template_directive__["a" /* WeekNumberCellTemplateDirective */]
];
/**
 * @hidden
 *
 * The exported package module.
 *
 * The package exports:
 * - `CellTemplateDirective`&mdash;The month cell template directive.
 * - `MonthCellTemplateDirective`&mdash;The month cell template directive.
 * - `YearCellTemplateDirective`&mdash;The year cell template directive.
 * - `DecadeCellTemplateDirective`&mdash;The decade cell template directive.
 * - `CenturyCellTemplateDirective`&mdash;The century cell template directive.
 * - `WeekNumberCellTemplateDirective`&mdash;The month week number cell template directive.
 */
var TemplatesModule = (function () {
    function TemplatesModule() {
    }
    return TemplatesModule;
}());

TemplatesModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES]
            },] },
];
/** @nocollapse */
TemplatesModule.ctorParameters = function () { return []; };


/***/ }),
/* 263 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ViewListComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__virtualization_virtualization_component__ = __webpack_require__(115);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_bus_view_service__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_dom_service__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__models_view_enum__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util__ = __webpack_require__(14);
/* tslint:disable:component-selector-name  component-selector-type */

//import { cloneDate, firstDayOfMonth } from '@progress/kendo-date-math';








var VIEWS_COUNT = 5;
var isEqualMonthYear = function (date1, date2) { return (date1 && date2 &&
    date1.getFullYear() === date2.getFullYear() &&
    date1.getMonth() === date2.getMonth()); };
/**
 * @hidden
 */
var ViewListComponent = (function () {
    function ViewListComponent(bus, cdr, intl, dom) {
        this.bus = bus;
        this.cdr = cdr;
        this.intl = intl;
        this.dom = dom;
        this.isActive = true;
        this.min = new Date(__WEBPACK_IMPORTED_MODULE_7__defaults__["d" /* MIN_DATE */]);
        this.max = new Date(__WEBPACK_IMPORTED_MODULE_7__defaults__["e" /* MAX_DATE */]);
        this.activeDateChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.dates = [];
        this.cols = [];
        this.weekNames = [];
        this.take = VIEWS_COUNT;
        this.animateToIndex = true;
        this.indexToScroll = -1;
        this.minViewsToRender = 1;
    }
    Object.defineProperty(ViewListComponent.prototype, "weekNumber", {
        get: function () {
            return this.showWeekNumbers && this.isMonthView();
        },
        set: function (showWeekNumbers) {
            this.showWeekNumbers = showWeekNumbers;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ViewListComponent.prototype, "getComponentClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ViewListComponent.prototype, "getComponentMonthClass", {
        get: function () {
            return this.activeView === __WEBPACK_IMPORTED_MODULE_6__models_view_enum__["a" /* CalendarViewEnum */].month;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ViewListComponent.prototype, "getComponentYearClass", {
        get: function () {
            return this.activeView === __WEBPACK_IMPORTED_MODULE_6__models_view_enum__["a" /* CalendarViewEnum */].year;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ViewListComponent.prototype, "getComponentDecadeClass", {
        get: function () {
            return this.activeView === __WEBPACK_IMPORTED_MODULE_6__models_view_enum__["a" /* CalendarViewEnum */].decade;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ViewListComponent.prototype, "getComponentCenturyClass", {
        get: function () {
            return this.activeView === __WEBPACK_IMPORTED_MODULE_6__models_view_enum__["a" /* CalendarViewEnum */].century;
        },
        enumerable: true,
        configurable: true
    });
    ViewListComponent.prototype.ngOnInit = function () {
        this.weekNames = this.getWeekNames();
        this.bottomOffset = this.getBottomOffset();
        this.viewOffset = -1 * this.dom.headerHeight;
        this.viewHeight = this.dom.viewHeight(this.activeView);
    };
    ViewListComponent.prototype.ngOnChanges = function (changes) {
        this.service = this.bus.service(this.activeView);
        if (!this.service) {
            return;
        }
        this.cols = new Array(this.service.rowLength(this.weekNumber)).fill('');
        this.weekNames = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["o" /* hasChange */])(changes, 'weekNumber') && this.weekNumber ? this.getWeekNames() : this.weekNames;
        var activeViewChanged = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["o" /* hasChange */])(changes, 'activeView');
        var focusedDate = this.focusedDate;
        var viewDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["l" /* dateInRange */])(this.service.viewDate(focusedDate, this.max, this.minViewsToRender), this.min, this.max);
        var total = this.service.total(this.min, this.max);
        var totalChanged = this.total && this.total !== total;
        var generateDates = totalChanged || !this.service.isInArray(focusedDate, this.dates);
        this.skip = this.service.skip(viewDate, this.min);
        this.total = total;
        this.animateToIndex = !activeViewChanged;
        this.bottomOffset = this.getBottomOffset();
        this.viewHeight = this.dom.viewHeight(this.activeView);
        if (generateDates) {
            this.dates = this.service.datesList(viewDate, this.getTake(this.skip));
        }
        if (!isEqualMonthYear(this.activeDate, focusedDate)) {
            this.activeDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["a" /* cloneDate */])(focusedDate);
        }
        var updateIndex = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["o" /* hasChange */])(changes, 'focusedDate') || activeViewChanged;
        if (generateDates || updateIndex || this.virtualization.isIndexVisible(this.skip)) {
            this.indexToScroll = this.service.skip(focusedDate, this.min);
        }
    };
    ViewListComponent.prototype.ngAfterViewInit = function () {
        if (this.indexToScroll === -1) {
            return;
        }
        this.virtualization.scrollToIndex(this.indexToScroll);
        this.indexToScroll = -1;
    };
    ViewListComponent.prototype.ngAfterViewChecked = function () {
        if (this.indexToScroll === -1) {
            return;
        }
        this.virtualization[this.animateToIndex ? 'animateToIndex' : 'scrollToIndex'](this.indexToScroll);
        this.animateToIndex = true;
        this.indexToScroll = -1;
    };
    ViewListComponent.prototype.pageChange = function (_a) {
        var skip = _a.skip;
        this.dates = this.service.datesList(this.service.addToDate(this.min, skip), this.getTake(skip));
    };
    ViewListComponent.prototype.scrollChange = function (_a) {
        var offset = _a.offset;
        var translate = "translateY(" + offset + "px)";
        this.style = { transform: translate, '-ms-transform': translate };
    };
    ViewListComponent.prototype.setActiveDate = function (index) {
        this.activeDate = this.service.addToDate(this.min, index);
        this.activeDateChange.emit(this.activeDate);
        this.cdr.detectChanges();
    };
    ViewListComponent.prototype.handleDateChange = function (candidate) {
        this.valueChange.emit(candidate);
    };
    ViewListComponent.prototype.isMonthView = function () {
        return this.activeView === __WEBPACK_IMPORTED_MODULE_6__models_view_enum__["a" /* CalendarViewEnum */].month;
    };
    ViewListComponent.prototype.isScrolled = function () {
        return this.virtualization.isListScrolled(this.service.skip(this.focusedDate, this.min));
    };
    ViewListComponent.prototype.getBottomOffset = function () {
        return this.getScrollableHeight() - this.dom.viewHeight(this.activeView);
    };
    ViewListComponent.prototype.getScrollableHeight = function () {
        return this.activeView === __WEBPACK_IMPORTED_MODULE_6__models_view_enum__["a" /* CalendarViewEnum */].month ?
            this.dom.scrollableContentHeight :
            this.dom.scrollableYearContentHeight;
    };
    ViewListComponent.prototype.getTake = function (skip) {
        return Math.min(this.total - skip, this.take);
    };
    ViewListComponent.prototype.getWeekNames = function () {
        var weekNames = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["t" /* shiftWeekNames */])(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
        return this.weekNumber ? [''].concat(weekNames) : weekNames;
    };
    return ViewListComponent;
}());

ViewListComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-calendar-viewlist',
                template: "\n    <kendo-calendar-header\n        [currentDate]=\"activeDate\"\n        [min]=\"min\"\n        [max]=\"max\"\n        [activeView]=\"activeView\"\n        (today)=\"handleDateChange($event)\"\n    >\n    </kendo-calendar-header>\n    <table class=\"k-calendar-weekdays\" *ngIf=\"isMonthView()\">\n        <colgroup><col *ngFor=\"let _ of cols\" /></colgroup>\n        <thead>\n            <tr>\n                <th *ngFor=\"let name of weekNames\">{{name}}</th>\n            </tr>\n        </thead>\n    </table>\n    <kendo-virtualization\n        [skip]=\"skip\"\n        [take]=\"take\"\n        [total]=\"total\"\n        [itemHeight]=\"viewHeight\"\n        [topOffset]=\"viewOffset\"\n        [bottomOffset]=\"bottomOffset\"\n        [scrollOffsetHeight]=\"viewOffset\"\n        [maxScrollDifference]=\"viewHeight\"\n        (pageChange)=\"pageChange($event)\"\n        (scrollChange)=\"scrollChange($event)\"\n        (activeIndexChange)=\"setActiveDate($event)\"\n        >\n        <table [ngStyle]=\"style\">\n            <colgroup><col *ngFor=\"let _ of cols\" /></colgroup>\n\n            <tbody *kFor=\"let date of dates\"\n                   kendoCalendarView\n                   role=\"rowgroup\"\n                   [activeView]=\"activeView\"\n                   [isActive]=\"isActive\"\n                   [min]=\"min\" [max]=\"max\"\n                   [cellUID]=\"cellUID\"\n                   [focusedDate]=\"focusedDate\"\n                   [selectedDate]=\"value\"\n                   [weekNumber]=\"weekNumber\"\n                   [templateRef]=\"cellTemplateRef\"\n                   [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n                   [viewDate]=\"date\"\n                   (change)=\"handleDateChange($event)\"\n            ></tbody>\n        </table>\n    </kendo-virtualization>\n  "
            },] },
];
/** @nocollapse */
ViewListComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_4__services_bus_view_service__["a" /* BusViewService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["b" /* IntlService */], },
    { type: __WEBPACK_IMPORTED_MODULE_5__services_dom_service__["a" /* DOMService */], },
]; };
ViewListComponent.propDecorators = {
    'cellTemplateRef': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'weekNumberTemplateRef': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'cellUID': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focusedDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'isActive': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'weekNumber': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeDateChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'virtualization': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_3__virtualization_virtualization_component__["a" /* VirtualizationComponent */],] },],
    'getComponentClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-view",] },],
    'getComponentMonthClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-monthview",] },],
    'getComponentYearClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-yearview",] },],
    'getComponentDecadeClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-decadeview",] },],
    'getComponentCenturyClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-centuryview",] },],
};


/***/ }),
/* 264 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateInputComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__validators_min_validator__ = __webpack_require__(165);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__validators_max_validator__ = __webpack_require__(164);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__keys_enum__ = __webpack_require__(540);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__arrow_enum__ = __webpack_require__(539);
/* tslint:disable:max-line-length */










var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-min';
var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-max';
var VALUE_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/dateinput/#toc-using-with-json';
var time = function (date) { return date ? date.getTime() : null; };
var padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };
var Mask = (function () {
    function Mask() {
        this.symbols = "";
    }
    return Mask;
}());
var KendoDate = (function () {
    function KendoDate(intl, formatPlaceholder, format, value) {
        this.intl = intl;
        this.formatPlaceholder = formatPlaceholder;
        this.format = format;
        this.year = true;
        this.month = true;
        this.date = true;
        this.hours = true;
        this.minutes = true;
        this.seconds = true;
        this.milliseconds = true;
        this.leadingZero = null;
        this.monthNames = null;
        this.typedMonthPart = "";
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["d" /* getDate */])(new Date());
        this.knownParts = "adHhmMsEy";
        this.symbols = {
            "E": "E",
            "H": "H",
            "M": "M",
            "a": "a",
            "d": "d",
            "h": "h",
            "m": "m",
            "s": "s",
            "y": "y"
        };
        this.monthNames = this.allFormatedMonths();
        if (!value) {
            this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["d" /* getDate */])(new Date());
            var sampleFormat = this.dateFormatString(this.value, this.format).symbols;
            for (var i = 0; i < sampleFormat.length; i++) {
                this.setExisting(sampleFormat[i], false);
            }
        }
        else {
            this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(value);
        }
    }
    KendoDate.prototype.hasValue = function () {
        var _this = this;
        var pred = function (a, p) { return a || p.type !== 'literal' && p.type !== 'dayperiod' && _this.getExisting(p.pattern[0]); };
        return this.intl.splitDateFormat(this.format).reduce(pred, false);
    };
    KendoDate.prototype.getDateObject = function () {
        for (var i = 0; i < this.knownParts.length; i++) {
            if (!this.getExisting(this.knownParts[i])) {
                return null;
            }
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(this.value);
    };
    KendoDate.prototype.getTextAndFormat = function () {
        return this.merge(this.intl.formatDate(this.value, this.format), this.dateFormatString(this.value, this.format));
    };
    KendoDate.prototype.getExisting = function (symbol) {
        switch (symbol) {
            case "y": return this.year;
            case "M":
            case "L": return this.month;
            case "d": return this.date;
            case "E": return this.date && this.month && this.year;
            case "h":
            case "H": return this.hours;
            case "m": return this.minutes;
            case "s": return this.seconds;
            default: return true;
        }
    };
    KendoDate.prototype.setExisting = function (symbol, value) {
        switch (symbol) {
            case "y":
                this.year = value;
                if (value === false) {
                    this.value.setFullYear(2000);
                }
                break; //allow 2/29 dates
            case "M":
                this.month = value;
                if (value === false) {
                    this.value.setMonth(0);
                }
                break; //make sure you can type 31 at day part
            case "d":
                this.date = value;
                break;
            case "h":
            case "H":
                this.hours = value;
                break;
            case "m":
                this.minutes = value;
                break;
            case "s":
                this.seconds = value;
                break;
            default: return;
        }
    };
    KendoDate.prototype.modifyPart = function (symbol, offset) {
        var newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(this.value);
        switch (symbol) {
            case "y":
                newValue.setFullYear(newValue.getFullYear() + offset);
                break;
            case "M":
                newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["e" /* addMonths */])(this.value, offset);
                break;
            case "d":
            case "E":
                newValue.setDate(newValue.getDate() + offset);
                break;
            case "h":
            case "H":
                newValue.setHours(newValue.getHours() + offset);
                break;
            case "m":
                newValue.setMinutes(newValue.getMinutes() + offset);
                break;
            case "s":
                newValue.setSeconds(newValue.getSeconds() + offset);
                break;
            case "a":
                newValue.setHours(newValue.getHours() + (12 * offset));
                break;
            default: break;
        }
        if (newValue.getFullYear() > 0) {
            this.setExisting(symbol, true);
            this.value = newValue;
        }
    };
    KendoDate.prototype.parsePart = function (symbol, currentChar, resetSegmentValue) {
        var leadingZero = this.leadingZero || {};
        this.resetLeadingZero();
        if (!currentChar) {
            this.setExisting(symbol, false);
            return { value: null, switchToNext: false };
        }
        var baseDate = this.intl.formatDate(this.value, this.format);
        var dateParts = this.dateFormatString(this.value, this.format);
        var baseFormat = dateParts.symbols;
        var replaced = false;
        var prefix = "";
        var current = "";
        var suffix = "";
        for (var i = 0; i < baseDate.length; i++) {
            if (baseFormat[i] === symbol) {
                current += this.getExisting(symbol) ? baseDate[i] : "0";
                replaced = true;
            }
            else if (!replaced) {
                prefix += baseDate[i];
            }
            else {
                suffix += baseDate[i];
            }
        }
        var currentMaxLength = current.length - 3;
        var parsedDate = null;
        var month = this.matchMonth(currentChar);
        for (var i = Math.max(0, currentMaxLength); i <= current.length; i++) {
            var middle = resetSegmentValue ? currentChar : (current.substring(i) + currentChar);
            var middleNumber = parseInt(middle, 10);
            parsedDate = this.intl.parseDate(prefix + middle + suffix, this.format);
            if (!parsedDate && !isNaN(middleNumber) && !isNaN(parseInt(currentChar, 10))) {
                if (symbol === 'M' && !month) {
                    var monthNumber = middleNumber - 1;
                    if (monthNumber > -1 && monthNumber < 12) {
                        parsedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(this.value);
                        parsedDate.setMonth(monthNumber);
                        if (parsedDate.getMonth() !== monthNumber) {
                            parsedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["f" /* lastDayOfMonth */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["e" /* addMonths */])(parsedDate, -1));
                        }
                    }
                }
                if (symbol === 'y') {
                    parsedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["g" /* createDate */])(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0);
                    if (this.date && parsedDate.getDate() !== this.value.getDate()) {
                        parsedDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["f" /* lastDayOfMonth */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["e" /* addMonths */])(parsedDate, -1));
                    }
                }
            }
            if (parsedDate) {
                //move to next segment if the part will overflow with next char
                //when start from empty date (01, then 010), padded zeros should be trimmed
                var patternValue = this.partPattern(dateParts.partMap, symbol).pattern;
                var peekDate = this.intl.parseDate("" + prefix + this.peek(middle, patternValue) + suffix, this.format);
                this.value = parsedDate;
                this.setExisting(symbol, true);
                var switchToNext = peekDate === null || (leadingZero[symbol] && patternValue.length <= middle.length);
                return { value: this.value, switchToNext: switchToNext };
            }
        }
        if (month) {
            parsedDate = this.intl.parseDate(prefix + month + suffix, this.format);
            if (parsedDate) {
                this.value = parsedDate;
                this.setExisting(symbol, true);
                return { value: this.value, switchToNext: false };
            }
        }
        if (currentChar === '0') {
            this.leadingZero = !this.isAbbrMonth(dateParts.partMap, symbol) ? (_a = {}, _a[symbol] = true, _a) : null;
            this.setExisting(symbol, false);
        }
        return { value: null, switchToNext: false };
        var _a;
    };
    KendoDate.prototype.resetLeadingZero = function () {
        var hasLeadingZero = this.leadingZero !== null;
        this.leadingZero = null;
        return hasLeadingZero;
    };
    KendoDate.prototype.isAbbrMonth = function (parts, symbol) {
        var pattern = this.partPattern(parts, symbol);
        return pattern.type === 'month' && pattern.names;
    };
    KendoDate.prototype.partPattern = function (parts, symbol) {
        return parts.filter(function (part) { return part.pattern.indexOf(symbol) !== -1; })[0];
    };
    KendoDate.prototype.peek = function (value, pattern) {
        var peekValue = value.replace(/^0*/, '') + '0';
        return padZero(pattern.length - peekValue.length) + peekValue;
    };
    KendoDate.prototype.matchMonth = function (typedChar) {
        this.typedMonthPart += typedChar.toLowerCase();
        if (!this.monthNames) {
            return "";
        }
        while (this.typedMonthPart.length > 0) {
            for (var i = 0; i < this.monthNames.length; i++) {
                if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {
                    return this.monthNames[i];
                }
            }
            var monthAsNum = parseInt(this.typedMonthPart, 10);
            if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart /*ensure they exact match*/) {
                return this.monthNames[monthAsNum - 1];
            }
            this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);
        }
        return "";
    };
    KendoDate.prototype.allFormatedMonths = function () {
        var dateFormatParts = this.intl.splitDateFormat(this.format);
        for (var i = 0; i < dateFormatParts.length; i++) {
            if (dateFormatParts[i].type === "month" && dateFormatParts[i].names) {
                return this.intl.dateFormatNames(dateFormatParts[i].names);
            }
        }
        return null;
    };
    //TODO: REMOVE!
    KendoDate.prototype.dateFormatString = function (date, format) {
        var dateFormatParts = this.intl.splitDateFormat(format);
        var parts = [];
        var partMap = [];
        for (var i = 0; i < dateFormatParts.length; i++) {
            var partLength = this.intl.formatDate(date, { pattern: dateFormatParts[i].pattern }).length;
            while (partLength > 0) {
                parts.push(this.symbols[dateFormatParts[i].pattern[0]] || "_");
                partMap.push(dateFormatParts[i]);
                partLength--;
            }
        }
        var returnValue = new Mask();
        returnValue.symbols = parts.join("");
        returnValue.partMap = partMap;
        return returnValue;
    };
    KendoDate.prototype.merge = function (text, mask) {
        // Important: right to left.
        var resultText = "";
        var resultFormat = "";
        var format = mask.symbols;
        for (var r = format.length - 1; r >= 0; r--) {
            if (this.knownParts.indexOf(format[r]) === -1 || this.getExisting(format[r])) {
                resultText = text[r] + resultText;
                resultFormat = format[r] + resultFormat;
            }
            else {
                var currentSymbol = format[r];
                while (r >= 0 && currentSymbol === format[r]) {
                    r--;
                }
                r++;
                if (this.leadingZero && this.leadingZero[currentSymbol]) {
                    resultText = '0' + resultText;
                }
                else {
                    resultText = this.dateFieldName(mask.partMap[r]) + resultText;
                }
                while (resultFormat.length < resultText.length) {
                    resultFormat = format[r] + resultFormat;
                }
            }
        }
        return [resultText, resultFormat];
    };
    KendoDate.prototype.dateFieldName = function (part) {
        var formatPlaceholder = this.formatPlaceholder || 'wide';
        if (formatPlaceholder[part.type]) {
            return formatPlaceholder[part.type];
        }
        if (formatPlaceholder === 'formatPattern') {
            return part.pattern;
        }
        return this.intl.dateFieldName(Object.assign(part, { nameType: formatPlaceholder }));
    };
    return KendoDate;
}());
/**
 * Represents the Kendo UI DateInput component for Angular.
 */
var DateInputComponent = (function () {
    function DateInputComponent(cdr, intl, renderer, localization) {
        this.cdr = cdr;
        this.intl = intl;
        this.renderer = renderer;
        this.localization = localization;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["g" /* guid */])();
        /**
         * Sets or gets the `disabled` property of the DateInput and determines whether the component is active.
         */
        this.disabled = false;
        /**
         * Sets the title of the input element of the DateInput.
         */
        this.title = "";
        /**
         * Sets or gets the `tabIndex` property of the DateInput.
         * .
         */
        this.tabIndex = 0;
        /**
         * Specifies the date format used to display the input value.
         */
        this.format = "d";
        /**
         * Specifies the hint the DateInput displays when its value is `null`.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-dateinput placeholder="Enter birth date..."></kendo-dateinput>
         * `
         * })
         * class AppComponent { }
         * ```
         */
        this.placeholder = "";
        /**
         * Determines whether the built-in min or max validators are to be enforced when a form is being validated.
         */
        this.rangeValidation = true;
        /**
         * @hidden
         * Based on the min and max values, specifies whether the value will be auto-corrected while typing.
         */
        this.autoCorrect = false;
        /**
         * Specifies whether the **Up** and **Down** spin buttons will be rendered.
         */
        this.spinners = false;
        /**
         * @hidden
         */
        this.isPopupOpen = false;
        /**
         * @hidden
         */
        this.hasPopup = false;
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the input element.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-dateinput (focus)="handleFocus()"></kendo-dateinput>
         * `
         * })
         * class AppComponent {
         *   public handleFocus(): void {
         *      console.log("Component is focused");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onFocus` property.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-dateinput (blur)="handleBlur()"></kendo-dateinput>
         * `
         * })
         * class AppComponent {
         *   public handleBlur(): void {
         *      console.log("Component is blurred");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onBlur` property.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        this.arrow = __WEBPACK_IMPORTED_MODULE_9__arrow_enum__["a" /* Arrow */];
        this.arrowDirection = __WEBPACK_IMPORTED_MODULE_9__arrow_enum__["a" /* Arrow */].None;
        this.isActive = false;
        this.currentValue = "";
        this.currentFormat = "";
        this.backspace = false;
        this.resetSegmentValue = true;
        this.resolvedPromise = Promise.resolve(null);
        this.minValidateFn = __WEBPACK_IMPORTED_MODULE_8__util__["h" /* noop */];
        this.maxValidateFn = __WEBPACK_IMPORTED_MODULE_8__util__["h" /* noop */];
        this._value = null;
        this.kendoDate = null;
        this.ngChange = function (_) { };
        this.ngTouched = function () { };
        this.symbolsMap = this.dateSymbolMap();
    }
    Object.defineProperty(DateInputComponent.prototype, "max", {
        get: function () {
            return this._max;
        },
        /**
         * Specifies the biggest date that is valid.
         */
        set: function (max) {
            this._max = max;
            this.ariaValueMax = time(max);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateInputComponent.prototype, "min", {
        get: function () {
            return this._min;
        },
        /**
         * Specifies the smallest date that is valid.
         */
        set: function (min) {
            this._min = min;
            this.ariaValueMin = time(min);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateInputComponent.prototype, "value", {
        get: function () {
            return this._value;
        },
        /**
         * Specifies the value of the DateInput component.
         *
         * > The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
         */
        set: function (value) {
            this.verifyValue(value);
            if (this.autoCorrect && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["i" /* isInRange */])(value, this.min, this.max)) {
                return;
            }
            this._value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateInputComponent.prototype, "wrapperClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateInputComponent.prototype, "disabledClass", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DateInputComponent.prototype.mousescroll = function (event) {
        this.handleMouseWheel(event);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.handlePaste = function (event) {
        event.preventDefault();
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.keydown = function (event) {
        if (this.disabled || event.altKey || event.ctrlKey || event.metaKey) {
            return;
        }
        if (event.keyCode === __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].tab) {
            var moved = this.switchDateSegment(event.shiftKey ? -1 : 1);
            if (moved) {
                event.preventDefault();
            }
            return;
        }
        if (event.keyCode === __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].backspace) {
            this.backspace = true;
            return;
        }
        switch (event.keyCode) {
            case __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].down:
                this.modifyDateSegmentValue(-1);
                break;
            case __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].up:
                this.modifyDateSegmentValue(1);
                break;
            case __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].right:
                this.switchDateSegment(1);
                break;
            case __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].left:
                this.switchDateSegment(-1);
                break;
            case __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].home:
                this.selectNearestSegment(0);
                break;
            case __WEBPACK_IMPORTED_MODULE_3__keys_enum__["a" /* Keys */].end:
                this.selectNearestSegment(this.dateInput.nativeElement.value.length);
                break;
            default:
                return; //skip the preventDefault if we didn't handled the keyCode
        }
        event.preventDefault();
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.handleInput = function () {
        if (this.disabled) {
            return;
        }
        var diff = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["j" /* approximateStringMatching */])(this.currentValue, this.currentFormat, this.dateInput.nativeElement.value, this.caret()[0]);
        var navigationOnly = (diff.length === 1 && diff[0][1] === "_");
        var switchPart = false;
        if (!navigationOnly) {
            var parsedPart = void 0;
            for (var i = 0; i < diff.length; i++) {
                parsedPart = this.kendoDate.parsePart(diff[i][0], diff[i][1], this.resetSegmentValue);
                switchPart = parsedPart.switchToNext;
            }
        }
        this.resetSegmentValue = false;
        this.putDateInRange();
        this.updateElementValue(this.isActive);
        this.triggerChange();
        if (diff.length && diff[0][0] !== "_") {
            this.selectDateSegment(diff[0][0]);
        }
        if (switchPart || navigationOnly) {
            this.switchDateSegment(1);
        }
        if (this.backspace) {
            this.switchDateSegment(-1);
        }
        this.backspace = false;
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.ngOnChanges = function (changes) {
        var _this = this;
        this.verifyRange();
        if (this.hasChanged(changes, 'min') || this.hasChanged(changes, 'max')) {
            this.minValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__validators_min_validator__["a" /* minValidator */])(this.min) : __WEBPACK_IMPORTED_MODULE_8__util__["h" /* noop */];
            this.maxValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__validators_max_validator__["a" /* maxValidator */])(this.max) : __WEBPACK_IMPORTED_MODULE_8__util__["h" /* noop */];
            if (!changes.value) {
                this.resolvedPromise.then(function () { return _this.ngChange(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(_this.value)); });
            }
        }
        if (changes.format) {
            this.symbolsMap = this.dateSymbolMap();
        }
        if (changes.format || this.kendoDate && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["b" /* isEqual */])(this.value, this.kendoDate.getDateObject())) {
            this.writeValue(this.value);
        }
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.validate = function (control) {
        return this.minValidateFn(control) || this.maxValidateFn(control);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.ngOnInit = function () {
        this.kendoDate = this.getKendoDate(this.value);
        this.updateElementValue();
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
        this.cdr.markForCheck();
    };
    //ngModel binding
    /**
     * @hidden
     */
    DateInputComponent.prototype.writeValue = function (value) {
        this.verifyValue(value);
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(value);
        this.kendoDate = this.getKendoDate(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(this.value));
        this.updateElementValue(this.isActive);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.triggerChange = function () {
        var dateObject = this.kendoDate.getDateObject();
        if (+dateObject !== +this.value) {
            this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(dateObject);
            this.ngChange(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(this.value));
            this.valueChange.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["a" /* cloneDate */])(this.value));
        }
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.registerOnChange = function (fn) {
        this.ngChange = fn;
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.registerOnTouched = function (fn) {
        this.ngTouched = fn;
    };
    /**
     * Focuses the DateInput component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="dateinput.focus()">Focus date input</button>
     *  <kendo-dateinput #dateinput></kendo-dateinput>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    DateInputComponent.prototype.focus = function () {
        if (!this.dateInput) {
            return;
        }
        this.dateInput.nativeElement.focus();
        this.selectDateSegment(this.currentFormat[0]);
    };
    /**
     * Blurs the DateInput component.
     */
    DateInputComponent.prototype.blur = function () {
        if (!this.dateInput) {
            return;
        }
        this.dateInput.nativeElement.blur();
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.handleButtonClick = function (offset) {
        this.arrowDirection = __WEBPACK_IMPORTED_MODULE_9__arrow_enum__["a" /* Arrow */].None;
        this.modifyDateSegmentValue(offset);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.modifyDateSegmentValue = function (offset) {
        var caret = this.caret();
        var symbol = this.currentFormat[caret[0]];
        var step = (this.steps || {})[this.symbolsMap[symbol]] || 1;
        this.kendoDate.modifyPart(symbol, offset * step);
        this.putDateInRange();
        this.updateElementValue(this.isActive);
        this.triggerChange();
        this.selectDateSegment(symbol);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.switchDateSegment = function (offset) {
        var caret = this.caret();
        if (this.kendoDate.resetLeadingZero()) {
            this.updateElementValue(this.isActive);
        }
        if (caret[0] < caret[1] && this.currentFormat[caret[0]] !== this.currentFormat[caret[1] - 1]) {
            this.selectNearestSegment(offset > 0 ? caret[0] : caret[1] - 1);
            this.resetSegmentValue = true;
            return true;
        }
        var previousFormatSymbol = this.currentFormat[caret[0]];
        var a = caret[0] + offset;
        while (a > 0 && a < this.currentFormat.length) {
            if (this.currentFormat[a] !== previousFormatSymbol &&
                this.currentFormat[a] !== "_") {
                break;
            }
            a += offset;
        }
        if (this.currentFormat[a] === "_") {
            //there is not known symbol found
            return false;
        }
        var b = a;
        while (b >= 0 && b < this.currentFormat.length) {
            if (this.currentFormat[b] !== this.currentFormat[a]) {
                break;
            }
            b += offset;
        }
        if (a > b && (b + 1 !== caret[0] || a + 1 !== caret[1])) {
            this.caret(b + 1, a + 1);
            this.resetSegmentValue = true;
            return true;
        }
        else if (a < b && (a !== caret[0] || b !== caret[1])) {
            this.caret(a, b);
            this.resetSegmentValue = true;
            return true;
        }
        return false;
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.selectDateSegment = function (symbol) {
        var begin = -1;
        var end = 0;
        for (var i = 0; i < this.currentFormat.length; i++) {
            if (this.currentFormat[i] === symbol) {
                end = i + 1;
                if (begin === -1) {
                    begin = i;
                }
            }
        }
        if (begin < 0) {
            begin = 0;
        }
        this.caret(0, 0);
        this.caret(begin, end);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.handleClick = function () {
        this.selectNearestSegment(this.caret()[0]);
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.handleFocus = function () {
        this.isActive = true;
        this.updateElementValue();
        this.onFocus.emit();
    };
    /**
     * @hidden
     */
    DateInputComponent.prototype.handleBlur = function () {
        this.isActive = false;
        this.resetSegmentValue = true;
        this.updateElementValue();
        this.ngTouched();
        this.onBlur.emit();
    };
    DateInputComponent.prototype.handleMouseWheel = function (event) {
        if (this.disabled || !this.isActive) {
            return;
        }
        event = window.event || event;
        if (event.shiftKey) {
            this.switchDateSegment((event.wheelDelta || -event.detail) > 0 ? -1 : 1);
        }
        else {
            this.modifyDateSegmentValue((event.wheelDelta || -event.detail) > 0 ? 1 : -1);
        }
        event.returnValue = false;
        if (event.preventDefault) {
            event.preventDefault();
        }
        if (event.stopPropagation) {
            event.stopPropagation();
        }
    };
    DateInputComponent.prototype.getKendoDate = function (value) {
        return new KendoDate(this.intl, this.formatPlaceholder, this.format, value);
    };
    DateInputComponent.prototype.dateSymbolMap = function () {
        var reducer = function (map, part) {
            map[part.pattern[0]] = part.type;
            return map;
        };
        return this.intl.splitDateFormat(this.format).reduce(reducer, {});
    };
    DateInputComponent.prototype.updateElementValue = function (isActive) {
        var start = this.caret()[0]; //XXX: get caret position before input is updated
        var texts = this.kendoDate.getTextAndFormat();
        var showPlaceholder = !this.isActive && this.placeholder && !this.kendoDate.hasValue();
        this.currentFormat = texts[1];
        this.currentValue = !showPlaceholder ? texts[0] : this.placeholder;
        this.renderer.setProperty(this.dateInput.nativeElement, "value", this.currentValue);
        var currentDate = this.kendoDate.getDateObject();
        this.ariaValueNow = time(currentDate);
        this.ariaValueText = this.intl.formatDate(currentDate, this.format);
        if (isActive) {
            this.selectNearestSegment(start);
        }
    };
    DateInputComponent.prototype.hasChanged = function (changes, field) {
        var change = changes[field];
        return change && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["b" /* isEqual */])(change.previousValue, change.currentValue);
    };
    DateInputComponent.prototype.caret = function (start, end) {
        if (end === void 0) { end = start; }
        var isPosition = start !== undefined;
        var returnValue = [start, start];
        var element = this.dateInput.nativeElement;
        if (isPosition && this.disabled) {
            return undefined;
        }
        try {
            if (element.selectionStart !== undefined) {
                if (isPosition) {
                    element.focus();
                    element.setSelectionRange(start, end);
                }
                returnValue = [element.selectionStart, element.selectionEnd];
            }
        }
        catch (e) {
            returnValue = [];
        }
        return returnValue;
    };
    DateInputComponent.prototype.selectNearestSegment = function (index) {
        // Finds the nearest (in both directions) known part.
        for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {
            if (i < this.currentFormat.length && this.currentFormat[i] !== "_") {
                this.selectDateSegment(this.currentFormat[i]);
                return;
            }
            if (j >= 0 && this.currentFormat[j] !== "_") {
                this.selectDateSegment(this.currentFormat[j]);
                return;
            }
        }
    };
    DateInputComponent.prototype.verifyRange = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["k" /* isValidRange */])(this.min, this.max)) {
            throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + ".");
        }
    };
    DateInputComponent.prototype.verifyValue = function (value) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (value && !(value instanceof Date)) {
            throw new Error("The 'value' should be a valid JavaScript Date instance. Check " + VALUE_DOC_LINK + " for possible resolution.");
        }
    };
    DateInputComponent.prototype.putDateInRange = function () {
        var currentDate = this.kendoDate.getDateObject();
        var candidate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["l" /* dateInRange */])(currentDate, this.min, this.max);
        if (this.autoCorrect && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__progress_kendo_date_math__["b" /* isEqual */])(currentDate, candidate)) {
            this.kendoDate = this.getKendoDate(candidate);
        }
    };
    return DateInputComponent;
}());

DateInputComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                exportAs: 'kendo-dateinput',
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_4__angular_forms__["NG_VALUE_ACCESSOR"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return DateInputComponent; }), multi: true },
                    { provide: __WEBPACK_IMPORTED_MODULE_4__angular_forms__["NG_VALIDATORS"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return DateInputComponent; }), multi: true },
                    { provide: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */], useValue: 'kendo.dateinput' },
                    __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["a" /* LocalizationService */]
                ],
                selector: 'kendo-dateinput',
                template: "\n    <ng-container kendoDateInputLocalizedMessages\n        i18n-increment=\"kendo.dateinput.increment|The label for the **Increment** button in the DateInput\"\n        increment=\"Increase value\"\n\n        i18n-decrement=\"kendo.dateinput.decrement|The label for the **Decrement** button in the DateInput\"\n        decrement=\"Decrease value\"\n    >\n    </ng-container>\n    <span class=\"k-dateinput-wrap\" [class.k-state-focused]=\"isActive\">\n        <input\n            #dateInput\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            autocapitalize=\"off\"\n            spellcheck=\"false\"\n            class=\"k-input\"\n            role=\"spinbutton\"\n            [id]=\"id\"\n            [title]=\"title\"\n            [tabindex]=\"tabIndex\"\n            [attr.disabled]=\"disabled ? 'disabled' : undefined\"\n            [attr.aria-expanded]=\"isPopupOpen\"\n            [attr.aria-haspopup]=\"hasPopup\"\n            [attr.aria-valuemin]=\"ariaValueMin\"\n            [attr.aria-valuemax]=\"ariaValueMax\"\n            [attr.aria-valuenow]=\"ariaValueNow\"\n            [attr.aria-valuetext]=\"ariaValueText\"\n            (click)=\"handleClick()\"\n            (focus)=\"handleFocus()\"\n            (blur)=\"handleBlur()\"\n            (dragstart)=\"$event.preventDefault()\"\n            (drop)=\"$event.preventDefault()\"\n        />\n        <span *ngIf=\"spinners\" class=\"k-select\" (mousedown)=\"$event.preventDefault()\">\n            <span\n                class=\"k-link k-link-increase\"\n                [class.k-state-active]=\"arrowDirection === arrow.Up\"\n                (mousedown)=\"arrowDirection = arrow.Up\"\n                (mouseleave)=\"arrowDirection = arrow.None\"\n                (click)=\"handleButtonClick(1)\"\n                [title]=\"localization.get('increment')\"\n                [attr.aria-label]=\"localization.get('increment')\">\n                <span class=\"k-icon k-i-arrow-n\"></span>\n            </span>\n            <span\n                class=\"k-link k-link-decrease\"\n                (click)=\"handleButtonClick(-1)\"\n                [class.k-state-active]=\"arrowDirection === arrow.Down\"\n                (mousedown)=\"arrowDirection = arrow.Down\"\n                (mouseleave)=\"arrowDirection = arrow.None\"\n                [title]=\"localization.get('decrement')\"\n                [attr.aria-label]=\"localization.get('decrement')\">\n                <span class=\"k-icon k-i-arrow-s\"></span>\n            </span>\n        </span>\n    </span>\n  "
            },] },
];
/** @nocollapse */
DateInputComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_intl__["b" /* IntlService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
DateInputComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'formatPlaceholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'steps': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rangeValidation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'autoCorrect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'spinners': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'isPopupOpen': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'hasPopup': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'dateInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['dateInput',] },],
    'wrapperClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-dateinput',] },],
    'disabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'mousescroll': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['mousewheel', ['$event'],] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['onmousewheel', ['$event'],] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['DOMMouseScroll', ['$event'],] },],
    'handlePaste': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['paste', ['$event'],] },],
    'keydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
    'handleInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['input',] },],
};


/***/ }),
/* 265 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateInputCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(266);




/**
 * Custom component messages override default component messages.
 */
var DateInputCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DateInputCustomMessagesComponent, _super);
    function DateInputCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(DateInputCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return DateInputCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

DateInputCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return DateInputCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-dateinput-messages',
                template: ""
            },] },
];
/** @nocollapse */
DateInputCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 266 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'decrement': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'increment': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 267 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DatePickerComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__validators_min_validator__ = __webpack_require__(165);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__validators_max_validator__ = __webpack_require__(164);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__preventable_event__ = __webpack_require__(161);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__calendar_templates_cell_template_directive__ = __webpack_require__(154);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__calendar_templates_month_cell_template_directive__ = __webpack_require__(157);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__calendar_templates_year_cell_template_directive__ = __webpack_require__(159);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__calendar_templates_decade_cell_template_directive__ = __webpack_require__(156);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__calendar_templates_century_cell_template_directive__ = __webpack_require__(155);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__calendar_templates_weeknumber_cell_template_directive__ = __webpack_require__(158);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__util__ = __webpack_require__(14);
/* tslint:disable:max-line-length */

















var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-min';
var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-max';
var VALUE_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/#toc-using-with-json';
/**
 * Represents the Kendo UI DatePicker component for Angular.
 */
var DatePickerComponent = (function () {
    function DatePickerComponent(zone, localization, cdr, popupService, rtl) {
        this.zone = zone;
        this.localization = localization;
        this.cdr = cdr;
        this.popupService = popupService;
        this.rtl = rtl;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__util__["g" /* guid */])();
        /**
         * Defines the active view that the Calendar initially renders.
         * By default, the active view is `month`.
         *
         * > You have to set `activeView` within the `topView`-`bottomView` range.
         */
        this.activeView = __WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__["a" /* CalendarViewEnum */].month];
        /**
         * Defines the bottommost Calendar view, to which the user can navigate.
         */
        this.bottomView = __WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__["a" /* CalendarViewEnum */].month];
        /**
         * Defines the topmost Calendar view, to which the user can navigate.
         */
        this.topView = __WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__["a" /* CalendarViewEnum */][__WEBPACK_IMPORTED_MODULE_9__calendar_models_view_enum__["a" /* CalendarViewEnum */].century];
        /**
         * Sets or gets the `disabled` property of the DatePicker and determines whether the component is active.
         */
        this.disabled = false;
        /**
         * Sets or gets the `navigation` property of the Calendar.
         * and determines whether the navigation side-bar is displayed.
         */
        this.navigation = true;
        /**
         * Specifies the smallest valid date.
         */
        this.min = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_5__defaults__["d" /* MIN_DATE */]);
        /**
         * Specifies the biggest valid date.
         */
        this.max = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_5__defaults__["e" /* MAX_DATE */]);
        /**
         * Specifies the focused date of the Calendar component.
         */
        this.focusedDate = null;
        /**
         * Specifies the date format used to display the input value.
         */
        this.format = "d";
        /**
         * Specifies the hint the DatePicker displays when its value is `null`.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-datepicker placeholder="Enter birth date..."></kendo-datepicker>
         * `
         * })
         * class AppComponent { }
         * ```
         */
        this.placeholder = "";
        /**
         * Sets or gets the `tabIndex` property of the DatePicker.
         */
        this.tabIndex = 0;
        /**
         * Sets the title of the input element of the DatePicker.
         */
        this.title = "";
        /**
         * Determines whether the built-in min or max validators are enforced when validating a form.
         */
        this.rangeValidation = true;
        /**
         * Determines whether to display a week number column in the `month` view of the Calendar.
         */
        this.weekNumber = false;
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the input element.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-datepicker (focus)="handleFocus()"></kendo-datepicker>
         * `
         * })
         * class AppComponent {
         *   public handleFocus(): void {
         *      console.log("Component is focused");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onFocus` property.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-datepicker (blur)="handleBlur()"></kendo-datepicker>
         * `
         * })
         * class AppComponent {
         *   public handleBlur(): void {
         *      console.log("Component is blurred");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onBlur` property.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the popup is about to open.
         * This event is preventable. If you cancel the event, the popup will remain closed.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to close.
         * This event is preventable. If you cancel the event, the popup will remain open.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.isActive = false;
        this.popupUID = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__util__["g" /* guid */])();
        this._popupSettings = { animate: true };
        this._show = false;
        this._value = null;
        this.onChange = __WEBPACK_IMPORTED_MODULE_16__util__["h" /* noop */];
        this.onTouched = __WEBPACK_IMPORTED_MODULE_16__util__["h" /* noop */];
        this.minValidateFn = __WEBPACK_IMPORTED_MODULE_16__util__["h" /* noop */];
        this.maxValidateFn = __WEBPACK_IMPORTED_MODULE_16__util__["h" /* noop */];
        this.resolvedPromise = Promise.resolve(null);
        this.popupKeyDownHandler = this.handleKeydown.bind(this);
    }
    Object.defineProperty(DatePickerComponent.prototype, "popupSettings", {
        get: function () {
            return this._popupSettings;
        },
        /**
         * Configures the popup of the DatePicker.
         *
         * The available options are:
         * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
         * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
         */
        set: function (settings) {
            this._popupSettings = Object.assign({}, { animate: true }, settings);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DatePickerComponent.prototype, "value", {
        get: function () {
            return this._value;
        },
        /**
         * Specifies the value of the DatePicker component.
         *
         * > The `value` should be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
         */
        set: function (value) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])() && value && !(value instanceof Date)) {
                throw new Error("The 'value' should be a valid JavaScript Date instance. Check " + VALUE_DOC_LINK + " for possible resolution.");
            }
            this._value = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DatePickerComponent.prototype, "show", {
        get: function () {
            return this._show;
        },
        set: function (show) {
            var event = new __WEBPACK_IMPORTED_MODULE_8__preventable_event__["a" /* PreventableEvent */]();
            if (!this._show && show) {
                this.open.emit(event);
            }
            else if (this._show && !show) {
                this.close.emit(event);
            }
            if (event.isDefaultPrevented()) {
                return;
            }
            this._toggle(show);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DatePickerComponent.prototype.wrapperClasses = function () {
        return true;
    };
    Object.defineProperty(DatePickerComponent.prototype, "disabledClass", {
        /**
         * @hidden
         */
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DatePickerComponent.prototype.handleKeydown = function (event) {
        var altKey = event.altKey, keyCode = event.keyCode;
        if (keyCode === 27) {
            this.show = false;
        }
        if (altKey) {
            if (keyCode === 40 && !this.show) {
                this.show = true;
            }
            if (keyCode === 38) {
                this.show = false;
            }
        }
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.ngOnChanges = function (changes) {
        this.verifySettings();
        if (changes.min || changes.max) {
            this.minValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__validators_min_validator__["a" /* minValidator */])(this.min) : __WEBPACK_IMPORTED_MODULE_16__util__["h" /* noop */];
            this.maxValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__validators_max_validator__["a" /* maxValidator */])(this.max) : __WEBPACK_IMPORTED_MODULE_16__util__["h" /* noop */];
        }
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.ngOnDestroy = function () {
        this.show = false;
    };
    Object.defineProperty(DatePickerComponent.prototype, "isOpen", {
        /**
         * Returns the current open state of the popup.
         */
        get: function () {
            return this.show;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DatePickerComponent.prototype.writeValue = function (value) {
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value);
        this.cdr.markForCheck();
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.registerOnChange = function (fn) {
        this.onChange = fn;
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.registerOnTouched = function (fn) {
        this.onTouched = fn;
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.validate = function (control) {
        return this.minValidateFn(control) || this.maxValidateFn(control);
    };
    /**
     * Focuses the DatePicker component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="datepicker.focus()">Focus date picker</button>
     *  <kendo-datepicker #datepicker></kendo-datepicker>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    DatePickerComponent.prototype.focus = function () {
        this.input.focus();
    };
    /**
     * Blurs the DatePicker component.
     */
    DatePickerComponent.prototype.blur = function () {
        (this.calendar || this.input)['blur'](); //tslint:disable-line:no-string-literal
    };
    /**
     * Toggles the visibility of the popup. If you use the `toggle` method to show or hide the popup,
     * the `open` and `close` events do not fire.
     *
     * @param show - The state of the popup.
     */
    DatePickerComponent.prototype.toggle = function (show) {
        var _this = this;
        if (this.disabled) {
            return;
        }
        this.resolvedPromise.then(function () {
            _this._toggle((show === undefined) ? !_this.show : show);
        });
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.handleIconClick = function () {
        this.input.focus();
        //XXX: explicitly call the handleFocus handler here
        //due to async IE focus event
        this.handleFocus();
        this.show = !this.show;
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.handleChange = function (value) {
        this.cdr.markForCheck();
        this.input.focus();
        this.value = value;
        this.show = false;
        this.onChange(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value));
        this.valueChange.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value));
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.handleFocus = function () {
        var _this = this;
        if (this.isActive) {
            return;
        }
        this.isActive = true;
        this.nextTick(function () {
            if (!_this.hasActiveComponent()) {
                return;
            }
            _this.onFocus.emit();
        });
    };
    /**
     * @hidden
     */
    DatePickerComponent.prototype.handleBlur = function () {
        var _this = this;
        this.nextTick(function () {
            if (_this.hasActiveComponent()) {
                return;
            }
            _this.show = false;
            _this.isActive = false;
            _this.cdr.detectChanges();
            _this.onTouched();
            _this.onBlur.emit();
        });
    };
    Object.defineProperty(DatePickerComponent.prototype, "popupClasses", {
        /**
         * @hidden
         */
        get: function () {
            return [
                'k-calendar-container',
                'k-group',
                'k-reset'
            ].concat(this.popupSettings.popupClass || []);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DatePickerComponent.prototype, "appendTo", {
        /**
         * @hidden
         */
        get: function () {
            var appendTo = this.popupSettings.appendTo;
            if (!appendTo || appendTo === 'root') {
                return undefined;
            }
            return appendTo === 'component' ? this.container : appendTo;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DatePickerComponent.prototype.mergeTime = function (value) {
        return this.value && value ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__util__["q" /* setTime */])(value, this.value) : value;
    };
    DatePickerComponent.prototype._toggle = function (show) {
        var _this = this;
        this._show = show;
        if (this.popupRef) {
            this.popupRef
                .popupElement
                .removeEventListener('keydown', this.popupKeyDownHandler);
            this.popupRef.close();
            this.popupRef = null;
        }
        if (this._show) {
            var direction = this.rtl ? 'right' : 'left';
            this.popupRef = this.popupService.open({
                anchor: this.wrapper,
                anchorAlign: { vertical: 'bottom', horizontal: direction },
                animate: this.popupSettings.animate,
                appendTo: this.appendTo,
                content: this.popupTemplate,
                popupAlign: { vertical: 'top', horizontal: direction },
                popupClass: this.popupClasses,
                positionMode: 'absolute'
            });
            this.popupRef.popupElement.setAttribute('id', this.popupUID);
            this.popupRef.popupElement.addEventListener('keydown', this.popupKeyDownHandler);
            this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.show = false; });
            this.popupRef.popupOpen.subscribe(function () {
                if (!_this.calendar) {
                    _this.cdr.detectChanges();
                }
                if (_this.isActive) {
                    _this.calendar.focus();
                }
            });
            this.popupRef.popupClose.subscribe(function () {
                if (_this.isActive) {
                    _this.input.focus();
                }
            });
        }
    };
    DatePickerComponent.prototype.hasActiveComponent = function () {
        return this.input.isActive || (this.calendar && this.calendar.isActive);
    };
    DatePickerComponent.prototype.verifySettings = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__util__["k" /* isValidRange */])(this.min, this.max)) {
            throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + ".");
        }
    };
    DatePickerComponent.prototype.nextTick = function (f) {
        var _this = this;
        //XXX: use setTimeout due to async focus/blur events in IE
        //XXX: run the callback in the zone to give template updates for the parent component
        this.zone.runOutsideAngular(function () { return setTimeout(function () { return _this.zone.run(function () { return f(); }); }); });
    };
    return DatePickerComponent;
}());

DatePickerComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                exportAs: 'kendo-datepicker',
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return DatePickerComponent; }), multi: true },
                    { provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALIDATORS"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return DatePickerComponent; }), multi: true },
                    __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */],
                        useValue: 'kendo.datepicker'
                    }
                ],
                selector: 'kendo-datepicker',
                template: "\n        <ng-container kendoDatePickerLocalizedMessages\n            i18n-today=\"kendo.datepicker.today|The label for the today button in the calendar header\"\n            today=\"TODAY\"\n\n            i18n-toggle=\"kendo.datepicker.toggle|The label for the toggle button in the datepicker component\"\n            toggle=\"Toggle calendar\"\n        >\n        </ng-container>\n        <span #wrapper\n            class=\"k-picker-wrap k-state-default\"\n            [class.k-state-disabled]=\"disabled\"\n            [class.k-state-focused]=\"isActive\"\n        >\n            <kendo-dateinput\n                #input\n                [id]=\"id\"\n                [hasPopup]=\"true\"\n                [isPopupOpen]=\"show\"\n                [disabled]=\"disabled\"\n                [tabIndex]=\"!show ? tabIndex : -1\"\n                [title]=\"title\"\n                [format]=\"format\"\n                [formatPlaceholder]=\"formatPlaceholder\"\n                [placeholder]=\"placeholder\"\n                [min]=\"min\"\n                [max]=\"max\"\n                [value]=\"value\"\n                (valueChange)=\"handleChange($event)\"\n                (focus)=\"handleFocus()\"\n                (blur)=\"handleBlur()\"\n            ></kendo-dateinput>\n            <span class=\"k-select\"\n                role=\"button\"\n                [attr.title]=\"localization.get('toggle')\"\n                [attr.aria-label]=\"localization.get('toggle')\"\n                [attr.aria-controls]=\"popupUID\"\n                (mousedown)=\"$event.preventDefault()\"\n                (click)=\"handleIconClick()\"\n            >\n                <span class=\"k-icon k-i-calendar\"></span>\n            </span>\n        </span>\n        <ng-container #container></ng-container>\n        <ng-template #popupTemplate>\n            <kendo-calendar\n                #calendar\n                [min]=\"min\"\n                [max]=\"max\"\n                [navigation]=\"navigation\"\n                [activeView]=\"activeView\"\n                [bottomView]=\"bottomView\"\n                [topView]=\"topView\"\n                [weekNumber]=\"weekNumber\"\n                [cellTemplate]=\"cellTemplate\"\n                [monthCellTemplate]=\"monthCellTemplate\"\n                [yearCellTemplate]=\"yearCellTemplate\"\n                [decadeCellTemplate]=\"decadeCellTemplate\"\n                [centuryCellTemplate]=\"centuryCellTemplate\"\n                [weekNumberTemplate]=\"weekNumberTemplate\"\n                [focusedDate]=\"focusedDate\"\n                [value]=\"value\"\n                (valueChange)=\"handleChange(mergeTime($event))\"\n                (focus)=\"handleFocus()\"\n                (blur)=\"handleBlur()\"\n            >\n                <kendo-calendar-messages [today]=\"localization.get('today')\">\n                </kendo-calendar-messages>\n            </kendo-calendar>\n        <ng-template>\n    "
            },] },
];
/** @nocollapse */
DatePickerComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
DatePickerComponent.propDecorators = {
    'calendar': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['calendar',] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['container', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"] },] },],
    'input': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['input',] },],
    'popupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['popupTemplate',] },],
    'wrapper': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['wrapper',] },],
    'cellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_10__calendar_templates_cell_template_directive__["a" /* CellTemplateDirective */],] },],
    'monthCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_11__calendar_templates_month_cell_template_directive__["a" /* MonthCellTemplateDirective */],] },],
    'yearCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_12__calendar_templates_year_cell_template_directive__["a" /* YearCellTemplateDirective */],] },],
    'decadeCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_13__calendar_templates_decade_cell_template_directive__["a" /* DecadeCellTemplateDirective */],] },],
    'centuryCellTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_14__calendar_templates_century_cell_template_directive__["a" /* CenturyCellTemplateDirective */],] },],
    'weekNumberTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_15__calendar_templates_weeknumber_cell_template_directive__["a" /* WeekNumberCellTemplateDirective */],] },],
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'bottomView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'topView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupSettings': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'navigation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focusedDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'formatPlaceholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rangeValidation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'weekNumber': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'wrapperClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-datepicker',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-header',] },],
    'disabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'handleKeydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
};


/***/ }),
/* 268 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DatePickerModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__datepicker_component__ = __webpack_require__(267);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__calendar_calendar_module__ = __webpack_require__(153);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__calendar_templates_module__ = __webpack_require__(262);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__dateinput_dateinput_module__ = __webpack_require__(113);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__localization_localized_messages_directive__ = __webpack_require__(543);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__localization_datepicker_custom_messages_component__ = __webpack_require__(269);










var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__datepicker_component__["a" /* DatePickerComponent */],
    __WEBPACK_IMPORTED_MODULE_9__localization_datepicker_custom_messages_component__["a" /* DatePickerCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_8__localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */]
];
var COMPONENT_MODULES = [
    __WEBPACK_IMPORTED_MODULE_7__dateinput_dateinput_module__["a" /* DateInputModule */],
    __WEBPACK_IMPORTED_MODULE_5__calendar_calendar_module__["a" /* CalendarModule */],
    __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["a" /* IntlModule */],
    __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_popup__["b" /* PopupModule */],
    __WEBPACK_IMPORTED_MODULE_6__calendar_templates_module__["a" /* TemplatesModule */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the DatePicker component.
 */
var DatePickerModule = (function () {
    function DatePickerModule() {
    }
    return DatePickerModule;
}());

DatePickerModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_6__calendar_templates_module__["a" /* TemplatesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"]].concat(COMPONENT_MODULES)
            },] },
];
/** @nocollapse */
DatePickerModule.ctorParameters = function () { return []; };


/***/ }),
/* 269 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DatePickerCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(270);




/**
 * Custom component messages override default component messages.
 */
var DatePickerCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DatePickerCustomMessagesComponent, _super);
    function DatePickerCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(DatePickerCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return DatePickerCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

DatePickerCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return DatePickerCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-datepicker-messages',
                template: ""
            },] },
];
/** @nocollapse */
DatePickerCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 270 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'today': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'toggle': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 271 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DayPeriodService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);



var setHours = function (date, hours) {
    var clone = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["a" /* cloneDate */])(date);
    clone.setHours(hours);
    return clone;
};
var isAM = function (value) { return value !== null && value < 12; };
var isPM = function (value) { return value !== null && (!value || value > 11); };
var inRange = function (value, min, max) { return ((!min && !max) || (value >= min && value <= max)); };
var inReverseRange = function (value, min, max) { return ((!min && !max) || value >= min || value <= max); };
/**
 * @hidden
 */
var DayPeriodService = (function () {
    function DayPeriodService(intl) {
        this.intl = intl;
    }
    /**
     * @hidden
     */
    DayPeriodService.prototype.apply = function (value, candidate) {
        var hour = value.getHours();
        var hourAM = isAM(hour);
        var candidateAM = isAM(candidate.getHours());
        if ((hourAM && candidateAM) || (!hourAM && !candidateAM)) {
            return value;
        }
        var _a = this.normalizedRange(), min = _a[0], _b = _a[1], max = _b === void 0 ? 24 : _b;
        var result = hour + (candidateAM ? -12 : 12);
        return setHours(value, Math.min(Math.max(min, result), (max || 24)));
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.configure = function (settings) {
        var _a = settings.min, min = _a === void 0 ? this.min : _a, _b = settings.max, max = _b === void 0 ? this.max : _b, _c = settings.part, part = _c === void 0 ? this.part : _c;
        this.min = min;
        this.max = max;
        this.part = part;
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.data = function (_) {
        var names = this.part.names;
        if (!names) {
            return [];
        }
        var data = [];
        var _a = this.normalizedRange(), min = _a[0], max = _a[1];
        var dayPeriod = this.intl.dateFormatNames(names);
        if (isAM(min)) {
            data.push({ text: dayPeriod.am, value: setHours(this.min, min) });
        }
        if (isPM(max)) {
            data.push({ text: dayPeriod.pm, value: setHours(this.min, Math.max(12, max)) });
        }
        return this.min.getHours() !== min ? data.reverse() : data;
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.isRangeChanged = function (_, __) {
        return false;
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.limitRange = function (min, max, _) {
        return [min, max];
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.total = function () {
        var _a = this.normalizedRange(), min = _a[0], max = _a[1];
        if (!min && !max) {
            return 2;
        }
        if (min > 11 || max < 12) {
            return 1;
        }
        return 2;
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.selectedIndex = function (value) {
        if (!this.valueInList(value)) {
            return -1;
        }
        var index = Math.floor(value.getHours() / 12);
        return this.min.getHours() === this.normalizedRange()[0] ? index : (index === 0 ? 1 : 0);
    };
    /**
     * @hidden
     */
    DayPeriodService.prototype.valueInList = function (value) {
        var reverse = this.min.getHours() !== this.normalizedRange()[0];
        var isInRange = reverse ? inReverseRange : inRange;
        return isInRange(value.getHours(), this.min.getHours(), this.max.getHours());
    };
    DayPeriodService.prototype.normalizedRange = function () {
        var minHour = this.min.getHours();
        var maxHour = this.max.getHours();
        return [
            Math.min(minHour, maxHour),
            Math.max(minHour, maxHour)
        ];
    };
    return DayPeriodService;
}());

DayPeriodService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
DayPeriodService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };


/***/ }),
/* 272 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HoursService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(14);





var HOURS_IN_DAY = 24;
var clampToRange = function (rangeValue) { return function (value) { return value % rangeValue; }; };
var clamp = clampToRange(HOURS_IN_DAY);
var stepper = function (start, step) { return function (idx) { return clamp(start + (idx * step)); }; };
var distanceFromMin = function (value, min) { return clamp(HOURS_IN_DAY + value - min); };
var limit = function (borderValue) { return function (barrier, value) {
    var useBarrier = !value || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["d" /* getDate */])(barrier).getTime() === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["d" /* getDate */])(value).getTime();
    return useBarrier ? barrier : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["d" /* setHours */])(barrier, borderValue);
}; };
var limitDown = limit(0);
var limitUp = limit(HOURS_IN_DAY - 1);
/**
 * @hidden
 */
var HoursService = (function () {
    function HoursService(intl) {
        this.intl = intl;
        this.boundRange = false;
        this.insertUndividedMax = false;
    }
    HoursService.prototype.apply = function (value, candidate) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["d" /* setHours */])(value, candidate.getHours());
    };
    HoursService.prototype.configure = function (settings) {
        var _this = this;
        var _a = settings.boundRange, boundRange = _a === void 0 ? this.boundRange : _a, _b = settings.insertUndividedMax, insertUndividedMax = _b === void 0 ? this.insertUndividedMax : _b, _c = settings.min, min = _c === void 0 ? this.min : _c, _d = settings.max, max = _d === void 0 ? this.max : _d, part = settings.part, _e = settings.step, step = _e === void 0 ? this.step : _e;
        this.boundRange = boundRange;
        this.insertUndividedMax = insertUndividedMax;
        this.toListItem = function (hour) {
            var date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["d" /* setHours */])(__WEBPACK_IMPORTED_MODULE_3__defaults__["a" /* MIDNIGHT_DATE */], hour);
            return {
                text: _this.intl.formatDate(date, part.pattern),
                value: date
            };
        };
        this.min = min;
        this.max = max;
        this.step = step;
    };
    HoursService.prototype.data = function (selectedValue) {
        var _this = this;
        var min = this.range(selectedValue)[0];
        var getHour = stepper(min, this.step);
        var convertToItem = function (idx) { return (_this.toListItem(getHour(idx))); };
        var data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, this.countFromMin(selectedValue)).map(convertToItem);
        this.addLast(data);
        this.addMissing(data, selectedValue);
        return data;
    };
    HoursService.prototype.isRangeChanged = function (min, max) {
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["b" /* isEqual */])(this.min, min) || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["b" /* isEqual */])(this.max, max);
    };
    HoursService.prototype.limitRange = function (min, max, value) {
        return this.boundRange ? [limitDown(min, value), limitUp(max, value)] : [min, max];
    };
    HoursService.prototype.total = function (value) {
        var last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
        var missing = this.isMissing(value) ? 1 : 0;
        return this.countFromMin(value) + missing + last;
    };
    HoursService.prototype.selectedIndex = function (value) {
        return Math.ceil(this.divideByStep(value));
    };
    HoursService.prototype.valueInList = function (value) {
        if (!value) {
            return true;
        }
        var matchMax = this.insertUndividedMax && this.lastHour(value) === value.getHours();
        return matchMax || !this.isMissing(value);
    };
    HoursService.prototype.addLast = function (data, value) {
        if (this.insertUndividedMax && this.isLastMissing(value)) {
            data.push(this.toListItem(this.lastHour(value)));
        }
        return data;
    };
    HoursService.prototype.addMissing = function (data, value) {
        if (this.valueInList(value)) {
            return data;
        }
        var missingItem = this.toListItem(value.getHours());
        data.splice(this.selectedIndex(value), 0, missingItem);
        return data;
    };
    HoursService.prototype.countFromMin = function (value) {
        var _a = this.range(value), min = _a[0], max = _a[1];
        return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
    };
    HoursService.prototype.isMissing = function (value) {
        if (!value) {
            return false;
        }
        return this.selectedIndex(value) !== this.divideByStep(value);
    };
    HoursService.prototype.isLastMissing = function (value) {
        return this.isMissing(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["d" /* setHours */])(this.max, this.lastHour(value)));
    };
    HoursService.prototype.divideByStep = function (value) {
        return distanceFromMin(value.getHours(), this.min.getHours()) / this.step;
    };
    HoursService.prototype.lastHour = function (value) {
        return this.range(value)[1];
    };
    HoursService.prototype.range = function (value) {
        var _a = this.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];
        return [min.getHours(), max.getHours()];
    };
    return HoursService;
}());

HoursService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
HoursService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };


/***/ }),
/* 273 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MinutesService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(14);





var MINUTES_IN_HOUR = 60;
var clampToRange = function (rangeValue) { return function (value) { return value % rangeValue; }; };
var clamp = clampToRange(MINUTES_IN_HOUR);
var stepper = function (start, step) { return function (idx) { return clamp(start + (idx * step)); }; };
var distanceFromMin = function (value, min) { return clamp(MINUTES_IN_HOUR + value - min); };
var limit = function (borderValue) { return function (barrier, value) {
    var useBarrier = !value || barrier.getHours() === value.getHours();
    return useBarrier ? barrier : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["c" /* setMinutes */])(barrier, borderValue);
}; };
var limitDown = limit(0);
var limitUp = limit(MINUTES_IN_HOUR - 1);
/**
 * @hidden
 */
var MinutesService = (function () {
    function MinutesService(intl) {
        this.intl = intl;
        this.insertUndividedMax = false;
    }
    MinutesService.prototype.apply = function (value, candidate) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["c" /* setMinutes */])(value, candidate.getMinutes());
    };
    MinutesService.prototype.configure = function (settings) {
        var _this = this;
        var _a = settings.insertUndividedMax, insertUndividedMax = _a === void 0 ? this.insertUndividedMax : _a, _b = settings.min, min = _b === void 0 ? this.min : _b, _c = settings.max, max = _c === void 0 ? this.max : _c, part = settings.part, _d = settings.step, step = _d === void 0 ? this.step : _d;
        this.insertUndividedMax = insertUndividedMax;
        this.toListItem = function (minute) {
            var date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["c" /* setMinutes */])(__WEBPACK_IMPORTED_MODULE_3__defaults__["a" /* MIDNIGHT_DATE */], minute);
            return {
                text: _this.intl.formatDate(date, part.pattern),
                value: date
            };
        };
        this.min = min;
        this.max = max;
        this.step = step;
    };
    MinutesService.prototype.data = function (selectedValue) {
        var _this = this;
        var min = this.range(selectedValue)[0];
        var getMinute = stepper(min, this.step);
        var convertToItem = function (idx) { return (_this.toListItem(getMinute(idx))); };
        var data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, this.countFromMin(selectedValue)).map(convertToItem);
        this.addLast(data);
        this.addMissing(data, selectedValue);
        return data;
    };
    MinutesService.prototype.isRangeChanged = function (min, max) {
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["b" /* isEqual */])(this.min, min) || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["b" /* isEqual */])(this.max, max);
    };
    MinutesService.prototype.limitRange = function (min, max, value) {
        return [limitDown(min, value), limitUp(max, value)];
    };
    MinutesService.prototype.total = function (value) {
        var last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
        var missing = this.isMissing(value) ? 1 : 0;
        return this.countFromMin(value) + missing + last;
    };
    MinutesService.prototype.selectedIndex = function (value) {
        return Math.ceil(this.divideByStep(value));
    };
    MinutesService.prototype.valueInList = function (value) {
        if (!value) {
            return true;
        }
        var matchMax = this.insertUndividedMax && this.lastMinute(value) === value.getMinutes();
        return matchMax || !this.isMissing(value);
    };
    MinutesService.prototype.addLast = function (data, value) {
        if (this.insertUndividedMax && this.isLastMissing(value)) {
            data.push(this.toListItem(this.lastMinute(value)));
        }
        return data;
    };
    MinutesService.prototype.addMissing = function (data, value) {
        if (this.valueInList(value)) {
            return data;
        }
        var missingItem = this.toListItem(value.getMinutes());
        data.splice(this.selectedIndex(value), 0, missingItem);
        return data;
    };
    MinutesService.prototype.countFromMin = function (value) {
        var _a = this.range(value), min = _a[0], max = _a[1];
        return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
    };
    MinutesService.prototype.isMissing = function (value) {
        if (!value) {
            return false;
        }
        return this.selectedIndex(value) !== this.divideByStep(value);
    };
    MinutesService.prototype.isLastMissing = function (value) {
        return this.isMissing(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["c" /* setMinutes */])(this.max, this.lastMinute(value)));
    };
    MinutesService.prototype.divideByStep = function (value) {
        return distanceFromMin(value.getMinutes(), this.min.getMinutes()) / this.step;
    };
    MinutesService.prototype.lastMinute = function (value) {
        return this.range(value)[1];
    };
    MinutesService.prototype.range = function (value) {
        var _a = this.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];
        return [min.getMinutes(), max.getMinutes()];
    };
    return MinutesService;
}());

MinutesService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
MinutesService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };


/***/ }),
/* 274 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SecondsService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(14);





var SECONDS_IN_HOUR = 60;
var clampToRange = function (rangeValue) { return function (value) { return value % rangeValue; }; };
var clamp = clampToRange(SECONDS_IN_HOUR);
var stepper = function (start, step) { return function (idx) { return clamp(start + (idx * step)); }; };
var distanceFromMin = function (value, min) { return clamp(SECONDS_IN_HOUR + value - min); };
var limit = function (borderValue) { return function (barrier, value) {
    var useBarrier = !value || barrier.getHours() === value.getHours();
    return useBarrier ? barrier : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["a" /* setSeconds */])(barrier, borderValue);
}; };
var limitDown = limit(0);
var limitUp = limit(SECONDS_IN_HOUR - 1);
/**
 * @hidden
 */
var SecondsService = (function () {
    function SecondsService(intl) {
        this.intl = intl;
        this.insertUndividedMax = false;
    }
    SecondsService.prototype.apply = function (value, candidate) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["a" /* setSeconds */])(value, candidate.getSeconds());
    };
    SecondsService.prototype.configure = function (settings) {
        var _this = this;
        var _a = settings.insertUndividedMax, insertUndividedMax = _a === void 0 ? this.insertUndividedMax : _a, _b = settings.min, min = _b === void 0 ? this.min : _b, _c = settings.max, max = _c === void 0 ? this.max : _c, part = settings.part, _d = settings.step, step = _d === void 0 ? this.step : _d;
        this.insertUndividedMax = insertUndividedMax;
        this.toListItem = function (minute) {
            var date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["a" /* setSeconds */])(__WEBPACK_IMPORTED_MODULE_3__defaults__["a" /* MIDNIGHT_DATE */], minute);
            return {
                text: _this.intl.formatDate(date, part.pattern),
                value: date
            };
        };
        this.min = min;
        this.max = max;
        this.step = step;
    };
    SecondsService.prototype.data = function (selectedValue) {
        var _this = this;
        var min = this.range(selectedValue)[0];
        var getSecond = stepper(min, this.step);
        var convertToItem = function (idx) { return (_this.toListItem(getSecond(idx))); };
        var data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* range */])(0, this.countFromMin(selectedValue)).map(convertToItem);
        this.addLast(data);
        this.addMissing(data, selectedValue);
        return data;
    };
    SecondsService.prototype.isRangeChanged = function (min, max) {
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["b" /* isEqual */])(this.min, min) || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_date_math__["b" /* isEqual */])(this.max, max);
    };
    SecondsService.prototype.limitRange = function (min, max, value) {
        return [limitDown(min, value), limitUp(max, value)];
    };
    SecondsService.prototype.total = function (value) {
        var last = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;
        var missing = this.isMissing(value) ? 1 : 0;
        return this.countFromMin(value) + missing + last;
    };
    SecondsService.prototype.selectedIndex = function (value) {
        return Math.ceil(this.divideByStep(value));
    };
    SecondsService.prototype.valueInList = function (value) {
        if (!value) {
            return true;
        }
        var matchMax = this.insertUndividedMax && this.lastSecond(value) === value.getSeconds();
        return matchMax || !this.isMissing(value);
    };
    SecondsService.prototype.divideByStep = function (value) {
        return distanceFromMin(value.getSeconds(), this.min.getSeconds()) / this.step;
    };
    SecondsService.prototype.addLast = function (data, value) {
        if (this.insertUndividedMax && this.isLastMissing(value)) {
            data.push(this.toListItem(this.lastSecond(value)));
        }
        return data;
    };
    SecondsService.prototype.addMissing = function (data, value) {
        if (this.valueInList(value)) {
            return data;
        }
        var missingItem = this.toListItem(value.getSeconds());
        data.splice(this.selectedIndex(value), 0, missingItem);
        return data;
    };
    SecondsService.prototype.countFromMin = function (value) {
        var _a = this.range(value), min = _a[0], max = _a[1];
        return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */
    };
    SecondsService.prototype.isMissing = function (value) {
        if (!value) {
            return false;
        }
        return this.selectedIndex(value) !== this.divideByStep(value);
    };
    SecondsService.prototype.isLastMissing = function (value) {
        return this.isMissing(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["a" /* setSeconds */])(this.max, this.lastSecond(value)));
    };
    SecondsService.prototype.lastSecond = function (value) {
        return this.range(value)[1];
    };
    SecondsService.prototype.range = function (value) {
        var _a = this.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];
        return [min.getSeconds(), max.getSeconds()];
    };
    return SecondsService;
}());

SecondsService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
SecondsService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };


/***/ }),
/* 275 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeListComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_auditTime__ = __webpack_require__(105);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_auditTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_auditTime__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime__ = __webpack_require__(244);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_debounceTime__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__virtualization_virtualization_component__ = __webpack_require__(115);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__models_time_part_default__ = __webpack_require__(162);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_dom_service__ = __webpack_require__(163);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__services_hours_service__ = __webpack_require__(272);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__services_minutes_service__ = __webpack_require__(273);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__services_seconds_service__ = __webpack_require__(274);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__services_dayperiod_service__ = __webpack_require__(271);
/* tslint:disable:component-selector-name  component-selector-type */













var SNAP_THRESHOLD = 0.05; //% of the item height
var nil = function () { return (null); };
var getters = {
    35: function (data, _) { return data[data.length - 1]; },
    36: function (data, _) { return data[0]; },
    38: function (data, index) { return data[index - 1]; },
    40: function (data, index) { return data[index + 1]; }
};
var services = (_a = {},
    _a[__WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].dayperiod] = __WEBPACK_IMPORTED_MODULE_12__services_dayperiod_service__["a" /* DayPeriodService */],
    _a[__WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].hour] = __WEBPACK_IMPORTED_MODULE_9__services_hours_service__["a" /* HoursService */],
    _a[__WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].minute] = __WEBPACK_IMPORTED_MODULE_10__services_minutes_service__["a" /* MinutesService */],
    _a[__WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].second] = __WEBPACK_IMPORTED_MODULE_11__services_seconds_service__["a" /* SecondsService */],
    _a);
/**
 * @hidden
 */
var TimeListComponent = (function () {
    function TimeListComponent(element, injector, dom, renderer, zone) {
        this.element = element;
        this.injector = injector;
        this.dom = dom;
        this.renderer = renderer;
        this.zone = zone;
        this.min = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_6__defaults__["a" /* MIDNIGHT_DATE */]);
        this.max = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_6__defaults__["c" /* MAX_TIME */]);
        this.step = 1;
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.animateToIndex = true;
        this.isActive = false;
        this.skip = 0;
        this.total = 60;
        this.data = [];
        this.indexToScroll = -1;
    }
    Object.defineProperty(TimeListComponent.prototype, "tabIndex", {
        get: function () {
            return 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimeListComponent.prototype, "componentClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TimeListComponent.prototype.keydown = function (e) {
        var getter = getters[e.keyCode] || nil;
        var dataItem = getter(this.data, this.service.selectedIndex(this.value));
        if (dataItem) {
            this.handleChange(dataItem);
            e.preventDefault();
        }
    };
    /**
     * @hidden
     */
    TimeListComponent.prototype.handleBlur = function () {
        this.isActive = false;
    };
    /**
     * @hidden
     */
    TimeListComponent.prototype.handleFocus = function () {
        this.isActive = true;
    };
    /**
     * @hidden
     */
    TimeListComponent.prototype.handleClick = function () {
        this.focus();
    };
    TimeListComponent.prototype.ngOnChanges = function (changes) {
        if (changes.part) {
            this.service = this.injector.get(services[this.part.type]);
            this.service.configure(this.serviceSettings());
        }
        var value = this.value;
        var valueChanges = changes.value || {};
        var _a = this.service.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];
        if (this.service.isRangeChanged(min, max) || changes.min || changes.max || changes.step) {
            this.data = [];
            this.service.configure(this.serviceSettings({ min: min, max: max }));
        }
        // Skip the rendering of the list whenever possible
        if (!this.data.length || this.hasMissingValue(valueChanges)) {
            this.animateToIndex = false;
            this.data = this.service.data(value);
        }
        this.animateToIndex = this.animateToIndex && this.textHasChanged(valueChanges);
        this.total = this.service.total(value);
        this.indexToScroll = this.selectedIndex(value);
    };
    TimeListComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.animateToIndex = true;
        this.dom.ensureHeights();
        this.itemHeight = this.dom.itemHeight;
        this.listHeight = this.dom.timeListHeight;
        this.topOffset = (this.listHeight - this.itemHeight) / 2;
        this.bottomOffset = this.listHeight - this.itemHeight;
        var translate = "translateY(" + this.topOffset + "px)";
        this.style = { transform: translate, '-ms-transform': translate };
        this.scrollSubscription = this.virtualization
            .scroll$()
            .debounceTime(100)
            .map(function (e) { return e.target.scrollTop; })
            .map(function (top) { return _this.itemOffset(top); })
            .map(function (itemOffset) { return _this.virtualization.itemIndex(itemOffset); })
            .subscribe(function (index) {
            _this.virtualization.scrollToIndex(index);
            _this.handleChange(_this.data[index]);
        });
        this.zone.runOutsideAngular(function () {
            _this.unsubscribeMouseOver = _this.renderer.listen(_this.element.nativeElement, 'mouseover', function () { if (!_this.isActive) {
                _this.focus();
            } });
        });
    };
    TimeListComponent.prototype.ngOnDestroy = function () {
        this.scrollSubscription.unsubscribe();
        if (this.unsubscribeMouseOver) {
            this.unsubscribeMouseOver();
            this.unsubscribeMouseOver = null;
        }
    };
    TimeListComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.scrollOnce(function (index) { return _this.virtualization.scrollToIndex(index); });
    };
    TimeListComponent.prototype.ngAfterViewChecked = function () {
        var _this = this;
        this.scrollOnce(function (index) {
            var action = _this.animateToIndex ? 'animateToIndex' : 'scrollToIndex';
            _this.virtualization[action](index);
            _this.animateToIndex = true;
        });
    };
    TimeListComponent.prototype.handleChange = function (dataItem) {
        var candidate = this.service.apply(this.value, dataItem.value);
        if (this.value.getTime() === candidate.getTime()) {
            return;
        }
        this.indexToScroll = this.data.indexOf(dataItem);
        this.value = candidate;
        this.valueChange.emit(candidate);
    };
    /**
     * Focuses the host element of the TimeList.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="timelist.focus()">Focus TimeList</button>
     *  <kendo-timelist #timelist></kendo-timelist>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    TimeListComponent.prototype.focus = function () {
        if (!this.element) {
            return;
        }
        this.element.nativeElement.focus();
    };
    /**
     * Blurs the TimeList component.
     */
    TimeListComponent.prototype.blur = function () {
        if (!this.element) {
            return;
        }
        this.element.nativeElement.blur();
    };
    TimeListComponent.prototype.itemOffset = function (top) {
        var diff = top - this.virtualization.itemOffset(this.virtualization.activeIndex());
        var itemHeight = this.itemHeight;
        var topThreshold = itemHeight * SNAP_THRESHOLD;
        var bottomThreshold = itemHeight * (1 - SNAP_THRESHOLD);
        var scrolledDown = diff < (itemHeight / 2);
        var shouldSwitch = diff > topThreshold && diff < bottomThreshold;
        return scrolledDown && shouldSwitch ? top + itemHeight : top;
    };
    TimeListComponent.prototype.hasMissingValue = function (_a) {
        var previousValue = _a.previousValue, currentValue = _a.currentValue;
        var isPreviousMissing = previousValue && !this.service.valueInList(previousValue);
        var isCurrentMissing = currentValue && !this.service.valueInList(currentValue);
        return isPreviousMissing || isCurrentMissing;
    };
    TimeListComponent.prototype.scrollOnce = function (action) {
        if (this.indexToScroll !== -1) {
            action(this.indexToScroll);
            this.indexToScroll = -1;
        }
    };
    TimeListComponent.prototype.serviceSettings = function (settings) {
        var defaults = {
            boundRange: false,
            insertUndividedMax: false,
            max: this.max,
            min: this.min,
            part: this.part,
            step: this.step
        };
        var result = Object.assign({}, defaults, settings);
        result.boundRange = result.part.type !== 'hour';
        return result;
    };
    TimeListComponent.prototype.selectedIndex = function (value) {
        if (!value) {
            return -1;
        }
        return this.service.selectedIndex(value);
    };
    TimeListComponent.prototype.textHasChanged = function (_a) {
        var previousValue = _a.previousValue, currentValue = _a.currentValue;
        if (!previousValue || !currentValue) {
            return false;
        }
        var oldData = this.data[this.selectedIndex(previousValue)];
        var newData = this.data[this.selectedIndex(currentValue)];
        return oldData && newData && oldData.text !== newData.text;
    };
    return TimeListComponent;
}());

TimeListComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-timelist',
                template: "\n    <kendo-virtualization\n        [skip]=\"skip\"\n        [take]=\"total\"\n        [total]=\"total\"\n        [itemHeight]=\"itemHeight\"\n        [maxScrollDifference]=\"listHeight\"\n        [topOffset]=\"topOffset\"\n        [bottomOffset]=\"bottomOffset\"\n        class=\"k-time-container\"\n        role=\"presentation\"\n        tabindex=\"-1\"\n    >\n        <ul [ngStyle]=\"style\" class=\"k-reset\">\n            <li *ngFor=\"let item of data\" (click)=\"handleChange(item)\" class=\"k-item\">\n                <span>{{item.text}}</span>\n            </li>\n        </ul>\n    </kendo-virtualization>\n  "
            },] },
];
/** @nocollapse */
TimeListComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injector"], },
    { type: __WEBPACK_IMPORTED_MODULE_8__services_dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };
TimeListComponent.propDecorators = {
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'part': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'step': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'virtualization': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_5__virtualization_virtualization_component__["a" /* VirtualizationComponent */],] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["attr.tabindex",] },],
    'componentClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-time-list",] },],
    'keydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
    'handleBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["blur",] },],
    'handleFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["focus",] },],
    'handleClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ["click",] },],
};
var _a;


/***/ }),
/* 276 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimePickerComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__preventable_event__ = __webpack_require__(161);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__validators_time_range_validator__ = __webpack_require__(550);









/**
 * Represents the Kendo UI TimePicker component for Angular.
 */
var TimePickerComponent = (function () {
    function TimePickerComponent(zone, localization, cdr, popupService, rtl) {
        this.zone = zone;
        this.localization = localization;
        this.cdr = cdr;
        this.popupService = popupService;
        this.rtl = rtl;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["g" /* guid */])();
        /**
         * Sets or gets the `disabled` property of the TimePicker and determines whether the component is active.
         */
        this.disabled = false;
        /**
         * Specifies the time format used to display the input value.
         */
        this.format = 't';
        /**
         * Specifies the hint the TimePicker displays when its value is `null`.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timepicker placeholder="Enter start..."></kendo-timepicker>
         * `
         * })
         * class AppComponent { }
         * ```
         */
        this.placeholder = "";
        /**
         * Determines whether to display the **Cancel** button in the popup.
         */
        this.cancelButton = true;
        /**
         * Determines whether to display the **Now** button in the popup.
         *
         * > If the current time is out of range or the incremental step is greater than `1`, the **Now** button will be hidden.
         */
        this.nowButton = true;
        /**
         * Sets or gets the `tabIndex` property of the TimePicker.
         */
        this.tabIndex = 0;
        /**
         * Sets the title of the input element of the TimePicker.
         */
        this.title = "";
        /**
         * Determines whether the built-in min or max validators are enforced when a form is being validated.
         */
        this.rangeValidation = true;
        /**
         * Specifies the value of the TimePicker component.
         */
        this.value = null;
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the input element.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timepicker (focus)="handleFocus()"></kendo-timepicker>
         * `
         * })
         * class AppComponent {
         *   public handleFocus(): void {
         *      console.log("Component is focused");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onFocus` property.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timepicker (blur)="handleBlur()"></kendo-timepicker>
         * `
         * })
         * class AppComponent {
         *   public handleBlur(): void {
         *      console.log("Component is blurred");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onBlur` property.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the popup is about to open.
         * This event is preventable. If you cancel the event, the popup will remain closed.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to close.
         * This event is preventable. If you cancel the event, the popup will remain open.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.isActive = false;
        this.popupUID = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["g" /* guid */])();
        this.onChange = __WEBPACK_IMPORTED_MODULE_7__util__["h" /* noop */];
        this.onTouched = __WEBPACK_IMPORTED_MODULE_7__util__["h" /* noop */];
        this.resolvedPromise = Promise.resolve(null);
        this.timeRangeValidateFn = __WEBPACK_IMPORTED_MODULE_7__util__["h" /* noop */];
        this._min = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_5__defaults__["b" /* MIN_TIME */]);
        this._max = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_5__defaults__["c" /* MAX_TIME */]);
        this._popupSettings = { animate: true };
        this._show = false;
        this._steps = {};
    }
    Object.defineProperty(TimePickerComponent.prototype, "min", {
        get: function () {
            return this._min;
        },
        /**
         * Specifies the smallest valid time value.
         */
        set: function (min) {
            this._min = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(min || __WEBPACK_IMPORTED_MODULE_5__defaults__["b" /* MIN_TIME */]);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimePickerComponent.prototype, "max", {
        get: function () {
            return this._max;
        },
        /**
         * Specifies the biggest valid time value.
         */
        set: function (max) {
            this._max = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(max || __WEBPACK_IMPORTED_MODULE_5__defaults__["c" /* MAX_TIME */]);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimePickerComponent.prototype, "steps", {
        get: function () {
            return this._steps;
        },
        /**
         * Configures the incremental steps of the TimePicker.
         *
         * The available options are:
         * - `hour: Number`&mdash;Controls the incremental step of the hour value.
         * - `minute: Number`&mdash;Controls the incremental step of the minute value.
         * - `second: Number`&mdash;Controls the incremental step of the second value.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timepicker format="HH:mm:ss" [steps]="steps"></kendo-timepicker>
         * `
         * })
         * class AppComponent {
         *   public steps = { hour: 2, minute: 15, second: 15 };
         * }
         * ```
         *
         * > If the incremental step is greater than `1`, the **Now** button will be hidden.
         */
        set: function (steps) {
            this._steps = steps || {};
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimePickerComponent.prototype, "popupSettings", {
        get: function () {
            return this._popupSettings;
        },
        /**
         * Configures the popup of the TimePicker.
         *
         * The available options are:
         * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
         * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
         */
        set: function (settings) {
            this._popupSettings = Object.assign({}, { animate: true }, settings);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimePickerComponent.prototype, "show", {
        get: function () {
            return this._show;
        },
        set: function (show) {
            var event = new __WEBPACK_IMPORTED_MODULE_6__preventable_event__["a" /* PreventableEvent */]();
            if (!this._show && show) {
                this.open.emit(event);
            }
            else if (this._show && !show) {
                this.close.emit(event);
            }
            if (event.isDefaultPrevented()) {
                return;
            }
            this._toggle(show);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TimePickerComponent.prototype.wrapperClasses = function () {
        return true;
    };
    Object.defineProperty(TimePickerComponent.prototype, "disabledClass", {
        /**
         * @hidden
         */
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TimePickerComponent.prototype.handleKeydown = function (event) {
        var altKey = event.altKey, keyCode = event.keyCode;
        if (keyCode === 27) {
            this.show = false;
            return;
        }
        if (altKey) {
            if (keyCode === 38) {
                this.show = false;
            }
            if (keyCode === 40 && !this.show) {
                this.show = true;
            }
        }
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.ngOnChanges = function (changes) {
        if (changes.min || changes.max) {
            this.timeRangeValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__validators_time_range_validator__["a" /* timeRangeValidator */])(this.min, this.max) : __WEBPACK_IMPORTED_MODULE_7__util__["h" /* noop */];
        }
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.ngOnDestroy = function () {
        this.show = false;
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.writeValue = function (value) {
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value);
        this.cdr.markForCheck();
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.registerOnChange = function (fn) {
        this.onChange = fn;
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.registerOnTouched = function (fn) {
        this.onTouched = fn;
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
        this.cdr.markForCheck();
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.validate = function (control) {
        return this.timeRangeValidateFn(control);
    };
    /**
     * Focuses the TimePicker component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="timepicker.focus()">Focus time picker</button>
     *  <kendo-timepicker #timepicker></kendo-timepicker>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    TimePickerComponent.prototype.focus = function () {
        this.input.focus();
    };
    /**
     * Blurs the TimePicker component.
     */
    TimePickerComponent.prototype.blur = function () {
        (this.timeSelector || this.input)['blur'](); //tslint:disable-line:no-string-literal
    };
    /**
     * Toggles the visibility of the popup. If you use the `toggle` method to show or hide the popup,
     * the `open` and `close` events do not fire.
     *
     * @param show - The state of the popup.
     */
    TimePickerComponent.prototype.toggle = function (show) {
        var _this = this;
        if (this.disabled) {
            return;
        }
        this.resolvedPromise.then(function () {
            _this._toggle((show === undefined) ? !_this.show : show);
        });
    };
    Object.defineProperty(TimePickerComponent.prototype, "isOpen", {
        /**
         * Returns the current open state of the popup.
         */
        get: function () {
            return this.show;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimePickerComponent.prototype, "appendTo", {
        /**
         * @hidden
         */
        get: function () {
            var appendTo = this.popupSettings.appendTo;
            if (!appendTo || appendTo === 'root') {
                return undefined;
            }
            return appendTo === 'component' ? this.container : appendTo;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TimePickerComponent.prototype.handleChange = function (value) {
        this.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value);
        this.input.focus();
        this.show = false;
        this.onChange(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value));
        this.valueChange.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(value));
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.handleFocus = function () {
        var _this = this;
        if (this.isActive) {
            return;
        }
        this.isActive = true;
        this.nextTick(function () {
            if (!_this.hasActiveComponent()) {
                return;
            }
            _this.onFocus.emit();
        });
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.handleBlur = function () {
        var _this = this;
        this.nextTick(function () {
            if (_this.hasActiveComponent()) {
                return;
            }
            _this.show = false;
            _this.isActive = false;
            _this.cdr.detectChanges();
            _this.onTouched();
            _this.onBlur.emit();
        });
    };
    /**
     * @hidden
     */
    TimePickerComponent.prototype.handleIconClick = function () {
        this.input.focus();
        //XXX: explicit call handleFocus handler here
        //due to async IE focus event
        this.handleFocus();
        this.show = !this.show;
    };
    Object.defineProperty(TimePickerComponent.prototype, "popupClasses", {
        /**
         * @hidden
         */
        get: function () {
            return [
                'k-group',
                'k-reset'
            ].concat(this.popupSettings.popupClass || []);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TimePickerComponent.prototype.normalizeTime = function (date) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["q" /* setTime */])(__WEBPACK_IMPORTED_MODULE_5__defaults__["a" /* MIDNIGHT_DATE */], date);
    };
    TimePickerComponent.prototype._toggle = function (show) {
        var _this = this;
        this._show = show;
        this.cdr.markForCheck();
        if (this.popupRef) {
            this.popupRef.close();
            this.popupRef = null;
        }
        if (this._show) {
            var direction = this.rtl ? 'right' : 'left';
            this.popupRef = this.popupService.open({
                anchor: this.wrapper,
                anchorAlign: { vertical: 'bottom', horizontal: direction },
                animate: this.popupSettings.animate,
                appendTo: this.appendTo,
                content: this.popupTemplate,
                popupAlign: { vertical: 'top', horizontal: direction },
                popupClass: this.popupClasses,
                positionMode: 'absolute'
            });
            this.popupRef.popupElement.setAttribute('id', this.popupUID);
            this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.show = false; });
            this.popupRef.popupOpen.subscribe(function () {
                if (!_this.timeSelector) {
                    _this.cdr.detectChanges();
                }
                if (_this.isActive) {
                    _this.timeSelector.focus();
                }
            });
            this.popupRef.popupClose.subscribe(function () {
                if (_this.isActive) {
                    _this.input.focus();
                }
            });
        }
    };
    TimePickerComponent.prototype.hasActiveComponent = function () {
        return this.input.isActive || (this.timeSelector && this.timeSelector.isActive);
    };
    TimePickerComponent.prototype.nextTick = function (f) {
        var _this = this;
        //XXX: use setTimeout due to async focus/blur events in IE
        //XXX: run the callback in the zone to give template updates for the parent component
        this.zone.runOutsideAngular(function () { return setTimeout(function () { return _this.zone.run(function () { return f(); }); }); });
    };
    return TimePickerComponent;
}());

TimePickerComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                exportAs: 'kendo-timepicker',
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return TimePickerComponent; }), multi: true },
                    { provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALIDATORS"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return TimePickerComponent; }), multi: true },
                    __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */],
                        useValue: 'kendo.timepicker'
                    }
                ],
                selector: 'kendo-timepicker',
                template: "\n        <ng-container kendoTimePickerLocalizedMessages\n            i18n-accept=\"kendo.timepicker.accept|The Accept button text in the timepicker component\"\n            accept=\"Set\"\n\n            i18n-acceptLabel=\"kendo.timepicker.acceptLabel|The label for the Accept button in the timepicker component\"\n            acceptLabel=\"Set time\"\n\n            i18n-cancel=\"kendo.timepicker.cancel|The Cancel button text in the timepicker component\"\n            cancel=\"Cancel\"\n\n            i18n-cancelLabel=\"kendo.timepicker.cancelLabel|The label for the Cancel button in the timepicker component\"\n            cancelLabel=\"Cancel changes\"\n\n            i18n-now=\"kendo.timepicker.now|The Now button text in the timepicker component\"\n            now=\"Now\"\n\n            i18n-nowLabel=\"kendo.timepicker.nowLabel|The label for the Now button in the timepicker component\"\n            nowLabel=\"Select now\"\n\n            i18n-toggle=\"kendo.timepicker.toggle|The label for the toggle button in the timepicker component\"\n            toggle=\"Toggle time list\"\n        >\n        </ng-container>\n        <span #wrapper\n            class=\"k-picker-wrap k-state-default\"\n            [class.k-state-disabled]=\"disabled\"\n            [class.k-state-focused]=\"isActive\"\n        >\n            <kendo-dateinput\n                #input\n                [id]=\"id\"\n                [hasPopup]=\"true\"\n                [isPopupOpen]=\"show\"\n                [disabled]=\"disabled\"\n                [format]=\"format\"\n                [formatPlaceholder]=\"formatPlaceholder\"\n                [placeholder]=\"placeholder\"\n                [min]=\"normalizeTime(min)\"\n                [max]=\"normalizeTime(max)\"\n                [steps]=\"steps\"\n                [tabIndex]=\"!show ? tabIndex : -1\"\n                [title]=\"title\"\n                [value]=\"value\"\n                (valueChange)=\"handleChange($event)\"\n                (focus)=\"handleFocus()\"\n                (blur)=\"handleBlur()\"\n            ></kendo-dateinput>\n            <span class=\"k-select\"\n                role=\"button\"\n                [attr.title]=\"localization.get('toggle')\"\n                [attr.aria-label]=\"localization.get('toggle')\"\n                [attr.aria-controls]=\"popupUID\"\n                (mousedown)=\"$event.preventDefault()\"\n                (click)=\"handleIconClick()\"\n            >\n                <span class=\"k-icon k-i-clock\"></span>\n            </span>\n            <ng-template #popupTemplate>\n                <kendo-timeselector\n                    #timeSelector\n                    [cancelButton]=\"cancelButton\"\n                    [nowButton]=\"nowButton\"\n\n                    [format]=\"format\"\n                    [min]=\"min\"\n                    [max]=\"max\"\n                    [steps]=\"steps\"\n                    [value]=\"value\"\n\n                    (focus)=\"handleFocus()\"\n                    (blur)=\"handleBlur()\"\n                    (keydown)=\"handleKeydown($event)\"\n                    (mousedown)=\"$event.preventDefault()\"\n                    (valueChange)=\"handleChange($event)\"\n                    (valueReject)=\"show = false\"\n                >\n                    <kendo-timeselector-messages\n                        [acceptLabel]=\"localization.get('acceptLabel')\"\n                        [accept]=\"localization.get('accept')\"\n                        [cancelLabel]=\"localization.get('cancelLabel')\"\n                        [cancel]=\"localization.get('cancel')\"\n                        [nowLabel]=\"localization.get('nowLabel')\"\n                        [now]=\"localization.get('now')\"\n                    >\n                    </kendo-timeselector-messages>\n                </kendo-timeselector>\n            </ng-template>\n        </span>\n        <ng-container #container></ng-container>\n    "
            },] },
];
/** @nocollapse */
TimePickerComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
TimePickerComponent.propDecorators = {
    'input': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['input',] },],
    'timeSelector': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['timeSelector',] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['container', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"] },] },],
    'popupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['popupTemplate',] },],
    'wrapper': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['wrapper',] },],
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'formatPlaceholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'cancelButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'nowButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'steps': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupSettings': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rangeValidation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'wrapperClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-timepicker',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-header',] },],
    'disabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'handleKeydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
};


/***/ }),
/* 277 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimePickerModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__timelist_component__ = __webpack_require__(275);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__timepicker_component__ = __webpack_require__(276);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__timeselector_component__ = __webpack_require__(548);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__virtualization_virtualization_module__ = __webpack_require__(278);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_dom_service__ = __webpack_require__(163);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__services_hours_service__ = __webpack_require__(272);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__services_minutes_service__ = __webpack_require__(273);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__services_seconds_service__ = __webpack_require__(274);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__services_dayperiod_service__ = __webpack_require__(271);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__dateinput_dateinput_module__ = __webpack_require__(113);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__localization_localized_messages_directive__ = __webpack_require__(544);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__localization_timepicker_custom_messages_component__ = __webpack_require__(545);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__localization_timeselector_localized_messages_directive__ = __webpack_require__(547);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__localization_timeselector_custom_messages_component__ = __webpack_require__(546);


















var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_14__localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */],
    __WEBPACK_IMPORTED_MODULE_4__timelist_component__["a" /* TimeListComponent */],
    __WEBPACK_IMPORTED_MODULE_15__localization_timepicker_custom_messages_component__["a" /* TimePickerCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_5__timepicker_component__["a" /* TimePickerComponent */],
    __WEBPACK_IMPORTED_MODULE_16__localization_timeselector_localized_messages_directive__["a" /* TimeSelectorLocalizedMessagesDirective */],
    __WEBPACK_IMPORTED_MODULE_17__localization_timeselector_custom_messages_component__["a" /* TimeSelectorCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_6__timeselector_component__["a" /* TimeSelectorComponent */]
];
var COMPONENT_MODULES = [
    __WEBPACK_IMPORTED_MODULE_13__dateinput_dateinput_module__["a" /* DateInputModule */],
    __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["a" /* IntlModule */],
    __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_popup__["b" /* PopupModule */],
    __WEBPACK_IMPORTED_MODULE_7__virtualization_virtualization_module__["a" /* VirtualizationModule */]
];
var providers = [__WEBPACK_IMPORTED_MODULE_8__services_dom_service__["a" /* DOMService */], __WEBPACK_IMPORTED_MODULE_9__services_hours_service__["a" /* HoursService */], __WEBPACK_IMPORTED_MODULE_10__services_minutes_service__["a" /* MinutesService */], __WEBPACK_IMPORTED_MODULE_11__services_seconds_service__["a" /* SecondsService */], __WEBPACK_IMPORTED_MODULE_12__services_dayperiod_service__["a" /* DayPeriodService */]];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the TimePicker component.
 */
var TimePickerModule = (function () {
    function TimePickerModule() {
    }
    return TimePickerModule;
}());

TimePickerModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"]].concat(COMPONENT_MODULES),
                providers: providers
            },] },
];
/** @nocollapse */
TimePickerModule.ctorParameters = function () { return []; };


/***/ }),
/* 278 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualizationModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__virtualization_virtualization_component__ = __webpack_require__(115);



var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_2__virtualization_virtualization_component__["a" /* VirtualizationComponent */]
];
/**
 * @hidden
 *
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Virtualization component.
 */
var VirtualizationModule = (function () {
    function VirtualizationModule() {
    }
    return VirtualizationModule;
}());

VirtualizationModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"]]
            },] },
];
/** @nocollapse */
VirtualizationModule.ctorParameters = function () { return []; };


/***/ }),
/* 279 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export AUTOCOMPLETE_VALUE_ACCESSOR */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AutoCompleteComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__searchbar_component__ = __webpack_require__(117);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templates_item_template_directive__ = __webpack_require__(65);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__templates_header_template_directive__ = __webpack_require__(64);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__templates_footer_template_directive__ = __webpack_require__(63);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__selection_service__ = __webpack_require__(61);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_service__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__navigation_action__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__templates_no_data_template_directive__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__common_keys__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__common_preventable_event__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_distinctUntilChanged__ = __webpack_require__(147);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_distinctUntilChanged___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_distinctUntilChanged__);
/* tslint:disable:no-null-keyword */
/* tslint:disable:max-line-length */
/* tslint:disable:no-bitwise */


















var InternalState;
(function (InternalState) {
    InternalState[InternalState["None"] = 0] = "None";
    InternalState[InternalState["SetInitial"] = 1] = "SetInitial";
    InternalState[InternalState["UseInitial"] = 2] = "UseInitial";
})(InternalState || (InternalState = {}));
var NO_VALUE = "";
/**
 * @hidden
 */
var AUTOCOMPLETE_VALUE_ACCESSOR = {
    multi: true,
    provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],
    // tslint:disable-next-line:no-use-before-declare
    useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return AutoCompleteComponent; })
};
/**
 * Represents the Kendo UI AutoComplete component for Angular.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-autocomplete
 *      [data]="listItems"
 *      [placeholder]="placeholder"
 *  >
 * `
 * })
 * class AppComponent {
 *   public placeholder: string = 'Type "it" for suggestions';
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 */
var AutoCompleteComponent = (function () {
    function AutoCompleteComponent(rtl, popupService, selectionService, navigationService, cdr, renderer, wrapper) {
        this.popupService = popupService;
        this.selectionService = selectionService;
        this.navigationService = navigationService;
        this.cdr = cdr;
        this.renderer = renderer;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["e" /* guid */])();
        /**
         * The hint displayed when the component is empty.
         *
         */
        this.placeholder = "";
        /**
         * @hidden
         *
         * If set to `true`, renders a button on hovering over the component. Clicking this button resets the value of the component to `undefined` and triggers the `change` event.
         */
        this.clearButton = true;
        /**
         * Sets the disabled state of the component.
         */
        this.disabled = false;
        /**
         * Sets the readonly state of the component.
         */
        this.readonly = false;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Enables the filter functionality. If set to `true`, the component emits the `filterChange` event.
         */
        this.filterable = false;
        /**
         * Fires each time the value is changed.
         *
         * For more details, refer to the example on [events]({% slug overview_autocomplete %}#toc-events).
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user types in the input. You can filter the source based on the passed filtration value.
         *
         * For more details, refer to the example on [events]({% slug overview_autocomplete %}#toc-events).
         */
        this.filterChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to open.
         * This event is preventable. If you cancel it, the popup will remain closed.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to close.
         * This event is preventable. If you cancel it, the popup will remain open.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the AutoComplete.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the AutoComplete gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        this.listBoxId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["e" /* guid */])();
        this.optionPrefix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["e" /* guid */])();
        this.onChangeCallback = function (_value) { };
        this.onTouchedCallback = function (_) { };
        this.popupMouseDownHandler = function (event) { return event.preventDefault(); };
        this._popupSettings = { height: 200, animate: true };
        this._open = false;
        this._modelValue = "";
        this._value = "";
        this._previousValue = NO_VALUE;
        this._state = InternalState.SetInitial;
        this._filtering = false;
        this.valueChangeSubject = new __WEBPACK_IMPORTED_MODULE_9_rxjs_Subject__["Subject"]();
        this._isFocused = false;
        this.direction = rtl ? 'rtl' : 'ltr';
        this.wrapper = wrapper.nativeElement;
        this.data = [];
        this.subscribeEvents();
        this.selectionService.resetSelection([-1]);
    }
    Object.defineProperty(AutoCompleteComponent.prototype, "width", {
        get: function () {
            var wrapperOffsetWidth = 0;
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["d" /* isDocumentAvailable */])()) {
                wrapperOffsetWidth = this.wrapper.offsetWidth;
            }
            var width = this.popupSettings.width || wrapperOffsetWidth;
            var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px";
            var maxWidth = isNaN(width) ? width : width + "px";
            return { min: minWidth, max: maxWidth };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "height", {
        get: function () {
            return this.popupSettings.height;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "listContainerClasses", {
        get: function () {
            var containerClasses = ['k-list-container', 'k-reset'];
            if (this.popupSettings.popupClass) {
                containerClasses.push(this.popupSettings.popupClass);
            }
            return containerClasses;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "suggestion", {
        get: function () {
            if (!this.value || !this.suggestedText) {
                this.suggestedText = undefined;
                return;
            }
            var hasMatch = this.suggestedText.toLowerCase().startsWith(this.value.toLowerCase());
            var shouldSuggest = this.suggest && !this.backspacePressed;
            if (shouldSuggest && hasMatch) {
                return this.suggestedText;
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "appendTo", {
        get: function () {
            var appendTo = this.popupSettings.appendTo;
            if (!appendTo || appendTo === 'root') {
                return undefined;
            }
            return appendTo === 'component' ? this.container : appendTo;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "popupOpen", {
        get: function () {
            return this._open;
        },
        set: function (open) {
            if (this.disabled || this.readonly || this.popupOpen === open) {
                return;
            }
            var eventArgs = new __WEBPACK_IMPORTED_MODULE_14__common_preventable_event__["a" /* PreventableEvent */]();
            if (open && !this.popupOpen) {
                this.open.emit(eventArgs);
            }
            if (!open && this.popupOpen) {
                this.close.emit(eventArgs);
            }
            if (eventArgs.isDefaultPrevented()) {
                return;
            }
            this._toggle(open);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "activeDescendant", {
        get: function () {
            return this.optionPrefix + "-" + this.value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "data", {
        get: function () {
            return this._data;
        },
        /**
         * Sets the data of the AutoComplete.
         *
         * > The data has to be provided in an array-like list.
         */
        set: function (data) {
            this._data = data || [];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "value", {
        get: function () {
            return this._value || NO_VALUE;
        },
        /**
         * Sets the value of the AutoComplete.
         *
         */
        set: function (newValue) {
            this.verifySettings(newValue);
            this._value = newValue || NO_VALUE;
            this.cdr.markForCheck();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "popupSettings", {
        get: function () {
            return this._popupSettings;
        },
        /**
         * Configures the popup of the AutoComplete.
         *
         * The available options are:
         * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
         * - `width: Number | String`&mdash;Sets the width of the popup container. By default, the width of the host element is used  If set to `auto`, the component automatically adjusts the width of the popup, so no item labels are wrapped.
         * - `height: Number`&mdash;Sets the height of the popup container. By default, the height is 200px.
         * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
         */
        set: function (settings) {
            this._popupSettings = Object.assign({ height: 200, animate: true }, settings);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "widgetClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "isFocused", {
        get: function () {
            return this._isFocused;
        },
        set: function (isFocused) {
            this._isFocused = isFocused;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "isDisabled", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "widgetHeight", {
        get: function () {
            return this.popupSettings.height + "px";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteComponent.prototype, "dir", {
        get: function () {
            return this.direction;
        },
        enumerable: true,
        configurable: true
    });
    AutoCompleteComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.wrapper, "tabindex");
    };
    AutoCompleteComponent.prototype.ngOnDestroy = function () {
        this._toggle(false);
        this.unsubscribeEvents();
    };
    AutoCompleteComponent.prototype.ngOnChanges = function (changes) {
        var isInitial = Boolean(changes.value && changes.value.firstChange || (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["j" /* isChanged */])("value", changes) && (this._state & InternalState.SetInitial)));
        if (isInitial) {
            this._state |= InternalState.UseInitial;
        }
        if (changes.hasOwnProperty("value")) {
            this._modelValue = changes.value.currentValue;
        }
        var STATE_PROPS = /(data|value|textField|valueField|valuePrimitive)/g;
        if (STATE_PROPS.test(Object.keys(changes).join())) {
            this.setState();
        }
        var shouldSuggest = this.suggest && this.data && this.data.length && this.value;
        if (shouldSuggest) {
            this.suggestedText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(this.data[0], this.valueField);
        }
    };
    /**
     * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup, the `open` and `close` events will not be fired.
     *
     * @param open - The state of the popup.
     */
    AutoCompleteComponent.prototype.toggle = function (open) {
        var _this = this;
        Promise.resolve(null).then(function () {
            _this._toggle((open === undefined) ? !_this._open : open);
            _this.cdr.markForCheck();
        });
    };
    Object.defineProperty(AutoCompleteComponent.prototype, "isOpen", {
        /**
         * Returns the current open state of the popup.
         */
        get: function () {
            return this.popupOpen;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Resets the value of the AutoComplete.
     * If you use the `reset` method to clear components value, the model will not update automatically and the `selectionChange` and `valueChange` events will not be fired.
     */
    AutoCompleteComponent.prototype.reset = function () {
        this._modelValue = NO_VALUE;
        this.setState();
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.clearValue = function (event) {
        event.stopImmediatePropagation();
        this._filtering = true;
        this.change(NO_VALUE);
        this._filtering = false;
        this.selectionService.resetSelection([]);
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.writeValue = function (value) {
        var isInitial = Boolean(value !== null && this._state & InternalState.SetInitial);
        if (value === null && this._state & InternalState.SetInitial) {
            return;
        }
        if (isInitial) {
            this._state |= InternalState.UseInitial;
        }
        this._modelValue = value;
        this.setState();
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.registerOnChange = function (fn) {
        this.onChangeCallback = fn;
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.registerOnTouched = function (fn) {
        this.onTouchedCallback = fn;
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.popupOpened = function () {
        this.popupWidth = this.width.max;
        this.popupMinWidth = this.width.min;
    };
    /**
     * Focuses the AutoComplete.
     */
    AutoCompleteComponent.prototype.focus = function () {
        if (!this.disabled) {
            this.searchbar.focus();
        }
    };
    /**
     * Blurs the AutoComplete.
     */
    AutoCompleteComponent.prototype.blur = function () {
        if (!this.disabled) {
            this.searchbar.blur();
        }
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.onResize = function () {
        if (this._open) {
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
        }
    };
    AutoCompleteComponent.prototype.emitChange = function () {
        if (this.value === this._previousValue) {
            return;
        }
        this._modelValue = this.value;
        this._previousValue = this.value;
        this.onChangeCallback(this.value);
        this.valueChange.emit(this.value);
    };
    AutoCompleteComponent.prototype.verifySettings = function (newValue) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["b" /* isPresent */])(newValue) && typeof newValue !== "string") {
            throw new Error("Expected value of type string. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/autocomplete/#toc-value");
        }
    };
    AutoCompleteComponent.prototype.search = function (text) {
        var index = text.length ? this.data.findIndex(this.findIndexPredicate(text)) : -1;
        this.selectionService.focus(index);
        if (this.suggest) {
            this.suggestedText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(this.data[index], this.valueField);
        }
    };
    AutoCompleteComponent.prototype.navigate = function (index) {
        if (!this.popupOpen) {
            return;
        }
        if (index < 0 || index > this.data.length) {
            index = 0;
        }
        this.selectionService.focus(index);
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.handleNavigate = function (event) {
        var focused = isNaN(this.selectionService.focused) ? 0 : this.selectionService.focused;
        var hasFocused = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["b" /* isPresent */])(focused);
        var offset = 0;
        if (this.disabled || this.readonly) {
            return;
        }
        if (!hasFocused) {
            if (event.keyCode === __WEBPACK_IMPORTED_MODULE_13__common_keys__["a" /* Keys */].down) {
                offset = -1;
            }
            else if (event.keyCode === __WEBPACK_IMPORTED_MODULE_13__common_keys__["a" /* Keys */].up) {
                offset = 1;
            }
        }
        var action = this.navigationService.process({
            current: focused + offset,
            max: this.data.length - 1,
            min: 0,
            originalEvent: event
        });
        if (action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Undefined &&
            action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Backspace &&
            action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Delete &&
            action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Home &&
            action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].End &&
            action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Left &&
            action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Right &&
            ((action === __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Enter && this.popupOpen) || action !== __WEBPACK_IMPORTED_MODULE_11__navigation_action__["a" /* NavigationAction */].Enter)) {
            event.preventDefault();
        }
    };
    AutoCompleteComponent.prototype.handleEnter = function (event) {
        var focused = this.selectionService.focused;
        var value;
        this._filtering = false;
        if (this.popupOpen) {
            event.originalEvent.preventDefault();
        }
        if (focused >= 0) {
            value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(this.data[focused], this.valueField);
        }
        else {
            var match = this.suggest && this.suggestedText && this.data.length &&
                __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(this.data[0], this.valueField, true).toLowerCase() === this.searchbar.value.toLowerCase();
            if (this.popupOpen && match) {
                value = this.suggestedText;
            }
            else {
                value = this.searchbar.value;
            }
        }
        this.change(value);
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.searchBarChange = function (text) {
        var currentTextLength = this.text.length;
        this.backspacePressed = (text.length < currentTextLength) ? true : false;
        this.text = text;
        this.popupOpen = text.length > 0;
        this._filtering = true;
        if (this.filterable) {
            this.selectionService.focused = -1;
            this.filterChange.emit(text);
        }
        else {
            this.search(text);
        }
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.handleFocus = function () {
        this.isFocused = true;
        this.onFocus.emit();
    };
    /**
     * @hidden
     */
    AutoCompleteComponent.prototype.handleBlur = function () {
        this._filtering = false;
        var focused = this.filterable ? this.selectionService.focused : -1;
        var dataItem;
        var text;
        var value = this.value;
        if (focused !== -1) {
            dataItem = this.data[focused];
            text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(dataItem, this.valueField, true) || "";
        }
        else {
            text = this.searchbar.value;
        }
        if (text === this.searchbar.value) {
            value = text;
        }
        else if (text && text.toLowerCase() === this.searchbar.value.toLowerCase()) {
            this.selectionService.resetSelection([]);
            value = this.searchbar.value;
        }
        this.change(value);
        this.popupOpen = false;
        this.isFocused = false;
        this.onBlur.emit();
        this.onTouchedCallback();
    };
    AutoCompleteComponent.prototype.setState = function () {
        if (this._filtering) {
            return;
        }
        if (this._state & InternalState.UseInitial) {
            this._state &= ~InternalState.UseInitial;
            this._state &= ~InternalState.SetInitial;
            this._previousValue = this._modelValue;
        }
        else {
            this._previousValue = this.value;
        }
        this.value = this._modelValue;
        this.text = this.value;
    };
    AutoCompleteComponent.prototype.change = function (value) {
        this.popupOpen = false;
        this.valueChangeSubject.next(value);
    };
    AutoCompleteComponent.prototype.subscribeEvents = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.valueChangeSubscribtion = this.valueChangeSubject
            .filter(function (candidate) {
            return !(_this.value === candidate && _this.text === candidate);
        })
            .subscribe(function (value) {
            _this.value = value;
            _this.text = value;
            if (_this.filterable && !_this.value && !_this.text) {
                _this.filterChange.emit("");
            }
            _this.emitChange();
        });
        this.changeSubscribtion = this.selectionService.onChange.subscribe(this.handleItemChange.bind(this));
        this.focusSubscribtion = this.selectionService.onFocus.subscribe(this.handleItemFocus.bind(this));
        this.navigationSubscribtion = __WEBPACK_IMPORTED_MODULE_8_rxjs_Observable__["Observable"].merge(this.navigationService.up, this.navigationService.down).subscribe(function (event) { return _this.navigate(event.index); });
        this.closeSubscription = this.navigationService.close.subscribe(function () { return _this.popupOpen = false; });
        this.enterSubscription = this.navigationService.enter.subscribe(this.handleEnter.bind(this));
        this.escSubscription = this.navigationService.esc.subscribe(this.handleBlur.bind(this));
    };
    AutoCompleteComponent.prototype.unsubscribeEvents = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.changeSubscribtion.unsubscribe();
        this.navigationSubscribtion.unsubscribe();
        this.closeSubscription.unsubscribe();
        this.enterSubscription.unsubscribe();
        this.escSubscription.unsubscribe();
    };
    AutoCompleteComponent.prototype.handleItemChange = function (event) {
        var index = event.indices.length ? event.indices[0] : undefined;
        this._filtering = false;
        this.selectionService.resetSelection([-1]);
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["b" /* isPresent */])(index)) {
            return;
        }
        var text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(this.data[index], this.valueField);
        this.change(text);
    };
    AutoCompleteComponent.prototype.handleItemFocus = function (_event) {
        var focused = this.selectionService.focused;
        var shouldSuggest = Boolean(this.suggest && this.data && this.data.length && focused >= 0);
        if (shouldSuggest) {
            this.suggestedText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(this.data[focused], this.valueField);
        }
    };
    AutoCompleteComponent.prototype._toggle = function (open) {
        var _this = this;
        this._open = open;
        if (this.popupRef) {
            this.popupRef.popupElement
                .removeEventListener('mousedown', this.popupMouseDownHandler);
            this.popupRef.close();
            this.popupRef = null;
        }
        if (this._open) {
            this.popupRef = this.popupService.open({
                anchor: this.wrapper,
                animate: this.popupSettings.animate,
                appendTo: this.appendTo,
                content: this.popupTemplate,
                popupClass: this.listContainerClasses,
                positionMode: 'absolute'
            });
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler);
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
            popupWrapper.setAttribute("dir", this.direction);
            this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; });
        }
    };
    AutoCompleteComponent.prototype.findIndexPredicate = function (text) {
        var _this = this;
        return function (item) {
            var itemText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__util__["a" /* getter */])(item, _this.valueField);
            itemText = itemText === undefined ? "" : itemText.toString().toLowerCase();
            return itemText.startsWith(text.toLowerCase());
        };
    };
    return AutoCompleteComponent;
}());

AutoCompleteComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoAutoComplete',
                providers: [AUTOCOMPLETE_VALUE_ACCESSOR, __WEBPACK_IMPORTED_MODULE_6__selection_service__["a" /* SelectionService */], __WEBPACK_IMPORTED_MODULE_7__navigation_service__["a" /* NavigationService */]],
                selector: 'kendo-autocomplete',
                template: "\n        <kendo-searchbar #searchbar\n            [role]=\"'textbox'\"\n            [id]=\"id\"\n            [listId]=\"listBoxId\"\n            [activeDescendant]=\"activeDescendant\"\n            [userInput]=\"text\"\n            [suggestedText]=\"suggestion\"\n            [disabled]=\"disabled\"\n            [readonly]=\"readonly\"\n            [tabIndex]=\"tabIndex\"\n            [popupOpen]=\"popupOpen\"\n            [placeholder]=\"placeholder\"\n            (onNavigate)=\"handleNavigate($event)\"\n            (valueChange)=\"searchBarChange($event)\"\n            (onBlur)=\"handleBlur()\"\n            (onFocus)=\"handleFocus()\"\n        ></kendo-searchbar>\n        <span *ngIf=\"!loading && !readonly && (clearButton && text?.length)\" class=\"k-icon k-clear-value k-i-close\" title=\"clear\" role=\"button\" tabindex=\"-1\" (click)=\"clearValue($event)\" (mousedown)=\"$event.preventDefault()\">\n</span>\n        <span *ngIf=\"loading\" class=\"k-icon k-i-loading\"></span>\n        <ng-template #popupTemplate>\n            <!--header template-->\n            <ng-template *ngIf=\"headerTemplate\"\n                [templateContext]=\"{\n                    templateRef: headerTemplate.templateRef\n                }\">\n            </ng-template>\n            <!--list-->\n            <kendo-list\n                [id]=\"listBoxId\"\n                [optionPrefix]=\"optionPrefix\"\n                [data]=\"data\"\n                [textField]=\"valueField\"\n                [valueField]=\"valueField\"\n                [template]=\"template\"\n                [height]=\"height\"\n                [show]=\"popupOpen\"\n            >\n            </kendo-list>\n            <!--no-data template-->\n            <div class=\"k-nodata\" *ngIf=\"data.length === 0\">\n                <ng-template [ngIf]=\"noDataTemplate\"\n                    [templateContext]=\"{\n                        templateRef: noDataTemplate?.templateRef\n                    }\">\n                </ng-template>\n                <ng-template [ngIf]=\"!noDataTemplate\">\n                    <div>NO DATA FOUND.</div>\n                </ng-template>\n            </div>\n            <!--footer template-->\n            <ng-template *ngIf=\"footerTemplate\"\n                [templateContext]=\"{\n                    templateRef: footerTemplate.templateRef\n                }\">\n            </ng-template>\n        </ng-template>\n        <ng-template [ngIf]=\"popupOpen\">\n            <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n        </ng-template>\n        <ng-container #container></ng-container>\n  "
            },] },
];
/** @nocollapse */
AutoCompleteComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_15__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_16__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: __WEBPACK_IMPORTED_MODULE_6__selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_7__navigation_service__["a" /* NavigationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
]; };
AutoCompleteComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupSettings': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'loading': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'clearButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'suggest': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'readonly': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["tabIndex",] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'filterChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__templates_item_template_directive__["a" /* ItemTemplateDirective */],] },],
    'headerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_4__templates_header_template_directive__["a" /* HeaderTemplateDirective */],] },],
    'footerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_5__templates_footer_template_directive__["a" /* FooterTemplateDirective */],] },],
    'noDataTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_12__templates_no_data_template_directive__["a" /* NoDataTemplateDirective */],] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['container', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"] },] },],
    'popupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['popupTemplate',] },],
    'searchbar': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_2__searchbar_component__["a" /* SearchBarComponent */],] },],
    'widgetClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-autocomplete',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-header',] },],
    'isFocused': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'isDisabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'widgetHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.max-height',] },],
    'dir': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
};


/***/ }),
/* 280 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AutoCompleteModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autocomplete_component__ = __webpack_require__(279);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shared_module__ = __webpack_require__(88);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__shared_directives_module__ = __webpack_require__(62);




var AUTOCOMPLETE_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__autocomplete_component__["a" /* AutoCompleteComponent */]
];
/**
 * @hidden
 *
 * The exported package module.
 *
 * The package exports:
 * - `AutoCompleteComponent`&mdash;The AutoComplete component class.
 * - `ItemTemplateDirective`&mdash;The item template directive.
 * - `HeaderTemplateDirective`&mdash;The header template directive.
 * - `FooterTemplateDirective`&mdash;The footer template directive.
 */
var AutoCompleteModule = (function () {
    function AutoCompleteModule() {
    }
    return AutoCompleteModule;
}());

AutoCompleteModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [AUTOCOMPLETE_DIRECTIVES],
                exports: [AUTOCOMPLETE_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_3__shared_directives_module__["a" /* SharedDirectivesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_2__shared_module__["a" /* SharedModule */]]
            },] },
];
/** @nocollapse */
AutoCompleteModule.ctorParameters = function () { return []; };


/***/ }),
/* 281 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export COMBOBOX_VALUE_ACCESSOR */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComboBoxComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__searchbar_component__ = __webpack_require__(117);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templates_item_template_directive__ = __webpack_require__(65);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__templates_header_template_directive__ = __webpack_require__(64);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__templates_footer_template_directive__ = __webpack_require__(63);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__templates_no_data_template_directive__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__selection_service__ = __webpack_require__(61);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__navigation_service__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_add_operator_catch__ = __webpack_require__(492);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_add_operator_catch___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_rxjs_add_operator_catch__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_add_operator_do__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_add_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_rxjs_add_operator_do__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_merge__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_let__ = __webpack_require__(495);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_let___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_let__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_add_operator_partition__ = __webpack_require__(496);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_add_operator_partition___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_rxjs_add_operator_partition__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_throttleTime__ = __webpack_require__(245);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_throttleTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_throttleTime__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_rxjs_add_operator_distinctUntilChanged__ = __webpack_require__(147);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_rxjs_add_operator_distinctUntilChanged___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18_rxjs_add_operator_distinctUntilChanged__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_19_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_rxjs_Subscription__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_20_rxjs_Subscription__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__navigation_action__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__common_keys__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__common_preventable_event__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__progress_kendo_angular_popup__ = __webpack_require__(28);
/* tslint:disable:no-null-keyword */
/* tslint:disable:max-line-length */
/* tslint:disable:no-bitwise */



























var InternalState;
(function (InternalState) {
    InternalState[InternalState["None"] = 0] = "None";
    InternalState[InternalState["SetInitial"] = 1] = "SetInitial";
    InternalState[InternalState["UseInitial"] = 2] = "UseInitial";
    InternalState[InternalState["UseExisting"] = 4] = "UseExisting";
    InternalState[InternalState["UseCustom"] = 8] = "UseCustom";
    InternalState[InternalState["UseFilter"] = 16] = "UseFilter";
    InternalState[InternalState["UseEmpty"] = 32] = "UseEmpty";
})(InternalState || (InternalState = {}));
/**
 * @hidden
 */
var COMBOBOX_VALUE_ACCESSOR = {
    multi: true,
    provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],
    // tslint:disable-next-line:no-use-before-declare
    useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return ComboBoxComponent; })
};
/**
 * Represents the Kendo UI ComboBox component for Angular.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-combobox [data]="listItems">
 *  </kendo-combobox>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 */
var ComboBoxComponent = (function () {
    function ComboBoxComponent(rtl, popupService, selectionService, navigationService, cdr, renderer, wrapper) {
        this.popupService = popupService;
        this.selectionService = selectionService;
        this.navigationService = navigationService;
        this.cdr = cdr;
        this.renderer = renderer;
        this.selected = [];
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["e" /* guid */])();
        /**
         * Specifies whether the ComboBox allows user-defined values that are not present in the dataset.
         * The default value is `false`.
         *
         * For more information, refer to the article on [custom values]({% slug custom_values_combobox %}).
         */
        this.allowCustom = false;
        /**
         * A user-defined callback which returns normalized custom values. Typically used when the data items are different from type `string`.
         * @param { Any } value - The custom value defined by the user.
         * @returns { Any }
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *   <kendo-combobox
         *       [allowCustom]="true"
         *       [data]="listItems"
         *       [textField]="'text'"
         *       [valueField]="'value'"
         *       [valueNormalizer]="valueNormalizer"
         *       (valueChange)="onValueChange($event)"
         *   >
         *   </kendo-combobox>
         * `
         * })
         *
         * class AppComponent {
         *   public listItems: Array<{ text: string, value: number }> = [
         *       { text: "Small", value: 1 },
         *       { text: "Medium", value: 2 },
         *       { text: "Large", value: 3 }
         *   ];
         *
         *   public onValueChange(value) {
         *       console.log("valueChange : ", value);
         *   }
         *
         *   public valueNormalizer = (text: Observable<string>) => text.map((text: string) => {
         *      return { ProductID: null, ProductName: text };
         *   });
         *
         * }
         * ```
         */
        this.valueNormalizer = function (text) { return text.map(function (userInput) { return userInput; }); };
        /**
         * The hint displayed when the component is empty.
         *
         */
        this.placeholder = "";
        /**
         * @hidden
         *
         * Enables the auto-completion of the text based on the first data item.
         */
        this.suggest = false;
        /**
         * If set to `true`, renders a button on hovering over the component. Clicking this button resets the value of the component to `undefined` and triggers the `change` event.
         */
        this.clearButton = true;
        /**
         * Sets the disabled state of the component.
         */
        this.disabled = false;
        /**
         * Sets the readonly state of the component.
         */
        this.readonly = false;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Enables the filtering functionality. If set to `true`, the component emits the `filterChange` event.
         */
        this.filterable = false;
        /**
         * Fires each time the value is changed.
         *
         * For more details, refer to the example on [events]({% slug overview_combobox %}#toc-events).
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time an item selection is changed.
         *
         * For more details, refer to the example on [events]({% slug overview_combobox %}#toc-events).
         */
        this.selectionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user types in the input.
         * You can filter the source based on the passed filtration value.
         *
         * For more details, refer to the example on [events]({% slug overview_combobox %}#toc-events).
         */
        this.filterChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to open.
         * This event is preventable. If you cancel it, the popup will remain closed.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to close.
         * This event is preventable. If you cancel it, the popup will remain open.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the ComboBox.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the ComboBox gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        this.isFocused = false;
        this.listBoxId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["e" /* guid */])();
        this.optionPrefix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["e" /* guid */])();
        this.onChangeCallback = function (_) { };
        this.onTouchedCallback = function (_) { };
        this.observableSubscriptions = new __WEBPACK_IMPORTED_MODULE_20_rxjs_Subscription__["Subscription"]();
        this._state = InternalState.SetInitial;
        this._filtering = false;
        this._text = "";
        this._open = false;
        this._popupSettings = { height: 200, animate: true };
        this.popupMouseDownHandler = function (event) { return event.preventDefault(); };
        this.customValueSubject = new __WEBPACK_IMPORTED_MODULE_19_rxjs_Subject__["Subject"]();
        this.valueSubject = new __WEBPACK_IMPORTED_MODULE_19_rxjs_Subject__["Subject"]();
        this.selectionSubject = new __WEBPACK_IMPORTED_MODULE_19_rxjs_Subject__["Subject"]();
        this.direction = rtl ? 'rtl' : 'ltr';
        this.wrapper = wrapper.nativeElement;
        this.data = [];
        this.subscribeEvents();
    }
    Object.defineProperty(ComboBoxComponent.prototype, "width", {
        get: function () {
            var wrapperOffsetWidth = 0;
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["d" /* isDocumentAvailable */])()) {
                wrapperOffsetWidth = this.wrapper.offsetWidth;
            }
            var width = this.popupSettings.width || wrapperOffsetWidth;
            var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px";
            var maxWidth = isNaN(width) ? width : width + "px";
            return { min: minWidth, max: maxWidth };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "height", {
        get: function () {
            return this.popupSettings.height;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "text", {
        get: function () {
            return this._text;
        },
        set: function (text) {
            var textCandidate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(text, this.textField, true);
            this._text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(textCandidate) ? textCandidate.toString() : "";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "popupOpen", {
        get: function () {
            return this._open;
        },
        set: function (open) {
            if (this.disabled || this.readonly || this.popupOpen === open) {
                return;
            }
            var eventArgs = new __WEBPACK_IMPORTED_MODULE_24__common_preventable_event__["a" /* PreventableEvent */]();
            if (open) {
                this.open.emit(eventArgs);
            }
            else {
                this.close.emit(eventArgs);
            }
            if (eventArgs.isDefaultPrevented()) {
                return;
            }
            this._toggle(open);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "activeDescendant", {
        get: function () {
            return this.optionPrefix + "-" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this.value, this.valueField);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "appendTo", {
        get: function () {
            var appendTo = this.popupSettings.appendTo;
            if (!appendTo || appendTo === 'root') {
                return undefined;
            }
            return appendTo === 'component' ? this.container : appendTo;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "data", {
        get: function () {
            return this._data;
        },
        /**
         * Sets the data of the ComboBox.
         *
         * > The data has to be provided in an array-like list.
         */
        set: function (data) {
            this._data = data || [];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "value", {
        get: function () {
            return this._value;
        },
        /**
         * Sets the value of the ComboBox. It can either be of the primitive (string, numbers) or of the complex (objects) type. To define the type, use the `valuePrimitive` option.
         *
         * > All selected values which are not present in the dataset are considered custom values. When the `Enter` key is pressed or the component loses focus, custom values get dismissed unless `allowCustom` is set to `true`.
         */
        set: function (newValue) {
            this.verifySettings(newValue);
            this._value = newValue;
            this.cdr.markForCheck();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "popupSettings", {
        get: function () {
            return this._popupSettings;
        },
        /**
         * Configures the popup of the ComboBox.
         *
         * The available options are:
         * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
         * - `width: Number | String`&mdash;Sets the width of the popup container. By default, the width of the host element is used  If set to `auto`, the component automatically adjusts the width of the popup, so no item labels are wrapped.
         * - `height: Number`&mdash;Sets the height of the popup container. By default, the height is 200px.
         * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
         */
        set: function (settings) {
            this._popupSettings = Object.assign({ height: 200, animate: true }, settings);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "widgetClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.wrapperClasses = function () {
        return {
            'k-dropdown-wrap': true,
            'k-state-default': !this.disabled,
            'k-state-disabled': this.disabled,
            'k-state-focused': this.isFocused
        };
    };
    Object.defineProperty(ComboBoxComponent.prototype, "clearable", {
        get: function () {
            return this.clearButton;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "widgetHeight", {
        get: function () {
            return this.popupSettings.height + "px";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ComboBoxComponent.prototype, "dir", {
        get: function () {
            return this.direction;
        },
        enumerable: true,
        configurable: true
    });
    ComboBoxComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.wrapper, "tabindex");
        this.createSelectionStream();
        this.createValueStream();
    };
    ComboBoxComponent.prototype.createSelectionStream = function () {
        var _this = this;
        if (this.selectionSubscription) {
            this.selectionSubscription.unsubscribe();
        }
        this.selectionSubscription = this.selectionSubject
            .map(function (index) {
            return {
                dataItem: _this.data[index],
                value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(_this.data[index], _this.valueField)
            };
        })
            .distinctUntilChanged(function (prev, next) {
            return prev.value === next.value;
        })
            .subscribe(function (args) {
            _this.selectionChange.emit(args.dataItem);
        });
    };
    ComboBoxComponent.prototype.createValueStream = function () {
        var _this = this;
        var valueStream = this.valueSubject
            .filter(function (candidate) {
            var current = _this.valuePrimitive ? _this.value : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(_this.value, _this.valueField);
            var newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(candidate, _this.valueField);
            var newText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(candidate, _this.textField);
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(newText)) {
                newText = newText.toString();
            }
            if (current === newValue && _this.text === newText) {
                return false;
            }
            else {
                return true;
            }
        })
            .map(function (candidate) {
            var newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(candidate, _this.valueField);
            var newText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(candidate, _this.textField);
            return {
                dataItem: candidate,
                text: newText,
                value: _this.valuePrimitive ? newValue : candidate
            };
        });
        var customValueStreams = this.customValueSubject.throttleTime(300).partition(function () { return _this.allowCustom; });
        var allowCustomValueStream = customValueStreams[0]
            .do(function () {
            _this.loading = true;
            _this.disabled = true;
        })
            .filter(function () {
            var hasChange = _this.text !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(_this.value, _this.textField);
            _this.loading = hasChange;
            _this.disabled = hasChange;
            return hasChange;
        })
            .let(this.valueNormalizer)
            .map(function (normalizedValue) {
            return {
                dataItem: normalizedValue,
                text: _this.text,
                value: normalizedValue
            };
        });
        var disableCustomValueStream = customValueStreams[1]
            .map(function () {
            return {
                dataItem: undefined,
                text: undefined,
                value: undefined
            };
        });
        if (this.valueSubscription) {
            this.valueSubscription.unsubscribe();
        }
        var merged = valueStream.merge(allowCustomValueStream, disableCustomValueStream);
        this.valueSubscription = merged
            .catch(function () {
            _this.dataItem = undefined;
            _this.value = undefined;
            _this.text = undefined;
            _this.loading = false;
            _this.disabled = false;
            _this.emitChange();
            return merged;
        })
            .subscribe(function (state) {
            _this.dataItem = state.dataItem;
            _this.value = state.value;
            _this.text = state.text;
            _this.loading = false;
            _this.disabled = false;
            if (_this.filterable && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(state.value) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(state.text) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(_this._previousValue)) {
                _this.filterChange.emit("");
            }
            _this.emitChange();
        });
    };
    ComboBoxComponent.prototype.subscribeEvents = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        [
            this.selectionService.onChange
                .filter(function (event) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(event.indices[0]); })
                .map(function (event) { return event.indices[0]; })
                .subscribe(this.handleItemChange.bind(this)),
            this.selectionService.onSelect
                .filter(function (event) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(event.indices[0]); })
                .map(function (event) { return event.indices[0]; })
                .subscribe(this.handleItemSelect.bind(this)),
            __WEBPACK_IMPORTED_MODULE_9_rxjs_Observable__["Observable"].merge(this.navigationService.up, this.navigationService.down, this.navigationService.home, this.navigationService.end).subscribe(function (event) { return _this.navigate(event.index); }),
            this.navigationService.open.subscribe(function () { return _this.popupOpen = true; }),
            this.navigationService.close.subscribe(function () { return _this.popupOpen = false; }),
            this.navigationService.enter.subscribe(function (event) {
                if (_this.popupOpen) {
                    event.originalEvent.preventDefault();
                }
                _this.confirmSelection();
            }),
            this.navigationService.esc.subscribe(this.handleBlur.bind(this))
        ].forEach(function (s) { return _this.observableSubscriptions.add(s); });
    };
    ComboBoxComponent.prototype.unsubscribeEvents = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.observableSubscriptions.unsubscribe();
        if (this.valueSubscription) {
            this.valueSubscription.unsubscribe();
        }
        if (this.selectionSubscription) {
            this.selectionSubscription.unsubscribe();
        }
    };
    ComboBoxComponent.prototype.handleItemChange = function (index) {
        this._filtering = false;
        this.change(this.data[index]);
    };
    ComboBoxComponent.prototype.handleItemSelect = function (index) {
        this._filtering = false;
        if (!this.popupOpen) {
            this.change(this.data[index]);
        }
        else {
            this.selectionSubject.next(index);
        }
    };
    ComboBoxComponent.prototype.ngOnDestroy = function () {
        this._toggle(false);
        this.unsubscribeEvents();
    };
    ComboBoxComponent.prototype.ngOnChanges = function (changes) {
        var isInitial = Boolean(changes.value && changes.value.firstChange || (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["j" /* isChanged */])("value", changes) && (this._state & InternalState.SetInitial)));
        if (isInitial) {
            this._state |= InternalState.UseInitial;
        }
        if (changes.hasOwnProperty("value")) {
            this._modelValue = changes.value.currentValue;
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["j" /* isChanged */])("valueNormalizer", changes)) {
            this.createSelectionStream();
            this.createValueStream();
        }
        if (this.valuePrimitive === undefined) {
            this.valuePrimitive = this.valueField ? false : true;
        }
        var STATE_PROPS = /(data|value|textField|valueField|valuePrimitive)/g;
        if (STATE_PROPS.test(Object.keys(changes).join())) {
            this.setState();
        }
        var wasFiltered = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["j" /* isChanged */])("data", changes) && this._filtering;
        if (wasFiltered) {
            if (this.text.length > 0) {
                this.search(this.text);
                if (this.selectionService.focused === -1) {
                    this.selectionService.focused = 0;
                }
            }
            else {
                this.selectionService.focused = -1;
            }
        }
        if (this.suggest && this.data && this.data.length && this.text) {
            this.suggestedText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this.data[0], this.textField);
        }
    };
    /**
     * Focuses the ComboBox.
     */
    ComboBoxComponent.prototype.focus = function () {
        if (!this.disabled) {
            this.searchbar.focus();
        }
    };
    /**
     * Blurs the ComboBox.
     */
    ComboBoxComponent.prototype.blur = function () {
        if (!this.disabled) {
            this.searchbar.blur();
        }
    };
    /**
     * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup,
     * the `open` and `close` events will not be fired.
     *
     * @param open - The state of the popup.
     */
    ComboBoxComponent.prototype.toggle = function (open) {
        var _this = this;
        Promise.resolve(null).then(function () {
            _this._toggle((open === undefined) ? !_this._open : open);
            _this.cdr.markForCheck();
        });
    };
    Object.defineProperty(ComboBoxComponent.prototype, "isOpen", {
        /**
         * Returns the current open state of the popup.
         */
        get: function () {
            return this.popupOpen;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Resets the value of the ComboBox.
     * If you use the `reset` method to clear components value, the model will not update automatically and the `selectionChange` and `valueChange` events will not be fired.
     */
    ComboBoxComponent.prototype.reset = function () {
        this._modelValue = undefined;
        this.setState();
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.clearValue = function (event) {
        event.stopImmediatePropagation();
        this._filtering = true;
        this._previousValue = undefined;
        this.change(undefined);
        this._filtering = false;
        this.selectionService.resetSelection([]);
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.writeValue = function (value) {
        var isInitial = Boolean(value !== null && this._state & InternalState.SetInitial);
        if (value === null && this._state & InternalState.SetInitial) {
            return;
        }
        if (isInitial) {
            this._state |= InternalState.UseInitial;
        }
        this.text = "";
        this._modelValue = value;
        this.setState();
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.registerOnChange = function (fn) {
        this.onChangeCallback = fn;
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.registerOnTouched = function (fn) {
        this.onTouchedCallback = fn;
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.popupOpened = function () {
        this.popupWidth = this.width.max;
        this.popupMinWidth = this.width.min;
    };
    Object.defineProperty(ComboBoxComponent.prototype, "buttonClasses", {
        /**
         * @hidden
         */
        get: function () {
            return _a = {},
                _a[this.iconClass] = !this.loading && this.iconClass,
                _a['k-i-arrow-s'] = !this.loading && !this.iconClass,
                _a['k-i-loading'] = this.loading,
                _a['k-icon'] = true,
                _a;
            var _a;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.onResize = function () {
        if (this._open) {
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
        }
    };
    ComboBoxComponent.prototype.verifySettings = function (newValue) {
        var valueOrText = !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(this.valueField) !== !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(this.textField);
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (this.valuePrimitive === true && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(newValue) && typeof newValue === "object") {
            throw new Error("Expected initial value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection");
        }
        if (this.valuePrimitive === false && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(newValue) && typeof newValue !== "object") {
            throw new Error("Expected initial value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection");
        }
        if (valueOrText) {
            throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-bind-to-arrays-of-complex-data");
        }
    };
    ComboBoxComponent.prototype.resolveState = function () {
        var primitiveValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this._modelValue, this.valueField, true);
        var existing;
        var state;
        if (this._filtering) {
            state = InternalState.UseFilter;
        }
        else {
            state = this.data.length ? InternalState.UseExisting : (this.allowCustom ? InternalState.UseCustom : InternalState.UseEmpty);
        }
        if (state === InternalState.UseExisting) {
            existing = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["i" /* resolveValue */])({ data: this.data, value: primitiveValue, valueField: this.valueField });
            if (existing.dataItem !== undefined) {
                state = InternalState.UseExisting;
            }
            else {
                state = this.allowCustom ? InternalState.UseCustom : InternalState.UseEmpty;
            }
        }
        state |= this._state & InternalState.SetInitial | this._state & InternalState.UseInitial;
        this._state = state;
        return existing;
    };
    ComboBoxComponent.prototype.setState = function () {
        var resolved = this.resolveState();
        var newState = { value: undefined, text: undefined, dataItem: undefined, selected: [-1] };
        if (this._state & InternalState.UseFilter) {
            return;
        }
        else if (this._state & InternalState.UseEmpty) {
            newState.selected = undefined;
            newState.value = undefined;
            newState.text = undefined;
            newState.dataItem = undefined;
        }
        else if (this._state & InternalState.UseExisting) {
            newState.value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(this._modelValue) ? this._modelValue : resolved.dataItem;
            newState.text = resolved.dataItem;
            newState.dataItem = resolved.dataItem;
            newState.selected = resolved.selected;
        }
        else if (this._state & InternalState.UseCustom) {
            newState.value = this._modelValue;
            newState.text = this._modelValue;
            newState.dataItem = this._modelValue;
        }
        if (this._state & InternalState.UseInitial) {
            this._state &= ~InternalState.UseInitial;
            this._state &= ~InternalState.SetInitial;
            this._previousValue = newState.dataItem;
        }
        else {
            this._previousValue = this.dataItem;
        }
        this.text = newState.text;
        this.value = this.valuePrimitive ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(newState.value, this.valueField, true) : newState.value;
        this.dataItem = newState.dataItem;
        this.selectionService.resetSelection(newState.selected);
    };
    ComboBoxComponent.prototype.search = function (text) {
        var _this = this;
        var index = this.data.findIndex(function (item) {
            var itemText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(item, _this.textField);
            itemText = itemText === undefined ? "" : itemText.toString().toLowerCase();
            return itemText.startsWith(text.toLowerCase());
        });
        this.selectionService.focused = index;
        this.suggestedText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this.data[index], this.textField);
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.getSuggestion = function () {
        var hasSelected = !!this.selectionService.selected.length;
        var shouldSuggest = this.suggest && !this.backspacePressed && this.suggestedText && this.text;
        if (!hasSelected && shouldSuggest && this.suggestedText.toLowerCase().startsWith(this.text.toLowerCase())) {
            return this.suggestedText;
        }
        else {
            this.suggestedText = undefined;
        }
    };
    ComboBoxComponent.prototype.navigate = function (index) {
        if (this.data.length === 0) {
            return;
        }
        this.text = this.data[index];
        this.selectionService.select(index);
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.handleNavigate = function (event) {
        var hasSelected = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(this.selectionService.selected[0]);
        var focused = isNaN(this.selectionService.focused) ? 0 : this.selectionService.focused;
        var offset = 0;
        if (this.disabled || this.readonly) {
            return;
        }
        if (event.keyCode === __WEBPACK_IMPORTED_MODULE_23__common_keys__["a" /* Keys */].home || event.keyCode === __WEBPACK_IMPORTED_MODULE_23__common_keys__["a" /* Keys */].end) {
            return;
        }
        if (!hasSelected) {
            if (event.keyCode === __WEBPACK_IMPORTED_MODULE_23__common_keys__["a" /* Keys */].down) {
                offset = -1;
            }
            else if (event.keyCode === __WEBPACK_IMPORTED_MODULE_23__common_keys__["a" /* Keys */].up) {
                offset = 1;
            }
        }
        var current = offset + focused;
        if (current < -1) {
            current = -1;
        }
        var action = this.navigationService.process({
            current: current,
            max: this.data.length - 1,
            min: 0,
            originalEvent: event
        });
        if (action !== __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Undefined &&
            action !== __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Left &&
            action !== __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Right &&
            action !== __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Backspace &&
            action !== __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Delete &&
            ((action === __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Enter && this.popupOpen) || action !== __WEBPACK_IMPORTED_MODULE_22__navigation_action__["a" /* NavigationAction */].Enter)) {
            event.preventDefault();
        }
    };
    ComboBoxComponent.prototype.confirmSelection = function () {
        var focused = this.selectionService.focused;
        var previousText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this._previousValue, this.textField) || "";
        var hasChange = this.text !== previousText;
        var isCustom = false;
        this._filtering = false;
        if (this.allowCustom) {
            isCustom = this.text !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this.data[focused], this.textField);
        }
        else {
            isCustom = focused === -1 || focused === undefined;
        }
        if (!isCustom && this.popupOpen) {
            this.selectionService.select(focused);
            this.change(this.data[focused] || this.text, isCustom);
            return;
        }
        if (hasChange) {
            this.change(this.text, isCustom);
        }
        else {
            this.popupOpen = false;
        }
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.handleBlur = function () {
        this._filtering = false;
        var currentText = this.searchbar.value; // The value is updated, but the Angular `change` event is not emitted yet and `this.text` is not updated. Fails on suggested text.
        if (!currentText && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["b" /* isPresent */])(this._previousValue)) {
            this.popupOpen = false;
            this.isFocused = false;
            this.onBlur.emit();
            this.onTouchedCallback();
            return;
        }
        var focused = this.selectionService.focused;
        var itemText;
        if (focused !== -1 && focused !== undefined) {
            itemText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(this.data[focused], this.textField);
            itemText = itemText === undefined ? "" : itemText.toString().toLowerCase();
        }
        if (itemText === currentText.toLowerCase()) {
            this.selectionService.change(focused);
        }
        else {
            this.change(currentText, true);
        }
        this.popupOpen = false;
        this.isFocused = false;
        this.onBlur.emit();
        this.onTouchedCallback();
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.searchBarChange = function (text) {
        var currentTextLength = this.text ? this.text.length : 0;
        this.backspacePressed = (text.length < currentTextLength) ? true : false;
        this.text = text;
        // Reset the selection prior to filter. If a match is present, it will be resolved. If a match is not present, it is not needed.
        this.selectionService.resetSelection([]);
        this.popupOpen = true;
        this._filtering = true;
        if (this.filterable) {
            this.filterChange.emit(text);
        }
        else {
            this.search(text);
        }
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.handleFocus = function () {
        this.isFocused = true;
        this.onFocus.emit();
    };
    ComboBoxComponent.prototype.change = function (candidate, isCustom) {
        if (isCustom === void 0) { isCustom = false; }
        this.popupOpen = false;
        if (isCustom) {
            this.customValueSubject.next(candidate);
        }
        else {
            this.valueSubject.next(candidate);
        }
    };
    ComboBoxComponent.prototype.emitChange = function () {
        var _this = this;
        this._modelValue = this.value;
        this._previousValue = this._state & InternalState.UseCustom ? this.value : this.dataItem;
        this.selectionSubject.next(this.data.findIndex(function (element) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(element, _this.valueField) === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_21__util__["a" /* getter */])(_this.value, _this.valueField, _this.valuePrimitive);
        }));
        this.onChangeCallback(this.value);
        this.valueChange.emit(this.value);
    };
    /**
     * @hidden
     */
    ComboBoxComponent.prototype.togglePopup = function () {
        this.searchbar.focus();
        if (this.popupOpen) {
            this.confirmSelection();
            this.popupOpen = false;
        }
        else {
            this.popupOpen = true;
        }
    };
    Object.defineProperty(ComboBoxComponent.prototype, "listContainerClasses", {
        get: function () {
            var containerClasses = ['k-list-container', 'k-reset'];
            if (this.popupSettings.popupClass) {
                containerClasses.push(this.popupSettings.popupClass);
            }
            return containerClasses;
        },
        enumerable: true,
        configurable: true
    });
    ComboBoxComponent.prototype._toggle = function (open) {
        var _this = this;
        this._open = open;
        if (this.popupRef) {
            this.popupRef.popupElement
                .removeEventListener('mousedown', this.popupMouseDownHandler);
            this.popupRef.close();
            this.popupRef = null;
        }
        if (this._open) {
            this.popupRef = this.popupService.open({
                anchor: this.wrapper,
                animate: this.popupSettings.animate,
                appendTo: this.appendTo,
                content: this.popupTemplate,
                popupClass: this.listContainerClasses,
                positionMode: 'absolute'
            });
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler);
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
            popupWrapper.setAttribute("dir", this.direction);
            this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; });
        }
    };
    return ComboBoxComponent;
}());

ComboBoxComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoComboBox',
                providers: [COMBOBOX_VALUE_ACCESSOR, __WEBPACK_IMPORTED_MODULE_7__selection_service__["a" /* SelectionService */], __WEBPACK_IMPORTED_MODULE_8__navigation_service__["a" /* NavigationService */]],
                selector: 'kendo-combobox',
                template: "\n        <span #wrapper unselectable=\"on\" [ngClass]=\"wrapperClasses()\">\n          <kendo-searchbar #searchbar\n              [role]=\"'listbox'\"\n              [id]=\"id\"\n              [listId]=\"listBoxId\"\n              [activeDescendant]=\"activeDescendant\"\n              [userInput]=\"text\"\n              [suggestedText]=\"getSuggestion()\"\n              [disabled]=\"disabled\"\n              [readonly]=\"readonly\"\n              [tabIndex]=\"tabIndex\"\n              [popupOpen]=\"popupOpen\"\n              [placeholder]=\"placeholder\"\n              (onNavigate)=\"handleNavigate($event)\"\n              (valueChange)=\"searchBarChange($event)\"\n              (onBlur)=\"handleBlur()\"\n              (onFocus)=\"handleFocus()\"\n          ></kendo-searchbar>\n          <span *ngIf=\"!loading && !readonly && (clearButton && text?.length)\" class=\"k-icon k-clear-value k-i-close\" title=\"clear\" role=\"button\" tabindex=\"-1\" (click)=\"clearValue($event)\" (mousedown)=\"$event.preventDefault()\"></span>\n          <span unselectable=\"on\"\n              [ngClass]=\"{ 'k-select': true }\"\n              (click)=\"togglePopup()\"\n              (mousedown)=\"$event.preventDefault()\" >\n              <span [ngClass]=\"buttonClasses\"></span>\n          </span>\n          <ng-template #popupTemplate>\n              <!--header template-->\n              <ng-template *ngIf=\"headerTemplate\"\n                  [templateContext]=\"{\n                      templateRef: headerTemplate.templateRef\n                  }\">\n              </ng-template>\n              <!--list-->\n              <kendo-list\n                  [id]=\"listBoxId\"\n                  [optionPrefix]=\"optionPrefix\"\n                  [data]=\"data\"\n                  [textField]=\"textField\"\n                  [valueField]=\"valueField\"\n                  [template]=\"template\"\n                  [height]=\"height\"\n                  [show]=\"popupOpen\"\n              >\n              </kendo-list>\n              <!--no-data template-->\n              <div class=\"k-nodata\" *ngIf=\"data.length === 0\">\n                  <ng-template [ngIf]=\"noDataTemplate\"\n                      [templateContext]=\"{\n                          templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n                      }\">\n                  </ng-template>\n                  <ng-template [ngIf]=\"!noDataTemplate\">\n                      <div>NO DATA FOUND.</div>\n                  </ng-template>\n              </div>\n              <!--footer template-->\n              <ng-template *ngIf=\"footerTemplate\"\n                  [templateContext]=\"{\n                      templateRef: footerTemplate.templateRef\n                  }\">\n              </ng-template>\n          </ng-template>\n        </span>\n        <ng-template [ngIf]=\"popupOpen\">\n            <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n        </ng-template>\n        <ng-container #container></ng-container>\n  "
            },] },
];
/** @nocollapse */
ComboBoxComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_25__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_26__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: __WEBPACK_IMPORTED_MODULE_7__selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_8__navigation_service__["a" /* NavigationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
]; };
ComboBoxComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'allowCustom': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'textField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valuePrimitive': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueNormalizer': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupSettings': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'iconClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'loading': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'suggest': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'clearButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'readonly': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["tabIndex",] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'selectionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'filterChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__templates_item_template_directive__["a" /* ItemTemplateDirective */],] },],
    'headerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_4__templates_header_template_directive__["a" /* HeaderTemplateDirective */],] },],
    'footerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_5__templates_footer_template_directive__["a" /* FooterTemplateDirective */],] },],
    'noDataTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_6__templates_no_data_template_directive__["a" /* NoDataTemplateDirective */],] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['container', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"] },] },],
    'popupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['popupTemplate',] },],
    'searchbar': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: [__WEBPACK_IMPORTED_MODULE_2__searchbar_component__["a" /* SearchBarComponent */],] },],
    'widgetClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-combobox',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-header',] },],
    'clearable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-combobox-clearable',] },],
    'widgetHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.max-height',] },],
    'dir': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
};


/***/ }),
/* 282 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComboBoxModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combobox_component__ = __webpack_require__(281);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shared_module__ = __webpack_require__(88);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__shared_directives_module__ = __webpack_require__(62);




var COMBOBOX_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__combobox_component__["a" /* ComboBoxComponent */]
];
/**
 * @hidden
 *
 * The exported package module.
 *
 * The package exports:
 * - `ComboBoxComponent`&mdash;The ComboBox component class.
 * - `ItemTemplateDirective`&mdash;The item template directive.
 * - `HeaderTemplateDirective`&mdash;The header template directive.
 * - `FooterTemplateDirective`&mdash;The footer template directive.
 */
var ComboBoxModule = (function () {
    function ComboBoxModule() {
    }
    return ComboBoxModule;
}());

ComboBoxModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMBOBOX_DIRECTIVES],
                exports: [COMBOBOX_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_3__shared_directives_module__["a" /* SharedDirectivesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_2__shared_module__["a" /* SharedModule */]]
            },] },
];
/** @nocollapse */
ComboBoxModule.ctorParameters = function () { return []; };


/***/ }),
/* 283 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export DROPDOWNLIST_VALUE_ACCESSOR */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DropDownListComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_interval__ = __webpack_require__(145);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_interval___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_interval__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_take__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_take___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_take__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_takeUntil__ = __webpack_require__(107);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_takeUntil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_takeUntil__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_concatMap__ = __webpack_require__(243);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_concatMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_merge__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_operator_skipWhile__ = __webpack_require__(498);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_operator_skipWhile___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_add_operator_skipWhile__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__common_keys__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__selection_service__ = __webpack_require__(61);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__navigation_service__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__templates_item_template_directive__ = __webpack_require__(65);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__templates_value_template_directive__ = __webpack_require__(167);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__templates_header_template_directive__ = __webpack_require__(64);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__templates_footer_template_directive__ = __webpack_require__(63);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__templates_no_data_template_directive__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__navigation_action__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__common_preventable_event__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__progress_kendo_angular_popup__ = __webpack_require__(28);
/* tslint:disable:max-line-length */
/* tslint:disable:no-bitwise */

























var InternalState;
(function (InternalState) {
    InternalState[InternalState["None"] = 0] = "None";
    InternalState[InternalState["SetInitial"] = 1] = "SetInitial";
    InternalState[InternalState["UseInitial"] = 2] = "UseInitial";
    InternalState[InternalState["UseExisting"] = 4] = "UseExisting";
    InternalState[InternalState["UseDefault"] = 8] = "UseDefault";
    InternalState[InternalState["UseModel"] = 16] = "UseModel";
})(InternalState || (InternalState = {}));
/**
 * @hidden
 */
var DROPDOWNLIST_VALUE_ACCESSOR = {
    multi: true,
    provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],
    // tslint:disable-next-line:no-use-before-declare
    useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return DropDownListComponent; })
};
/**
 * Represents the Kendo UI DropDownList component for Angular.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-dropdownlist [data]="listItems">
 *  </kendo-dropdownlist>
 * `
 * })
 * class AppComponent {
 *   public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 */
var DropDownListComponent = (function () {
    function DropDownListComponent(rtl, popupService, selectionService, navigationService, _zone, renderer, hostElement, cdr) {
        this.popupService = popupService;
        this.selectionService = selectionService;
        this.navigationService = navigationService;
        this._zone = _zone;
        this.renderer = renderer;
        this.hostElement = hostElement;
        this.cdr = cdr;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["e" /* guid */])();
        /**
         * Sets the disabled state of the component.
         */
        this.disabled = false;
        /**
         * Sets the readonly state of the component.
         */
        this.readonly = false;
        /**
         * Enables the [filtering]({% slug filtering_ddl %}) functionality of the DropDownList.
         */
        this.filterable = false;
        /**
         * Enables a case-insensitive search. When filtration is disabled, use this option.
         */
        this.ignoreCase = true;
        /**
         * Sets the delay before an item search is performed. When filtration is disabled, use this option.
         */
        this.delay = 500;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Fires each time the value is changed.
         *
         * For more details, refer to the example on [events]({% slug overview_ddl %}#toc-events).
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user types in the filter input. You can filter the source based on the passed filtration value.
         *
         * For more details, refer to the example on [events]({% slug overview_ddl %}#toc-events).
         */
        this.filterChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the item selection is changed.
         *
         * For more details, refer to the example on [events]({% slug overview_ddl %}#toc-events).
         */
        this.selectionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to open.
         * This event is preventable. If you cancel it, the popup will remain closed.
         */
        this.open = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the popup is about to close.
         * This event is preventable. If you cancel it, the popup will remain open.
         */
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the DropDownList.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the DropDownList gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        this.listBoxId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["e" /* guid */])();
        this.optionPrefix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["e" /* guid */])();
        this.filterText = "";
        this.isFocused = false;
        this.onTouchedCallback = function (_) { };
        this.onChangeCallback = function (_) { };
        this.word = "";
        this.last = "";
        this.filterFocused = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.filterBlurred = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.wrapperFocused = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.wrapperBlurred = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.valueSubject = new __WEBPACK_IMPORTED_MODULE_11_rxjs_Subject__["Subject"]();
        this.selectionSubject = new __WEBPACK_IMPORTED_MODULE_11_rxjs_Subject__["Subject"]();
        this._state = InternalState.SetInitial;
        this._open = false;
        this._popupSettings = { height: 200, animate: true };
        this.direction = rtl ? 'rtl' : 'ltr';
        this.data = [];
        this.subscribeEvents();
        this.hostElement = hostElement.nativeElement;
        this.popupMouseDownHandler = this.onMouseDown.bind(this);
    }
    Object.defineProperty(DropDownListComponent.prototype, "width", {
        get: function () {
            var wrapperWidth = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["d" /* isDocumentAvailable */])() ? this.wrapper.nativeElement.offsetWidth : 0;
            var width = this.popupSettings.width || wrapperWidth;
            var minWidth = isNaN(wrapperWidth) ? wrapperWidth : wrapperWidth + "px";
            var maxWidth = isNaN(width) ? width : width + "px";
            return { min: minWidth, max: maxWidth };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "height", {
        get: function () {
            return this.popupSettings.height;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "popupOpen", {
        get: function () {
            return this._open;
        },
        set: function (open) {
            if (this.disabled || this.readonly || this.popupOpen === open) {
                return;
            }
            var eventArgs = new __WEBPACK_IMPORTED_MODULE_22__common_preventable_event__["a" /* PreventableEvent */]();
            if (open) {
                this.open.emit(eventArgs);
            }
            else {
                this.close.emit(eventArgs);
            }
            if (eventArgs.isDefaultPrevented()) {
                return;
            }
            this._toggle(open);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "widgetTabIndex", {
        get: function () {
            return this.disabled ? undefined : this.tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "ariaHasPopup", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "ariaExpanded", {
        get: function () {
            return this.popupOpen;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "ariaOwns", {
        get: function () {
            return this.listBoxId;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "ariaActivedescendant", {
        get: function () {
            return this.optionPrefix + "-" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this.value, this.valueField);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "appendTo", {
        get: function () {
            var appendTo = this.popupSettings.appendTo;
            if (!appendTo || appendTo === 'root') {
                return undefined;
            }
            return appendTo === 'component' ? this.container : appendTo;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "data", {
        get: function () {
            return this._data;
        },
        /**
         * Sets the data of the DropDownList.
         *
         * > The data has to be provided in an array-like list.
         */
        set: function (data) {
            this._data = data || [];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "value", {
        get: function () {
            return this._value;
        },
        /**
         * Sets the value of the DropDownList. It can either be of the primitive (string, numbers) or of the complex (objects) type. To define the type, use the `valuePrimitive` option.
         *
         * > All selected values which are not present in the source are ignored.
         */
        set: function (newValue) {
            this._value = newValue;
            this.cdr.markForCheck();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "popupSettings", {
        get: function () {
            return this._popupSettings;
        },
        /**
         * Configures the popup of the DropDownList.
         *
         * The available options are:
         * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
         * - `width: Number`&mdash;Sets the width of the popup container. By default, the width of the host element is used.
         * - `height: Number`&mdash;Sets the height of the popup container. By default, the height is 200px.
         * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
         */
        set: function (settings) {
            this._popupSettings = Object.assign({ height: 200, animate: true }, settings);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DropDownListComponent.prototype.blurComponent = function () {
        this.wrapperBlurred.emit();
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.blurFilterInput = function () {
        this.filterBlurred.emit();
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.focusComponent = function () {
        this.wrapperFocused.emit();
        if (!this.isFocused) {
            this.isFocused = true;
            this.onFocus.emit();
        }
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.keydown = function (event) {
        var hasSelected = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this.selectionService.selected[0]);
        var focused = isNaN(this.selectionService.focused) ? 0 : this.selectionService.focused;
        var offset = 0;
        if (this.disabled || this.readonly) {
            return;
        }
        if (this.filterInput && this.filterInput.nativeElement === document.activeElement && (event.keyCode === __WEBPACK_IMPORTED_MODULE_12__common_keys__["a" /* Keys */].home || event.keyCode === __WEBPACK_IMPORTED_MODULE_12__common_keys__["a" /* Keys */].end)) {
            return;
        }
        if (!hasSelected) {
            if (event.keyCode === __WEBPACK_IMPORTED_MODULE_12__common_keys__["a" /* Keys */].down) {
                offset = -1;
            }
            else if (event.keyCode === __WEBPACK_IMPORTED_MODULE_12__common_keys__["a" /* Keys */].up) {
                offset = 1;
            }
        }
        var eventData = event;
        var action = this.navigationService.process({
            current: focused + offset,
            max: this.data.length - 1,
            min: this.defaultItem ? -1 : 0,
            originalEvent: eventData
        });
        var leftRightKeys = (action === __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Left) || (action === __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Right);
        if (action !== __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Undefined &&
            action !== __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Tab &&
            action !== __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Backspace &&
            action !== __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Delete &&
            !(leftRightKeys && this.filterable) &&
            action !== __WEBPACK_IMPORTED_MODULE_21__navigation_action__["a" /* NavigationAction */].Enter //enter when popup is opened is handled before `handleEnter`
        ) {
            eventData.preventDefault();
        }
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.keypress = function (event) {
        if (!this.filterable) {
            this.onKeyPress(event);
        }
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.click = function () {
        this.wrapper.nativeElement.focus();
        this.popupOpen = !this.popupOpen;
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.onResize = function () {
        if (this._open) {
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
        }
    };
    Object.defineProperty(DropDownListComponent.prototype, "widgetClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    DropDownListComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.hostElement, "tabindex");
        this.createSelectionStream();
        this.createValueStream();
    };
    /**
     * @hidden
     * Used by the TextBoxContainer to determine if the component is empty.
     */
    DropDownListComponent.prototype.isEmpty = function () {
        return !this.value && !this.defaultItem;
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.onFilterFocus = function () {
        this.filterFocused.emit();
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.popupOpened = function () {
        if (this.filterInput) {
            var nativeElement_1 = this.filterInput.nativeElement;
            var text_1 = this.filterText || nativeElement_1.value;
            this.nextTick(function () {
                nativeElement_1.focus();
                nativeElement_1.setSelectionRange(text_1.length, text_1.length);
            });
        }
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.ngOnDestroy = function () {
        this._toggle(false);
        this.unsubscribeEvents();
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.ngOnChanges = function (_changes) {
        if (this.valuePrimitive === undefined) {
            this.valuePrimitive = this.valueField ? false : true;
        }
        if (_changes.hasOwnProperty("value")) {
            this.verifySettings(_changes.value.currentValue);
            this._modelValue = _changes.value.currentValue;
        }
        this.setState();
    };
    /**
     * Focuses the DropDownList.
     */
    DropDownListComponent.prototype.focus = function () {
        if (!this.disabled) {
            this.wrapper.nativeElement.focus();
        }
    };
    /**
     * Blurs the DropDownList.
     */
    DropDownListComponent.prototype.blur = function () {
        if (!this.disabled) {
            this.wrapper.nativeElement.blur();
        }
    };
    /**
     * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup, the `open` and `close` events will not be fired.
     *
     * @param open - The state of the popup.
     */
    DropDownListComponent.prototype.toggle = function (open) {
        var _this = this;
        Promise.resolve(null).then(function () {
            _this._toggle((open === undefined) ? !_this._open : open);
            _this.cdr.markForCheck();
        });
    };
    Object.defineProperty(DropDownListComponent.prototype, "isOpen", {
        /**
         * Returns the current open state of the popup.
         */
        get: function () {
            return this.popupOpen;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Resets the value of the DropDownList.
     * If you use the `reset` method to clear components value, the model will not update automatically and the `selectionChange` and `valueChange` events will not be fired.
     */
    DropDownListComponent.prototype.reset = function () {
        this._modelValue = undefined;
        this.setState();
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.writeValue = function (value) {
        this.verifySettings(value);
        var isInitial = Boolean(value !== null && this._state & InternalState.SetInitial);
        if (value === null && this._state & InternalState.SetInitial) {
            return;
        }
        if (isInitial) {
            this._state |= InternalState.UseInitial;
        }
        this._modelValue = value;
        this.setState();
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.registerOnChange = function (fn) {
        this.onChangeCallback = fn;
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.registerOnTouched = function (fn) {
        this.onTouchedCallback = fn;
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    Object.defineProperty(DropDownListComponent.prototype, "listContainerClasses", {
        /**
         * @hidden
         */
        get: function () {
            var containerClasses = ['k-list-container', 'k-reset'];
            if (this.popupSettings.popupClass) {
                containerClasses.push(this.popupSettings.popupClass);
            }
            return containerClasses;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DropDownListComponent.prototype, "buttonClasses", {
        /**
         * @hidden
         */
        get: function () {
            return _a = {},
                _a[this.iconClass] = !this.loading && this.iconClass,
                _a['k-i-arrow-s'] = !this.loading && !this.iconClass,
                _a['k-i-loading'] = this.loading,
                _a['k-icon'] = true,
                _a;
            var _a;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    DropDownListComponent.prototype.setDefaultItemClasses = function () {
        return {
            'k-list-optionlabel': true
        };
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.getText = function () {
        return this.text;
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.getDefaultItemText = function () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this.defaultItem, this.textField);
    };
    DropDownListComponent.prototype._toggle = function (open) {
        var _this = this;
        this._open = open;
        if (this.popupRef) {
            this.popupRef.popupElement
                .removeEventListener('mousedown', this.popupMouseDownHandler);
            this.popupRef.close();
            this.popupRef = null;
        }
        if (this._open) {
            this.popupRef = this.popupService.open({
                anchor: this.wrapper,
                animate: this.popupSettings.animate,
                appendTo: this.appendTo,
                content: this.popupTemplate,
                popupClass: this.listContainerClasses,
                positionMode: 'absolute'
            });
            var popupWrapper = this.popupRef.popupElement;
            var _a = this.width, min = _a.min, max = _a.max;
            popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler);
            popupWrapper.style.minWidth = min;
            popupWrapper.style.width = max;
            popupWrapper.setAttribute("dir", this.direction);
            this.popupRef.popupOpen.subscribe(this.popupOpened.bind(this));
            this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; });
        }
    };
    DropDownListComponent.prototype.createSelectionStream = function () {
        var _this = this;
        if (this.selectionSubscription) {
            this.selectionSubscription.unsubscribe();
        }
        this.selectionSubscription = this.selectionSubject
            .map(function (index) {
            var dataItem = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(_this.data[index]) ? _this.data[index] : _this.defaultItem;
            return {
                dataItem: dataItem,
                text: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(dataItem, _this.textField),
                value: _this.valuePrimitive ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(dataItem, _this.valueField) : dataItem
            };
        })
            .distinctUntilChanged(function (prev, next) {
            return prev.value === next.value;
        })
            .subscribe(function (state) {
            _this.dataItem = state.dataItem;
            _this.text = state.text;
            _this.value = state.value;
            _this.selectionChange.emit(state.dataItem);
        });
    };
    DropDownListComponent.prototype.createValueStream = function () {
        var _this = this;
        if (this.valueSubscription) {
            this.valueSubscription.unsubscribe();
        }
        this.valueSubscription = this.valueSubject
            .do(function () { _this.popupOpen = false; })
            .map(function (dataItem) { return dataItem || _this.defaultItem; })
            .distinctUntilChanged(function (prev, next) {
            var current = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(_this.dataItem, _this.valueField);
            prev = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(prev, _this.valueField);
            next = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(next, _this.valueField);
            return (prev === next) && (current === next);
        })
            .map(function (dataItem) {
            var primitiveValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(dataItem, _this.valueField);
            var newValue = _this.valuePrimitive ? primitiveValue : dataItem;
            var newText = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(dataItem, _this.textField);
            return {
                dataItem: dataItem,
                primitiveValue: primitiveValue,
                text: newText,
                value: newValue
            };
        })
            .subscribe(function (state) {
            _this.dataItem = state.dataItem;
            _this.value = state.value;
            _this.text = state.text;
            _this.selectionSubject.next(_this.data.findIndex(function (element) {
                return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(element, _this.valueField) === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(_this.value, _this.valueField, _this.valuePrimitive);
            }));
            _this.emitChange(_this.valuePrimitive ? state.primitiveValue : _this.value);
            if (_this.filterable && _this.filterText) {
                _this.filterText = "";
                _this.cdr.markForCheck();
                _this.filterChange.emit(_this.filterText);
            }
        });
    };
    DropDownListComponent.prototype.subscribeEvents = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.changeSubscription = this.selectionService.onChange.subscribe(this.handleItemChange.bind(this));
        this.selectSubscription = this.selectionService.onSelect.subscribe(this.handleItemSelect.bind(this));
        this.navigationSubscription = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].merge(this.navigationService.up, this.navigationService.down, this.navigationService.left.skipWhile(function () { return _this.filterable; }), this.navigationService.right.skipWhile(function () { return _this.filterable; }), this.navigationService.home, this.navigationService.end)
            .subscribe(function (event) { return _this.selectionService.select(event.index); });
        this.openSubscription = this.navigationService.open.subscribe(function () { return _this.popupOpen = true; });
        this.closeSubscription = this.navigationService.close.subscribe(function () {
            _this.popupOpen = false;
            _this.wrapper.nativeElement.focus();
        });
        this.enterSubscription = this.navigationService.enter
            .do(function (event) {
            if (_this.popupOpen) {
                event.originalEvent.preventDefault();
            }
        })
            .merge(this.navigationService.esc)
            .subscribe(this.handleEnter.bind(this));
        this.filterBlurredSubscription = this.filterBlurred
            .concatMap(function () { return __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].interval(10).take(1).takeUntil(_this.wrapperFocused); })
            .subscribe(function () {
            _this.wrapperBlurred.emit();
        });
        this._zone.runOutsideAngular(function () {
            _this.componentBlurredSubscription = _this.wrapperBlurred
                .concatMap(function () { return __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].interval(10).take(1).takeUntil(_this.filterFocused); })
                .merge(_this.navigationService.tab)
                .filter(function () { return _this.isFocused; })
                .subscribe(function () { return _this._zone.run(function () {
                _this.componentBlur();
            }); });
        });
    };
    DropDownListComponent.prototype.unsubscribeEvents = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["d" /* isDocumentAvailable */])()) {
            return;
        }
        this.changeSubscription.unsubscribe();
        this.selectSubscription.unsubscribe();
        this.navigationSubscription.unsubscribe();
        this.openSubscription.unsubscribe();
        this.closeSubscription.unsubscribe();
        this.enterSubscription.unsubscribe();
        this.componentBlurredSubscription.unsubscribe();
        this.filterBlurredSubscription.unsubscribe();
        if (this.selectionSubscription) {
            this.selectionSubscription.unsubscribe();
        }
        if (this.valueSubscription) {
            this.valueSubscription.unsubscribe();
        }
    };
    DropDownListComponent.prototype.handleItemChange = function (event) {
        var index = event.indices.length ? event.indices[0] : undefined;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(index)) {
            return;
        }
        var dataItem = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this.data[index]) ? this.data[index] : this.defaultItem;
        this.valueSubject.next(dataItem);
    };
    DropDownListComponent.prototype.handleItemSelect = function (event) {
        var index = event.indices.length ? event.indices[0] : undefined;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(index)) {
            return;
        }
        var dataItem = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this.data[index]) ? this.data[index] : this.defaultItem;
        if (this.popupOpen) {
            this.selectionSubject.next(index);
        }
        else {
            this.valueSubject.next(dataItem);
        }
    };
    DropDownListComponent.prototype.handleEnter = function () {
        if (this.popupOpen) {
            this.valueSubject.next(this.data[this.selectionService.focused]);
            this.wrapper.nativeElement.focus();
        }
    };
    DropDownListComponent.prototype.verifySettings = function (newValue) {
        var valueOrText = !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this.valueField) !== !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this.textField);
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (this.defaultItem && this.valueField && typeof this.defaultItem !== "object") {
            throw new Error("defaultItem and data items must be of same type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/api/DropDownListComponent/#toc-defaultitem");
        }
        if (this.valuePrimitive === true && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(newValue) && typeof newValue === "object") {
            throw new Error("Expected initial value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-value-selection");
        }
        if (this.valuePrimitive === false && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(newValue) && typeof newValue !== "object") {
            throw new Error("Expected initial value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-value-selection");
        }
        if (valueOrText) {
            throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-bind-to-arrays-of-complex-data");
        }
    };
    DropDownListComponent.prototype.componentBlur = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this._previousValue, this.valueField) !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this.value, this.valueField)) {
            this.valueSubject.next(this.dataItem);
        }
        else {
            this.popupOpen = false;
        }
        if (this.isFocused) {
            this.isFocused = false;
            this.onBlur.emit();
            this.onTouchedCallback();
        }
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.onMouseDown = function (event) {
        var tagName = event.target.tagName.toLowerCase();
        if (tagName !== "input") {
            event.preventDefault();
        }
    };
    DropDownListComponent.prototype.onKeyPress = function (event) {
        if (event.which === 0 || event.keyCode === __WEBPACK_IMPORTED_MODULE_12__common_keys__["a" /* Keys */].enter) {
            return;
        }
        var character = String.fromCharCode(event.charCode || event.keyCode);
        if (this.ignoreCase) {
            character = character.toLowerCase();
        }
        if (character === " ") {
            event.preventDefault();
        }
        this.word += character;
        this.last = character;
        this.search();
    };
    DropDownListComponent.prototype.search = function () {
        var _this = this;
        clearTimeout(this.typingTimeout);
        if (!this.filterable) {
            this.typingTimeout = setTimeout(function () { _this.word = ""; }, this.delay);
            this.selectNext();
        }
    };
    DropDownListComponent.prototype.selectNext = function () {
        var data = this.data.map(function (item, index) {
            return { item: item, itemIndex: index };
        });
        var isInLoop = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["f" /* sameCharsOnly */])(this.word, this.last);
        var dataLength = data.length;
        var startIndex = isNaN(this.selectionService.selected[0]) ? 0 : this.selectionService.selected[0];
        var text, index, defaultItem;
        if (this.defaultItem) {
            defaultItem = { item: this.defaultItem, itemIndex: -1 };
            dataLength += 1;
            startIndex += 1;
        }
        startIndex += isInLoop ? 1 : 0;
        data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["g" /* shuffleData */])(data, startIndex, defaultItem);
        index = 0;
        for (; index < dataLength; index++) {
            text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(data[index].item, this.textField);
            var loopMatch = Boolean(isInLoop && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["h" /* matchText */])(text, this.last, this.ignoreCase));
            var nextMatch = Boolean(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["h" /* matchText */])(text, this.word, this.ignoreCase));
            if (loopMatch || nextMatch) {
                index = data[index].itemIndex;
                break;
            }
        }
        if (index !== dataLength) {
            this.navigate(index);
        }
    };
    DropDownListComponent.prototype.emitChange = function (value) {
        this._modelValue = value;
        this.onChangeCallback(value);
        this.valueChange.emit(value);
    };
    DropDownListComponent.prototype.navigate = function (index) {
        this.selectionService.select(index);
    };
    DropDownListComponent.prototype.resolveState = function () {
        var primitiveValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this._modelValue, this.valueField, true);
        var existing;
        var state;
        if (this.data.length) {
            state = InternalState.UseExisting;
        }
        else {
            state = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this._modelValue) ? InternalState.UseModel : InternalState.UseDefault;
        }
        if (state === InternalState.UseExisting) {
            existing = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["i" /* resolveValue */])({ data: this.data, defaultItem: this.defaultItem, value: primitiveValue, valueField: this.valueField });
            if (existing.dataItem !== undefined) {
                state = InternalState.UseExisting;
            }
            else {
                state = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this._modelValue) ? InternalState.UseModel : InternalState.UseDefault;
            }
        }
        state |= this._state & InternalState.SetInitial | this._state & InternalState.UseInitial;
        this._state = state;
        return existing;
    };
    DropDownListComponent.prototype.setState = function () {
        var resolved = this.resolveState();
        var newState = { value: undefined, text: undefined, dataItem: undefined, selected: [] };
        if (this._state & InternalState.UseModel) {
            newState.value = this.valuePrimitive ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this._modelValue, this.valueField, true) : this._modelValue;
            newState.dataItem = this._modelValue;
            newState.text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["b" /* isPresent */])(this._modelValue) ? this._modelValue : this.defaultItem, this.textField);
            newState.selected = [];
            this.selectionService.resetSelection(newState.selected);
            this.selectionService.focused = 0;
        }
        else if (this._state & InternalState.UseExisting) {
            newState.value = this.valuePrimitive ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(resolved.dataItem, this.valueField) : resolved.dataItem;
            newState.dataItem = resolved.dataItem;
            newState.text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(resolved.dataItem, this.textField);
            if (this._state & InternalState.UseInitial) {
                this._modelValue = resolved.dataItem;
            }
            this.selectionService.resetSelection(resolved.selected);
            if (this.filterText) {
                this.selectionService.focused = 0;
            }
        }
        else if (this._state & InternalState.UseDefault) {
            newState.value = this.valuePrimitive ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this.defaultItem, this.valueField, false) : this.defaultItem;
            newState.dataItem = this.defaultItem;
            newState.text = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__util__["a" /* getter */])(this.defaultItem, this.textField);
            this.selectionService.resetSelection(this.defaultItem ? [-1] : []);
            this.selectionService.focused = 0;
        }
        if (this._state & InternalState.UseInitial) {
            this._state &= ~InternalState.UseInitial | ~InternalState.SetInitial;
            this._previousValue = newState.dataItem;
        }
        else {
            this._previousValue = this.dataItem;
        }
        this.text = newState.text;
        this.value = newState.value;
        this.dataItem = newState.dataItem;
    };
    /**
     * @hidden
     */
    DropDownListComponent.prototype.handleFilter = function (event) {
        this.filterChange.emit(event.target.value);
    };
    DropDownListComponent.prototype.nextTick = function (f) {
        var _this = this;
        this._zone.runOutsideAngular(function () {
            // Use `setTimeout` instead of a resolved promise
            // because the latter does not wait long enough.
            setTimeout(function () { return _this._zone.run(f); });
        });
    };
    return DropDownListComponent;
}());

DropDownListComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoDropDownList',
                providers: [DROPDOWNLIST_VALUE_ACCESSOR, __WEBPACK_IMPORTED_MODULE_14__selection_service__["a" /* SelectionService */], __WEBPACK_IMPORTED_MODULE_15__navigation_service__["a" /* NavigationService */]],
                selector: 'kendo-dropdownlist',
                template: "\n        <span #wrapper unselectable=\"on\"\n          role=\"listbox\"\n          [id]=\"id\"\n          [ngClass]=\"{\n            'k-dropdown-wrap': true,\n            'k-state-default': !this.disabled,\n            'k-state-disabled': this.disabled,\n            'k-state-focused': this.isFocused\n          }\"\n          [attr.dir]=\"direction\"\n          [attr.readonly]=\"readonly\"\n          [attr.tabindex]=\"widgetTabIndex\"\n          [attr.aria-disabled]=\"disabled\"\n          [attr.aria-readonly]=\"readonly\"\n          [attr.aria-haspopup]=\"ariaHasPopup\"\n          [attr.aria-expanded]=\"ariaExpanded\"\n          [attr.aria-owns]=\"ariaOwns\"\n          [attr.aria-activedescendant]=\"ariaActivedescendant\"\n          (focus)=\"focusComponent()\"\n          (blur)=\"blurComponent()\"\n          (keydown)=\"keydown($event)\"\n          (keypress)=\"keypress($event)\"\n          (click)=\"click()\"\n        >\n            <span [ngClass]=\"{ 'k-input': true }\" unselectable=\"on\">\n               <ng-template *ngIf=\"valueTemplate\"\n                   [templateContext]=\"{\n                       templateRef: valueTemplate.templateRef,\n                       $implicit: dataItem\n                   }\">\n               </ng-template>\n               <ng-template [ngIf]=\"!valueTemplate\">{{ getText() }}</ng-template>\n           </span>\n           <span [ngClass]=\"{ 'k-select': true}\" unselectable=\"on\">\n               <span [ngClass]=\"buttonClasses\"></span>\n           </span>\n           <ng-template #popupTemplate>\n               <!--filterable-->\n\n               <ng-template [ngIf]=\"filterable\">\n                   <span [ngClass]=\"{ 'k-list-filter': true }\" (click)=\"$event.stopImmediatePropagation()\">\n                       <input #filterInput\n                           [dir]=\"direction\"\n                           [(ngModel)]=\"filterText\"\n                           class=\"k-textbox\"\n                           (keydown)=\"keydown($event)\"\n                           (input)=\"handleFilter($event)\"\n                           (focus)=\"onFilterFocus()\"\n                           (blur)=\"blurFilterInput()\" />\n                       <span [ngClass]=\"{ 'k-icon': true, 'k-i-search': true }\" unselectable=\"on\"></span>\n                   </span>\n               </ng-template>\n               <!--default item-->\n               <ng-template [ngIf]=\"defaultItem && !itemTemplate\">\n                   <div [ngClass]=\"setDefaultItemClasses()\" kendoDropDownsSelectable [index]=\"-1\">\n                       {{ getDefaultItemText() }}\n                   </div>\n               </ng-template>\n               <ng-template [ngIf]=\"defaultItem && itemTemplate\">\n                   <div [ngClass]=\"setDefaultItemClasses()\" kendoDropDownsSelectable [index]=\"-1\">\n                       <ng-template\n                           [templateContext]=\"{\n                               templateRef: itemTemplate.templateRef,\n                               $implicit: defaultItem\n                           }\">\n                       </ng-template>\n                   </div>\n               </ng-template>\n               <!--header template-->\n               <ng-template *ngIf=\"headerTemplate\"\n                   [templateContext]=\"{\n                       templateRef: headerTemplate.templateRef\n                   }\">\n               </ng-template>\n               <!--list-->\n               <kendo-list\n                   [id]=\"listBoxId\"\n                   [optionPrefix]=\"optionPrefix\"\n                   [data]=\"data\"\n                   [textField]=\"textField\"\n                   [valueField]=\"valueField\"\n                   [template]=\"itemTemplate\"\n                   [height]=\"height\"\n                   [show]=\"popupOpen\"\n                   >\n               </kendo-list>\n               <!--no-data template-->\n               <div class=\"k-nodata\" *ngIf=\"data.length === 0\">\n                   <ng-template [ngIf]=\"noDataTemplate\"\n                       [templateContext]=\"{\n                           templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n                       }\">\n                   </ng-template>\n                   <ng-template [ngIf]=\"!noDataTemplate\">\n                       <div>NO DATA FOUND.</div>\n                   </ng-template>\n               </div>\n               <!--footer template-->\n               <ng-template *ngIf=\"footerTemplate\"\n                   [templateContext]=\"{\n                       templateRef: footerTemplate.templateRef\n                   }\">\n               </ng-template>\n            </ng-template>\n        </span>\n        <ng-template [ngIf]=\"popupOpen\">\n            <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n        </ng-template>\n        <ng-container #container></ng-container>\n  "
            },] },
];
/** @nocollapse */
DropDownListComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_23__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_24__progress_kendo_angular_popup__["a" /* PopupService */], },
    { type: __WEBPACK_IMPORTED_MODULE_14__selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_15__navigation_service__["a" /* NavigationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
]; };
DropDownListComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'iconClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'loading': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'textField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'popupSettings': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'defaultItem': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'readonly': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'ignoreCase': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'delay': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valuePrimitive': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["tabIndex",] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'filterChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'selectionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'open': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'itemTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_16__templates_item_template_directive__["a" /* ItemTemplateDirective */],] },],
    'valueTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_17__templates_value_template_directive__["a" /* ValueTemplateDirective */],] },],
    'headerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_18__templates_header_template_directive__["a" /* HeaderTemplateDirective */],] },],
    'footerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_19__templates_footer_template_directive__["a" /* FooterTemplateDirective */],] },],
    'noDataTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_20__templates_no_data_template_directive__["a" /* NoDataTemplateDirective */],] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['container', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"] },] },],
    'filterInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['filterInput',] },],
    'popupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['popupTemplate',] },],
    'wrapper': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['wrapper',] },],
    'widgetClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-dropdown',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-header',] },],
};


/***/ }),
/* 284 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DropDownListModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dropdownlist_component__ = __webpack_require__(283);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templates_value_template_directive__ = __webpack_require__(167);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__shared_module__ = __webpack_require__(88);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shared_directives_module__ = __webpack_require__(62);





var DROPDOWNLIST_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__dropdownlist_component__["a" /* DropDownListComponent */],
    __WEBPACK_IMPORTED_MODULE_2__templates_value_template_directive__["a" /* ValueTemplateDirective */]
];
/**
 * @hidden
 *
 * The exported package module.
 *
 * The package exports:
 * - `DropDownListComponent`&mdash;The DropDownList component class.
 * - `ItemTemplateDirective`&mdash;The item template directive.
 * - `ValueTemplateDirective`&mdash;The value template directive.
 * - `HeaderTemplateDirective`&mdash;The header template directive.
 * - `FooterTemplateDirective`&mdash;The footer template directive.
 */
var DropDownListModule = (function () {
    function DropDownListModule() {
    }
    return DropDownListModule;
}());

DropDownListModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [DROPDOWNLIST_DIRECTIVES],
                exports: [DROPDOWNLIST_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_4__shared_directives_module__["a" /* SharedDirectivesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_3__shared_module__["a" /* SharedModule */]]
            },] },
];
/** @nocollapse */
DropDownListModule.ctorParameters = function () { return []; };


/***/ }),
/* 285 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ListItemDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var ListItemDirective = (function () {
    function ListItemDirective(element) {
        this.element = element;
    }
    return ListItemDirective;
}());

ListItemDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: 'li' // tslint:disable-line
            },] },
];
/** @nocollapse */
ListItemDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
]; };


/***/ }),
/* 286 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ListComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__list_item_directive__ = __webpack_require__(285);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(43);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__selection_service__ = __webpack_require__(61);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_merge__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_merge__);






/**
 * @hidden
 */
var ListComponent = (function () {
    function ListComponent(selectionService) {
        this.data = [];
        this.selected = [];
        this.focused = -1;
        this.multipleSelection = false;
        this.onClick = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.selectionService = selectionService;
        this.scrollSubscription = this.selectionService
            .onSelect
            .map(function (args) { return args.indices[0]; })
            .merge(this.selectionService.onFocus)
            .subscribe(this.scrollToItem.bind(this));
    }
    ListComponent.prototype.ngAfterViewInit = function () {
        if (this.show === true) {
            this.scrollToItem(this.selectionService.focused);
        }
    };
    ListComponent.prototype.ngOnDestroy = function () {
        this.scrollSubscription.unsubscribe();
    };
    ListComponent.prototype.setContainerClasses = function () {
        return {
            'k-list-scroller': true
        };
    };
    ListComponent.prototype.getHeight = function () {
        return this.height + "px";
    };
    ListComponent.prototype.getText = function (dataItem) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* getter */])(dataItem, this.textField);
    };
    ListComponent.prototype.getValue = function (dataItem) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* getter */])(dataItem, this.valueField);
    };
    ListComponent.prototype.scrollToItem = function (index) {
        var items = this.items.toArray();
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["b" /* isPresent */])(items[index]) && index !== -1) {
            this.scroll(items[index].element);
        }
    };
    ListComponent.prototype.scroll = function (item) {
        if (!item) {
            return;
        }
        var nativeElement = item.nativeElement;
        var content = this.content.nativeElement, itemOffsetTop = nativeElement.offsetTop, itemOffsetHeight = nativeElement.offsetHeight, contentScrollTop = content.scrollTop, contentOffsetHeight = content.clientHeight, bottomDistance = itemOffsetTop + itemOffsetHeight;
        if (contentScrollTop > itemOffsetTop) {
            contentScrollTop = itemOffsetTop;
        }
        else if (bottomDistance > (contentScrollTop + contentOffsetHeight)) {
            contentScrollTop = (bottomDistance - contentOffsetHeight);
        }
        content.scrollTop = contentScrollTop;
    };
    return ListComponent;
}());

ListComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-list',
                template: "\n    <div #content [ngClass]=\"setContainerClasses()\" [style.maxHeight]=\"getHeight()\" unselectable=\"on\">\n    <ul role=\"listbox\" [attr.id]=\"id\" [attr.aria-hidden]=\"!show\" [ngClass]=\"{ 'k-list': true, 'k-reset': true }\">\n        <li role=\"option\"\n            *ngFor=\"let dataItem of data; let index = index\"\n            kendoDropDownsSelectable\n            [index]=\"index\"\n            [multipleSelection]=\"multipleSelection\"\n            [attr.id]=\"optionPrefix + '-' + getValue(dataItem)\"\n            [attr.tabIndex]=\"-1\"\n            [ngClass]=\"{'k-item': true}\">\n            <ng-template *ngIf=\"template\"\n                [templateContext]=\"{\n                    templateRef: template.templateRef,\n                    $implicit: dataItem\n                }\">\n            </ng-template>\n            <ng-template [ngIf]=\"!template\">{{ getText(dataItem) }}</ng-template>\n        </li>\n    </ul>\n    </div>\n  "
            },] },
];
/** @nocollapse */
ListComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__selection_service__["a" /* SelectionService */], },
]; };
ListComponent.propDecorators = {
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selected': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focused': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'textField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'height': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'show': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'optionPrefix': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'multipleSelection': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'items': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: [__WEBPACK_IMPORTED_MODULE_1__list_item_directive__["a" /* ListItemDirective */],] },],
    'content': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['content',] },],
};


/***/ }),
/* 287 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MultiSelectModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multiselect_component__ = __webpack_require__(166);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__taglist_component__ = __webpack_require__(290);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templates_tag_template_directive__ = __webpack_require__(292);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__templates_group_tag_template_directive__ = __webpack_require__(291);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__summary_tag_directive__ = __webpack_require__(289);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__shared_module__ = __webpack_require__(88);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__shared_directives_module__ = __webpack_require__(62);








var MULTISELECT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__multiselect_component__["a" /* MultiSelectComponent */],
    __WEBPACK_IMPORTED_MODULE_2__taglist_component__["a" /* TagListComponent */],
    __WEBPACK_IMPORTED_MODULE_3__templates_tag_template_directive__["a" /* TagTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_4__templates_group_tag_template_directive__["a" /* GroupTagTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_5__summary_tag_directive__["a" /* SummaryTagDirective */]
];
/**
 * @hidden
 *
 * The exported package module.
 *
 * The package exports:
 * - `MultiSelectComponent`&mdash;The MultiSelect component class.
 * - `SummaryTagDirective`&mdash;The MultiSelect summary tag directive.
 * - `ItemTemplateDirective`&mdash;The item template directive.
 * - `TagTemplateDirective`&mdash;The tag template directive.
 * - `SummaryTagTemplateDirective`&mdash;The summary tag template directive.
 * - `HeaderTemplateDirective`&mdash;The header template directive.
 * - `FooterTemplateDirective`&mdash;The footer template directive.
 * - `NoDataTemplateDirective`&mdash;The no-data template directive.
 */
var MultiSelectModule = (function () {
    function MultiSelectModule() {
    }
    return MultiSelectModule;
}());

MultiSelectModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [MULTISELECT_DIRECTIVES],
                exports: [MULTISELECT_DIRECTIVES, __WEBPACK_IMPORTED_MODULE_7__shared_directives_module__["a" /* SharedDirectivesModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_6__shared_module__["a" /* SharedModule */]]
            },] },
];
/** @nocollapse */
MultiSelectModule.ctorParameters = function () { return []; };


/***/ }),
/* 288 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectableDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__selection_service__ = __webpack_require__(61);


/**
 * @hidden
 */
var SelectableDirective = (function () {
    function SelectableDirective(selectionService) {
        this.multipleSelection = false;
        this.selectionService = selectionService;
    }
    Object.defineProperty(SelectableDirective.prototype, "focusedClassName", {
        get: function () {
            return this.selectionService.isFocused(this.index);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SelectableDirective.prototype, "selectedClassName", {
        get: function () {
            return this.selectionService.isSelected(this.index);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SelectableDirective.prototype, "ariaSelected", {
        get: function () {
            return this.selectionService.isSelected(this.index) ? true : undefined;
        },
        enumerable: true,
        configurable: true
    });
    SelectableDirective.prototype.onClick = function (event) {
        event.stopPropagation();
        if (this.multipleSelection) {
            if (this.selectionService.isSelected(this.index)) {
                this.selectionService.unselect(this.index);
            }
            else {
                this.selectionService.add(this.index);
            }
        }
        else {
            this.selectionService.change(this.index);
        }
    };
    return SelectableDirective;
}());

SelectableDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDropDownsSelectable]'
            },] },
];
/** @nocollapse */
SelectableDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__selection_service__["a" /* SelectionService */], },
]; };
SelectableDirective.propDecorators = {
    'index': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'multipleSelection': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focusedClassName': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'selectedClassName': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-selected',] },],
    'ariaSelected': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-selected',] },],
    'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click', ['$event'],] },],
};


/***/ }),
/* 289 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SummaryTagDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multiselect_component__ = __webpack_require__(166);


/**
 * A Directive which configures the MultiSelect to show one single summary tag for all selected data items.
 * When a number is provided, the summary tag is displayed after the given amount of data items are selected.
 * @example
 * ```ts-no-run
 * <kendo-multiselect kendoMultiSelectSummaryTag [data]="data"></kendo-multiselect>
 * ```
 *
 * @example
 * ```ts-no-run
 * <kendo-multiselect [kendoMultiSelectSummaryTag]="2" [data]="data"></kendo-multiselect>
 * ```
 */
var SummaryTagDirective = (function () {
    function SummaryTagDirective(multiSelectComponent) {
        var _this = this;
        this.multiSelectComponent = multiSelectComponent;
        /**
         * A numeric value that indicates the number of selected data items after which the summary tag will appear.
         */
        this.showAfter = 0; // tslint:disable-line:no-input-rename
        this.multiSelectComponent.tagMapper = function (tags) {
            if (tags.length > _this.showAfter) {
                var result = void 0;
                result = tags.slice(0, _this.showAfter);
                result.push(tags.slice(_this.showAfter, tags.length));
                return result;
            }
            else {
                return tags;
            }
        };
    }
    return SummaryTagDirective;
}());

SummaryTagDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoMultiSelectSummaryTag]'
            },] },
];
/** @nocollapse */
SummaryTagDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__multiselect_component__["a" /* MultiSelectComponent */], },
]; };
SummaryTagDirective.propDecorators = {
    'showAfter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ['kendoMultiSelectSummaryTag',] },],
};


/***/ }),
/* 290 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TagListComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * @hidden
 */
var TagListComponent = (function () {
    function TagListComponent() {
        this.removeTag = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    TagListComponent.prototype.tagText = function (tag) {
        return tag[this.textField] ? tag[this.textField] : tag;
    };
    TagListComponent.prototype.deleteTag = function (event, tag) {
        event.preventDefault();
        event.stopImmediatePropagation();
        if (!this.disabled && event.which === 1) {
            this.removeTag.emit(tag);
        }
    };
    TagListComponent.prototype.itemId = function (focused, index) {
        return focused === index ? this.activeId : undefined;
    };
    TagListComponent.prototype.isGroupTag = function (tag) {
        return tag instanceof Array;
    };
    return TagListComponent;
}());

TagListComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-taglist',
                template: "\n        <ul role=\"listbox\" class=\"k-reset\">\n            <li *ngFor=\"let tag of tags; let i = index;\"\n                [ngClass]=\"{'k-button': true, 'k-state-focused': i === focused }\"\n                [attr.id]=\"itemId(focused, i)\"\n            >\n                <ng-template *ngIf=\"isGroupTag(tag); then groupTag else singleTag\"></ng-template>\n                    <ng-template #groupTag>\n                        <span>\n                            <ng-template *ngIf=\"groupTemplate\"\n                                [templateContext]=\"{\n                                templateRef: groupTemplate.templateRef,\n                                $implicit: tag\n                            }\">\n                            </ng-template>\n                            <ng-template [ngIf]=\"!groupTemplate\">{{ tag.length }} {{ tag.length === 1 ? 'item' : 'items' }} selected</ng-template>\n                        </span>\n                    </ng-template>\n                    <ng-template #singleTag>\n                        <span>\n                            <ng-template *ngIf=\"template\"\n                                [templateContext]=\"{\n                                templateRef: template.templateRef,\n                                $implicit: tag\n                            }\">\n                            </ng-template>\n                            <ng-template [ngIf]=\"!template\">{{ tagText(tag) }}</ng-template>\n                        </span>\n                    </ng-template>\n\n                <span aria-label=\"delete\" class=\"k-select\">\n                    <span class=\"k-icon k-i-close\" (mousedown)=\"deleteTag($event, tag)\">\n                    </span>\n                </span>\n            </li>\n        </ul>\n  "
            },] },
];
/** @nocollapse */
TagListComponent.ctorParameters = function () { return []; };
TagListComponent.propDecorators = {
    'tags': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'textField': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focused': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groupTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeId': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'removeTag': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
};


/***/ }),
/* 291 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupTagTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering the grouped tag values.
 * It can only be used with the MultiSelect component.
 *
 * The template context is set to the current MultiSelect.
 * To get a reference to the current grouped data items collection, use the `let-dataItems` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-multiselect kendoSummaryTag [data]="items">
 *    <ng-template kendoMultiSelectGroupTagTemplate let-dataItems>
 *      <span>{{dataItems.length}} item(s) selected</span>
 *    </ng-template>
 *  </kendo-multiselect>
 * `
 * })
 * class AppComponent {
 *   public items: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 *
 * For more examples, refer to the article on [templates]({% slug templates_multiselect %}).
 */
var GroupTagTemplateDirective = (function () {
    function GroupTagTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return GroupTagTemplateDirective;
}());

GroupTagTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoMultiSelectGroupTagTemplate]'
            },] },
];
/** @nocollapse */
GroupTagTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 292 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TagTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:max-line-length */

/**
 * Used for rendering the selected tag value. It can only be used with the MultiSelect component.
 *
 * The template context is set to the current MultiSelect. To get a reference to the current data item, use the `let-dataItem` directive.
 *
 * @example
 * ```ts
 * _@Component({
 * selector: 'my-app',
 * template: `
 *  <kendo-multiselect [data]="items">
 *    <ng-template kendoMultiSelectTagTemplate let-dataItem>
 *      <span>{{dataItem}} option</span>
 *    </ng-template>
 *  </kendo-multiselect>
 * `
 * })
 * class AppComponent {
 *   public items: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
 * }
 * ```
 *
 * For more examples, refer to the article on [templates]({% slug templates_multiselect %}).
 */
var TagTemplateDirective = (function () {
    function TagTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return TagTemplateDirective;
}());

TagTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoMultiSelectTagTemplate]'
            },] },
];
/** @nocollapse */
TagTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
]; };


/***/ }),
/* 293 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TemplateContextDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var TemplateContextDirective = (function () {
    function TemplateContextDirective(viewContainerRef) {
        this.viewContainerRef = viewContainerRef;
    }
    Object.defineProperty(TemplateContextDirective.prototype, "templateContext", {
        set: function (context) {
            if (this.insertedViewRef) {
                this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
                this.insertedViewRef = undefined;
            }
            if (context.templateRef) {
                this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
            }
        },
        enumerable: true,
        configurable: true
    });
    return TemplateContextDirective;
}());

TemplateContextDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[templateContext]' // tslint:disable-line
            },] },
];
/** @nocollapse */
TemplateContextDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"], },
]; };
TemplateContextDirective.propDecorators = {
    'templateContext': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 294 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnGroupComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__column_base__ = __webpack_require__(118);



/**
 * Represents the column-group component of the Kendo UI ExcelExport component.
 */
var ColumnGroupComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ColumnGroupComponent, _super);
    function ColumnGroupComponent(parent) {
        var _this = _super.call(this, parent) || this;
        _this.parent = parent;
        return _this;
    }
    return ColumnGroupComponent;
}(__WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */]));

ColumnGroupComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return ColumnGroupComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-excelexport-column-group',
                template: ""
            },] },
];
/** @nocollapse */
ColumnGroupComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 295 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_header_template_directive__ = __webpack_require__(170);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__group_footer_template_directive__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__footer_template_directive__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__column_base__ = __webpack_require__(118);






/**
 * Represents the columns of the Kendo UI ExcelExport component for Angular.
 */
var ColumnComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ColumnComponent, _super);
    function ColumnComponent(parent) {
        return _super.call(this, parent) || this;
    }
    return ColumnComponent;
}(__WEBPACK_IMPORTED_MODULE_5__column_base__["a" /* ColumnBase */]));

ColumnComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_5__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return ColumnComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-excelexport-column',
                template: ""
            },] },
];
/** @nocollapse */
ColumnComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_5__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };
ColumnComponent.propDecorators = {
    'field': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'cellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'groupHeaderCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'groupFooterCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'footerCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'groupHeaderTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_2__group_header_template_directive__["a" /* GroupHeaderTemplateDirective */],] },],
    'groupFooterTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__group_footer_template_directive__["a" /* GroupFooterTemplateDirective */],] },],
    'footerTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_4__footer_template_directive__["a" /* FooterTemplateDirective */],] },],
};


/***/ }),
/* 296 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExcelExportComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_file_saver__ = __webpack_require__(230);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ooxml_workbook__ = __webpack_require__(298);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_column_base__ = __webpack_require__(118);





/**
 * Configures the settings for the Excel export of the Kendo UI Grid.
 */
var ExcelExportComponent = (function () {
    function ExcelExportComponent(rtl) {
        this.rtl = rtl;
        /**
         * Specifies the file name of the file exported to Excel.
         * @default "Export.xlsx"
         */
        this.fileName = 'Export.xlsx';
        /**
         * @hidden
         */
        this.columns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.saveFile = this.saveFile.bind(this);
    }
    /**
     * Saves the data to Excel.
     *
     * @param exportData - An optional parameter. Can be the data that is to be exported or [`WorkbookOptions`]({% slug api_excel-export_workbookoptions_kendouiforangular %}).
     */
    ExcelExportComponent.prototype.save = function (exportData) {
        this.toDataURL(exportData).then(this.saveFile);
    };
    /**
     * Returns [`WorkbookOptions`]({% slug api_excel-export_workbookoptions_kendouiforangular %}) based on the specified columns and data.
     *
     * @param exportData - The optional data to be exported.
     * @returns {WorkbookOptions} - The workbook options.
     */
    ExcelExportComponent.prototype.workbookOptions = function (exportData) {
        var currentData = this.getExportData(exportData);
        var options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ooxml_workbook__["a" /* workbookOptions */])({
            columns: this.columns,
            data: currentData.data,
            group: currentData.group,
            filterable: this.filterable,
            creator: this.creator,
            date: this.date,
            rtl: this.rtl,
            paddingCellOptions: this.paddingCellOptions,
            headerPaddingCellOptions: this.headerPaddingCellOptions
        });
        return options;
    };
    /**
     * Returns a promise which will be resolved with the file data URI.
     *
     * @param exportData - The optional data or [`WorkbookOptions`]({% slug api_excel-export_workbookoptions_kendouiforangular %}) that are to be used to generate the data URI.
     * @returns {Promise<string>} - The promise that will be resolved by the file data URI.
     */
    ExcelExportComponent.prototype.toDataURL = function (exportData) {
        var options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ooxml_workbook__["c" /* isWorkbookOptions */])(exportData) ?
            exportData :
            this.workbookOptions(exportData);
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ooxml_workbook__["b" /* toDataURL */])(options);
    };
    ExcelExportComponent.prototype.getExportData = function (exportData) {
        var result;
        if (exportData) {
            if (Array.isArray(exportData)) {
                result = {
                    data: exportData
                };
            }
            else {
                result = exportData;
            }
        }
        else {
            result = {
                data: this.data,
                group: this.group
            };
        }
        return result;
    };
    ExcelExportComponent.prototype.saveFile = function (dataURL) {
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_file_saver__["a" /* saveAs */])(dataURL, this.fileName, {
            forceProxy: this.forceProxy,
            proxyURL: this.proxyURL
        });
    };
    return ExcelExportComponent;
}());

ExcelExportComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoExcelExport',
                selector: 'kendo-excelexport',
                template: ""
            },] },
];
/** @nocollapse */
ExcelExportComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
ExcelExportComponent.propDecorators = {
    'fileName': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'creator': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'date': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'forceProxy': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'proxyURL': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'group': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'paddingCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'headerPaddingCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_4__columns_column_base__["a" /* ColumnBase */], { descendants: true },] },],
};


/***/ }),
/* 297 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__excel_export_component__ = __webpack_require__(296);
/* unused harmony reexport ExcelExportComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__excel_export_module__ = __webpack_require__(557);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__excel_export_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_column_base__ = __webpack_require__(118);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__columns_column_base__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_column_component__ = __webpack_require__(295);
/* unused harmony reexport ColumnComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_column_group_component__ = __webpack_require__(294);
/* unused harmony reexport ColumnGroupComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__columns_footer_template_directive__ = __webpack_require__(168);
/* unused harmony reexport FooterTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__columns_group_footer_template_directive__ = __webpack_require__(169);
/* unused harmony reexport GroupFooterTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__columns_group_header_template_directive__ = __webpack_require__(170);
/* unused harmony reexport GroupHeaderTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ooxml_workbook__ = __webpack_require__(298);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_8__ooxml_workbook__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_8__ooxml_workbook__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__progress_kendo_ooxml__ = __webpack_require__(458);
/* unused harmony namespace reexport */












/***/ }),
/* 298 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return workbookOptions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return toDataURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isWorkbookOptions; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__progress_kendo_ooxml__ = __webpack_require__(458);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__exporter_columns__ = __webpack_require__(558);


/**
 * @hidden
 */
var workbookOptions = function (options) {
    var columns = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__exporter_columns__["a" /* toExporterColumns */])(options.columns);
    var exporter = new __WEBPACK_IMPORTED_MODULE_0__progress_kendo_ooxml__["a" /* ExcelExporter */]({
        columns: columns,
        data: options.data,
        filterable: options.filterable,
        groups: options.group,
        paddingCellOptions: options.paddingCellOptions,
        headerPaddingCellOptions: options.headerPaddingCellOptions
    });
    var result = exporter.workbook();
    result.creator = options.creator;
    result.date = options.date;
    result.rtl = options.rtl;
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__exporter_columns__["b" /* destroyColumns */])(columns);
    return result;
};
/**
 * @hidden
 */
var toDataURL = function (options) {
    var workbook = new __WEBPACK_IMPORTED_MODULE_0__progress_kendo_ooxml__["b" /* Workbook */](options);
    return workbook.toDataURL();
};
/**
 * @hidden
 */
var isWorkbookOptions = function (value) {
    return value && value.sheets;
};


/***/ }),
/* 299 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnList; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

var forEachColumn = function (list, callback) {
    list.forEach(function (column) {
        callback(column);
        if (column.children && column.children.length > 1) {
            forEachColumn(column.children.toArray().slice(1), callback);
        }
    });
};
/**
 * @hidden
 */
var ColumnList = (function () {
    function ColumnList(columns) {
        this.columns = columns;
    }
    ColumnList.prototype.forEach = function (callback) {
        forEachColumn(this.columns, callback);
    };
    ColumnList.prototype.filter = function (callback) {
        var result = [];
        forEachColumn(this.columns, function (column) {
            if (callback(column)) {
                result.push(column);
            }
        });
        return result;
    };
    ColumnList.prototype.toArray = function () {
        var result = [];
        forEachColumn(this.columns, function (column) {
            result.push(column);
        });
        return result;
    };
    return ColumnList;
}());

ColumnList.empty = function () { return new ColumnList(new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]()); };


/***/ }),
/* 300 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnsContainer; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__column_group_component__ = __webpack_require__(90);


var reset = function () {
    var lists = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        lists[_i] = arguments[_i];
    }
    var diff = false;
    for (var idx = 0; idx < lists.length; idx++) {
        var _a = lists[idx], list = _a[0], columns = _a[1];
        diff = diff || list.length !== columns.length;
        list.reset(columns);
    }
    return diff;
};
/**
 * @hidden
 */
var ColumnsContainer = (function () {
    function ColumnsContainer(columns) {
        this.columns = columns;
        this.allColumns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.leafColumns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.lockedColumns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.nonLockedColumns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.lockedLeafColumns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.nonLockedLeafColumns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.totalLevels = 0;
        this.changes = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    ColumnsContainer.prototype.refresh = function () {
        var _this = this;
        var currentLevels = this.totalLevels;
        var leafColumns = new Array();
        var lockedLeafColumns = new Array();
        var nonLockedLeafColumns = new Array();
        var lockedColumns = new Array();
        var nonLockedColumns = new Array();
        var allColumns = new Array();
        this.totalLevels = 0;
        this.columns().forEach(function (column) {
            var containerLeafColumns = column.isLocked === true ? lockedLeafColumns : nonLockedLeafColumns;
            var containerColumns = column.isLocked === true ? lockedColumns : nonLockedColumns;
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__column_group_component__["a" /* isColumnGroupComponent */])(column)) {
                containerLeafColumns.push(column);
                leafColumns.push(column);
            }
            containerColumns.push(column);
            allColumns.push(column);
            _this.totalLevels = column.level > _this.totalLevels ? column.level : _this.totalLevels;
        });
        var changes = reset([this.leafColumns, leafColumns], [this.lockedLeafColumns, lockedLeafColumns], [this.nonLockedLeafColumns, nonLockedLeafColumns], [this.lockedColumns, lockedColumns], [this.allColumns, allColumns], [this.nonLockedColumns, nonLockedColumns]) || currentLevels !== this.totalLevels;
        if (changes) {
            this.changes.emit();
        }
        return changes;
    };
    return ColumnsContainer;
}());



/***/ }),
/* 301 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CommandColumnComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rendering_cell_template_directive__ = __webpack_require__(68);




/**
 * Represents the command columns of the Grid.
 *
 * You have to define the content of the column inside an `<ng-template>` tag. The template context
 * is set to the current data item and the following additional fields are passed:
 * - `columnIndex`&mdash;The current column index.
 * - `rowIndex`&mdash;The current row index. If inside a new item row, it will be `-1`.
 * - `dataItem`&mdash;The current data item.
 * - `column`&mdash;The current column instance.
 * - `isNew`&mdash;The state of the current item.
 *
 * Usually, the template contains CRUD command directives such as:
 * - [`EditCommandDirective`]({% slug api_grid_editcommanddirective %})
 * - [`RemoveCommandDirective`]({% slug api_grid_removecommanddirective %})
 * - [`CancelCommandDirective`]({% slug api_grid_cancelcommanddirective %})
 * - [`SaveCommandDirective`]({% slug api_grid_savecommanddirective %})
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *    selector: 'my-app',
 *    template: `
 *        <kendo-grid [data]="gridData">
 *          <kendo-grid-column field="ProductID" title="Product ID" width="120">
 *          </kendo-grid-column>
 *          <kendo-grid-column field="ProductName" title="Product Name">
 *          </kendo-grid-column>
 *          <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
 *          </kendo-grid-column>
 *          <kendo-grid-command-column title="command" width="220">
 *               <ng-template kendoGridCellTemplate>
 *                   <button kendoGridEditCommand class="k-primary">Edit</button>
 *                   <button kendoGridRemoveCommand>Remove</button>
 *               </ng-template>
 *           </kendo-grid-command-column>
 *        </kendo-grid>
 *    `
 * })
 *
 * class AppComponent {
 *    public gridData: any[];
 *
 *    constructor() {
 *        this.gridData = products;
 *    }
 * }
 *
 * const products = [{
 *    "ProductID": 1,
 *    "ProductName": "Chai",
 *    "UnitPrice": 18.0000,
 *    "Discontinued": true
 *  }, {
 *    "ProductID": 2,
 *    "ProductName": "Chang",
 *    "UnitPrice": 19.0000,
 *    "Discontinued": false
 *  }
 * ];
 *
 * ```
 */
var CommandColumnComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](CommandColumnComponent, _super);
    function CommandColumnComponent(parent) {
        var _this = _super.call(this, parent) || this;
        _this.parent = parent;
        return _this;
    }
    Object.defineProperty(CommandColumnComponent.prototype, "templateRef", {
        get: function () {
            return this.template ? this.template.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    return CommandColumnComponent;
}(__WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */]));

CommandColumnComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return CommandColumnComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-grid-command-column',
                template: ""
            },] },
];
/** @nocollapse */
CommandColumnComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };
CommandColumnComponent.propDecorators = {
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__rendering_cell_template_directive__["a" /* CellTemplateDirective */],] },],
};


/***/ }),
/* 302 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExpandStateService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__);

/**
 * @hidden
 */
var ExpandStateService = (function () {
    function ExpandStateService(isInitiallyCollapsed) {
        this.isInitiallyCollapsed = isInitiallyCollapsed;
        this.changes = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Subject__["Subject"]();
        this.rowState = [];
    }
    ExpandStateService.prototype.toggleRow = function (index, dataItem) {
        var rowIndex = this.rowState.indexOf(index);
        var found = rowIndex === -1;
        this.rowState = found ? this.rowState.concat([index]) : this.rowState.slice(0, rowIndex).concat(this.rowState.slice(rowIndex + 1));
        this.changes.next({ dataItem: dataItem, expand: this.isInitiallyCollapsed ? found : !found, index: index });
    };
    ExpandStateService.prototype.isExpanded = function (index) {
        var found = this.rowState.indexOf(index) >= 0;
        return this.isInitiallyCollapsed ? found : !found;
    };
    ExpandStateService.prototype.reset = function () {
        this.rowState = [];
    };
    return ExpandStateService;
}());



/***/ }),
/* 303 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EditingDirectiveBase; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__local_edit_service__ = __webpack_require__(305);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__);



/**
 * @hidden
 */
var EditingDirectiveBase = (function () {
    function EditingDirectiveBase(grid, localDataChangesService) {
        this.grid = grid;
        this.localDataChangesService = localDataChangesService;
        this.defaultEditService = this.createDefaultService();
    }
    Object.defineProperty(EditingDirectiveBase.prototype, "editService", {
        get: function () {
            return this.userEditService || this.defaultEditService;
        },
        // Consider adding support for the dependency injection of the service to allow for specifying a generic service without code.
        // The Input should still be kept.
        /**
         * The edit service that will handle the operations.
         */
        set: function (value) {
            this.userEditService = value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    EditingDirectiveBase.prototype.ngOnInit = function () {
        this.subscriptions = this.grid
            .add.subscribe(this.addHandler.bind(this))
            .add(this.grid.remove.subscribe(this.removeHandler.bind(this)))
            .add(this.grid.cancel.subscribe(this.cancelHandler.bind(this)))
            .add(this.grid.save.subscribe(this.saveHandler.bind(this)))
            .add(this.grid.dataStateChange.subscribe(this.onStateChange.bind(this)));
    };
    /**
     * @hidden
     */
    EditingDirectiveBase.prototype.ngOnDestroy = function () {
        this.subscriptions.unsubscribe();
    };
    EditingDirectiveBase.prototype.createDefaultService = function () {
        return new __WEBPACK_IMPORTED_MODULE_1__local_edit_service__["a" /* LocalEditService */](this.grid, this.localDataChangesService);
    };
    EditingDirectiveBase.prototype.addHandler = function () {
        this.grid.addRow(this.createModel({ isNew: true }));
    };
    EditingDirectiveBase.prototype.saveHandler = function (args) {
        var item = this.saveModel(args);
        if (item) {
            if (args.isNew) {
                this.editService.create(item);
            }
            else {
                this.editService.update(item);
            }
        }
        this.grid.closeRow(args.rowIndex);
    };
    EditingDirectiveBase.prototype.cancelHandler = function (_a) {
        var rowIndex = _a.rowIndex;
        this.closeEditor(rowIndex);
    };
    EditingDirectiveBase.prototype.removeHandler = function (_a) {
        var _this = this;
        var dataItem = _a.dataItem;
        var removeItem = function (shouldRemove) {
            if (shouldRemove) {
                _this.editService.remove(dataItem);
            }
        };
        if (this.removeConfirmation) {
            var result = this.removeConfirmation(dataItem);
            if (result instanceof Promise) {
                result.then(removeItem);
            }
            else if (result instanceof __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"]) {
                result.take(1).subscribe(removeItem);
            }
            else {
                removeItem(result);
            }
        }
        else {
            removeItem(true);
        }
    };
    EditingDirectiveBase.prototype.onStateChange = function () {
        this.closeEditor();
    };
    EditingDirectiveBase.prototype.closeEditor = function (rowIndex) {
        this.grid.closeRow(rowIndex);
    };
    return EditingDirectiveBase;
}());

EditingDirectiveBase.propDecorators = {
    'editService': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'removeConfirmation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 304 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InCellEditingDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__editing_directive_base__ = __webpack_require__(303);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__ = __webpack_require__(66);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils__ = __webpack_require__(309);






/**
 * A directive which encapsulates the editing operations of the Grid when using the in-cell editing with Reactive Forms.
 */
var InCellEditingDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](InCellEditingDirective, _super);
    function InCellEditingDirective(grid, localDataChangesService) {
        var _this = _super.call(this, grid, localDataChangesService) || this;
        _this.grid = grid;
        _this.localDataChangesService = localDataChangesService;
        return _this;
    }
    // Need mixin
    InCellEditingDirective.prototype.createModel = function (args) {
        return this.createFormGroup(args);
    };
    InCellEditingDirective.prototype.saveModel = function (_a) {
        var dataItem = _a.dataItem, formGroup = _a.formGroup, isNew = _a.isNew;
        if (!formGroup.dirty && !isNew) {
            return;
        }
        if (formGroup.valid) {
            this.editService.assignValues(dataItem, formGroup.value);
            return dataItem;
        }
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["a" /* markAllAsTouched */])(formGroup);
    };
    /**
     * @hidden
     */
    InCellEditingDirective.prototype.ngOnInit = function () {
        _super.prototype.ngOnInit.call(this);
        this.subscriptions
            .add(this.grid.cellClick.subscribe(this.cellClickHandler.bind(this)))
            .add(this.grid.cellClose.subscribe(this.cellCloseHandler.bind(this)));
    };
    InCellEditingDirective.prototype.removeHandler = function (args) {
        _super.prototype.removeHandler.call(this, args);
        this.grid.cancelCell();
    };
    InCellEditingDirective.prototype.cellClickHandler = function (args) {
        if (!args.isEdited && args.type !== 'contextmenu') {
            this.grid.editCell(args.rowIndex, args.columnIndex, this.createFormGroup(args));
        }
    };
    InCellEditingDirective.prototype.cellCloseHandler = function (args) {
        var formGroup = args.formGroup, dataItem = args.dataItem;
        if (!formGroup.valid) {
            args.preventDefault();
        }
        else if (formGroup.dirty) {
            this.editService.assignValues(dataItem, formGroup.value);
            this.editService.update(dataItem);
        }
    };
    return InCellEditingDirective;
}(__WEBPACK_IMPORTED_MODULE_2__editing_directive_base__["a" /* EditingDirectiveBase */]));

InCellEditingDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoGridInCellEditing]'
            },] },
];
/** @nocollapse */
InCellEditingDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__grid_component__["a" /* GridComponent */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__["a" /* LocalDataChangesService */], },
]; };
InCellEditingDirective.propDecorators = {
    'createFormGroup': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"], args: ['kendoGridInCellEditing',] },],
};


/***/ }),
/* 305 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalEditService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var LocalEditService = (function () {
    function LocalEditService(grid, localDataChangesService) {
        this.grid = grid;
        this.localDataChangesService = localDataChangesService;
    }
    LocalEditService.prototype.create = function (item) {
        if (this.hasLocalData && this.grid.skip) {
            this.localDataChangesService.data.splice(this.grid.skip, 0, item);
        }
        else {
            this.data.unshift(item);
        }
        this.dataChanged();
    };
    LocalEditService.prototype.update = function (_item) { }; // tslint:disable-line:no-empty
    LocalEditService.prototype.remove = function (item) {
        var data = this.data;
        for (var idx = 0; idx < data.length; idx++) {
            if (item === data[idx]) {
                data.splice(idx, 1);
                this.dataChanged();
                break;
            }
        }
    };
    LocalEditService.prototype.assignValues = function (target, source) {
        Object.assign(target, source);
    };
    LocalEditService.prototype.dataChanged = function () {
        if (this.hasLocalData) {
            this.localDataChangesService.changes.emit();
        }
    };
    Object.defineProperty(LocalEditService.prototype, "hasLocalData", {
        get: function () {
            return Array.isArray(this.localDataChangesService.data);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(LocalEditService.prototype, "data", {
        get: function () {
            if (this.hasLocalData) {
                return this.localDataChangesService.data;
            }
            var data = this.grid.data;
            if (Array.isArray(data)) {
                return data;
            }
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
                throw new Error('The default edit service of the editing directives works only when binding to plain array.' +
                    'Please provide an editService.');
            }
            return [];
        },
        enumerable: true,
        configurable: true
    });
    return LocalEditService;
}());



/***/ }),
/* 306 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ReactiveEditingDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__row_editing_directive_base__ = __webpack_require__(307);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__ = __webpack_require__(66);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils__ = __webpack_require__(309);






/**
 * A directive which encapsulates the editing operations of the Grid when using Reactive Forms.
 */
var ReactiveEditingDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ReactiveEditingDirective, _super);
    function ReactiveEditingDirective(grid, localDataChangesService) {
        var _this = _super.call(this, grid, localDataChangesService) || this;
        _this.grid = grid;
        _this.localDataChangesService = localDataChangesService;
        return _this;
    }
    ReactiveEditingDirective.prototype.createModel = function (args) {
        return this.createFormGroup(args);
    };
    ReactiveEditingDirective.prototype.saveModel = function (_a) {
        var dataItem = _a.dataItem, formGroup = _a.formGroup, isNew = _a.isNew;
        if (!formGroup.dirty && !isNew) {
            return;
        }
        if (formGroup.valid) {
            this.editService.assignValues(dataItem, formGroup.value);
            return dataItem;
        }
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["a" /* markAllAsTouched */])(formGroup);
    };
    return ReactiveEditingDirective;
}(__WEBPACK_IMPORTED_MODULE_2__row_editing_directive_base__["a" /* RowEditingDirectiveBase */]));

ReactiveEditingDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoGridReactiveEditing]'
            },] },
];
/** @nocollapse */
ReactiveEditingDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__grid_component__["a" /* GridComponent */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__["a" /* LocalDataChangesService */], },
]; };
ReactiveEditingDirective.propDecorators = {
    'createFormGroup': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"], args: ['kendoGridReactiveEditing',] },],
};


/***/ }),
/* 307 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RowEditingDirectiveBase; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editing_directive_base__ = __webpack_require__(303);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__local_row_edit_service__ = __webpack_require__(567);



/**
 * @hidden
 */
var RowEditingDirectiveBase = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](RowEditingDirectiveBase, _super);
    function RowEditingDirectiveBase() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * @hidden
     */
    RowEditingDirectiveBase.prototype.ngOnInit = function () {
        _super.prototype.ngOnInit.call(this);
        this.subscriptions
            .add(this.grid.edit.subscribe(this.editHandler.bind(this)));
    };
    RowEditingDirectiveBase.prototype.createDefaultService = function () {
        return new __WEBPACK_IMPORTED_MODULE_2__local_row_edit_service__["a" /* LocalRowEditService */](this.grid, this.localDataChangesService);
    };
    RowEditingDirectiveBase.prototype.addHandler = function () {
        this.closeEditor();
        _super.prototype.addHandler.call(this);
    };
    RowEditingDirectiveBase.prototype.editHandler = function (args) {
        this.closeEditor();
        this.rowIndex = args.rowIndex;
        this.grid.editRow(args.rowIndex, this.createModel(args));
    };
    RowEditingDirectiveBase.prototype.saveHandler = function (args) {
        _super.prototype.saveHandler.call(this, args);
        this.clean();
    };
    RowEditingDirectiveBase.prototype.closeEditor = function (rowIndex) {
        if (rowIndex === void 0) { rowIndex = this.rowIndex; }
        _super.prototype.closeEditor.call(this, rowIndex);
        this.clean();
    };
    RowEditingDirectiveBase.prototype.clean = function () {
        delete this.rowIndex;
    };
    return RowEditingDirectiveBase;
}(__WEBPACK_IMPORTED_MODULE_1__editing_directive_base__["a" /* EditingDirectiveBase */]));



/***/ }),
/* 308 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TemplateEditingDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__row_editing_directive_base__ = __webpack_require__(307);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__ = __webpack_require__(66);





/**
 * A directive which encapsulates the editing operations of the Grid when using the Template-Driven Angular Forms.
 */
var TemplateEditingDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TemplateEditingDirective, _super);
    function TemplateEditingDirective(grid, localDataChangesService) {
        var _this = _super.call(this, grid, localDataChangesService) || this;
        _this.grid = grid;
        _this.localDataChangesService = localDataChangesService;
        return _this;
    }
    TemplateEditingDirective.prototype.editHandler = function (args) {
        _super.prototype.editHandler.call(this, args);
        this.dataItem = args.dataItem;
        this.originalValues = {};
        this.editService.assignValues(this.originalValues, this.dataItem);
    };
    TemplateEditingDirective.prototype.closeEditor = function (rowIndex) {
        if (this.dataItem) {
            this.editService.assignValues(this.dataItem, this.originalValues);
        }
        _super.prototype.closeEditor.call(this, rowIndex);
    };
    TemplateEditingDirective.prototype.createModel = function (args) {
        if (args.isNew) {
            return this.createNewItem();
        }
    };
    TemplateEditingDirective.prototype.saveModel = function (args) {
        return args.dataItem;
    };
    TemplateEditingDirective.prototype.clean = function () {
        _super.prototype.clean.call(this);
        delete this.dataItem;
    };
    return TemplateEditingDirective;
}(__WEBPACK_IMPORTED_MODULE_2__row_editing_directive_base__["a" /* RowEditingDirectiveBase */]));

TemplateEditingDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoGridTemplateEditing]'
            },] },
];
/** @nocollapse */
TemplateEditingDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__grid_component__["a" /* GridComponent */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__editing_local_data_changes_service__["a" /* LocalDataChangesService */], },
]; };
TemplateEditingDirective.propDecorators = {
    'createNewItem': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"], args: ['kendoGridTemplateEditing',] },],
};


/***/ }),
/* 309 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return markAllAsTouched; });
/**
 * @hidden
 */
var markAllAsTouched = function (control) {
    control.markAsTouched();
    if (control.hasOwnProperty('controls')) {
        var controls = control.controls;
        for (var inner in controls) {
            if (controls.hasOwnProperty(inner)) {
                markAllAsTouched(controls[inner]);
            }
        }
    }
};


/***/ }),
/* 310 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExcelComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_file_saver__ = __webpack_require__(230);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_excel_export__ = __webpack_require__(297);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__excel_service__ = __webpack_require__(177);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__excel_export_event__ = __webpack_require__(575);







/* tslint:disable object-literal-sort-keys */
var fetchComponentData = function (component) {
    return {
        data: component.view.map(function (item) { return item; }),
        group: component.group
    };
};
/**
 * Configures the Excel export settings of the Kendo UI Grid.
 */
var ExcelComponent = (function () {
    function ExcelComponent(excelService, rtl) {
        this.rtl = rtl;
        /**
         * Specifies the file name of the exported Excel file.
         * @default "Export.xlsx"
         */
        this.fileName = 'Export.xlsx';
        /**
         * @hidden
         */
        this.columns = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.saveSubscription = excelService.saveToExcel.subscribe(this.save.bind(this));
    }
    ExcelComponent.prototype.ngOnDestroy = function () {
        this.saveSubscription.unsubscribe();
        if (this.dataSubscription) {
            this.dataSubscription.unsubscribe();
        }
    };
    ExcelComponent.prototype.save = function (component) {
        var _this = this;
        var data = (this.fetchData || fetchComponentData)(component);
        var exportData = function (result) {
            delete _this.dataSubscription;
            _this.exportData(component, result);
        };
        if (data instanceof Promise) {
            data.then(exportData);
        }
        else if (data instanceof __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"]) {
            this.dataSubscription = data.take(1).subscribe(exportData);
        }
        else {
            exportData(data);
        }
    };
    ExcelComponent.prototype.exportData = function (component, result) {
        var options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_excel_export__["a" /* workbookOptions */])({
            columns: this.columns.length ? this.columns : component.columns,
            data: result.data,
            group: result.group,
            filterable: this.filterable,
            creator: this.creator,
            date: this.date,
            paddingCellOptions: this.paddingCellOptions,
            headerPaddingCellOptions: this.headerPaddingCellOptions,
            rtl: this.rtl
        });
        var args = new __WEBPACK_IMPORTED_MODULE_6__excel_export_event__["a" /* ExcelExportEvent */](options);
        component.excelExport.emit(args);
        if (!args.isDefaultPrevented()) {
            this.saveFile(options);
        }
    };
    ExcelComponent.prototype.saveFile = function (options) {
        var _this = this;
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_excel_export__["b" /* toDataURL */])(options).then(function (dataURL) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_file_saver__["a" /* saveAs */])(dataURL, _this.fileName, {
                forceProxy: _this.forceProxy,
                proxyURL: _this.proxyURL
            });
        });
    };
    return ExcelComponent;
}());

ExcelComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-excel',
                template: ""
            },] },
];
/** @nocollapse */
ExcelComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_5__excel_service__["a" /* ExcelService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
ExcelComponent.propDecorators = {
    'fileName': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'creator': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'date': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'forceProxy': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'proxyURL': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'fetchData': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'paddingCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'headerPaddingCellOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_excel_export__["c" /* ColumnBase */], { descendants: true },] },],
};


/***/ }),
/* 311 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BooleanFilterComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__ = __webpack_require__(37);
// tslint:disable:no-access-missing-member



/**
 * @hidden
 */
var BooleanFilterComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](BooleanFilterComponent, _super);
    function BooleanFilterComponent(filterService, localization) {
        var _this = _super.call(this, filterService) || this;
        _this.localization = localization;
        /**
         * @hidden
         */
        _this.operator = "eq";
        /**
         * @hidden
         */
        _this.items = [
            { text: _this.localization.get("filterIsTrue"), value: true },
            { text: _this.localization.get("filterIsFalse"), value: false }
        ];
        /**
         * @hidden
         */
        _this.defaultItem = { text: _this.localization.get("filterBooleanAll"), value: null };
        return _this;
    }
    Object.defineProperty(BooleanFilterComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BooleanFilterComponent.prototype, "currentFilter", {
        /**
         * The current filter for the associated column field.
         * @readonly
         * @type {FilterDescriptor}
         */
        get: function () {
            return this.filterByField(this.column.field);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BooleanFilterComponent.prototype, "currentOperator", {
        /**
         * The current filter operator for the associated column field.
         * @readonly
         * @type {string}
         */
        get: function () {
            return this.currentFilter ? this.currentFilter.operator : this.operator;
        },
        enumerable: true,
        configurable: true
    });
    return BooleanFilterComponent;
}(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["a" /* BaseFilterCellComponent */]));

BooleanFilterComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell-boolean',] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 312 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AutoCompleteFilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_column_component__ = __webpack_require__(49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__base_filter_cell_component__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__ = __webpack_require__(3);
// tslint:disable:no-access-missing-member






var stringOperators = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__base_filter_cell_component__["b" /* localizeOperators */])({
    "filterContainsOperator": "contains",
    "filterNotContainsOperator": "doesnotcontain",
    // tslint:disable-next-line:object-literal-sort-keys
    "filterEqOperator": "eq",
    "filterNotEqOperator": "neq",
    "filterStartsWithOperator": "startswith",
    "filterEndsWithOperator": "endswith",
    "filterIsNullOperator": "isnull",
    "filterIsNotNullOperator": "isnotnull",
    "filterIsEmptyOperator": "isempty",
    "filterIsNotEmptyOperator": "isnotempty"
});
/**
 * @hidden
 */
var AutoCompleteFilterCellComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AutoCompleteFilterCellComponent, _super);
    function AutoCompleteFilterCellComponent(filterService, column, localization) {
        var _this = _super.call(this, filterService) || this;
        _this.localization = localization;
        _this.showOperators = true;
        _this.defaultOperators = stringOperators(_this.localization);
        _this.column = column;
        return _this;
    }
    Object.defineProperty(AutoCompleteFilterCellComponent.prototype, "valueField", {
        get: function () {
            return this._valueField ? this._valueField : this.column.field;
        },
        set: function (value) {
            this._valueField = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteFilterCellComponent.prototype, "currentFilter", {
        get: function () {
            return this.filterByField(this.column.field);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AutoCompleteFilterCellComponent.prototype, "currentOperator", {
        get: function () {
            return this.currentFilter ? this.currentFilter.operator : "contains";
        },
        enumerable: true,
        configurable: true
    });
    return AutoCompleteFilterCellComponent;
}(__WEBPACK_IMPORTED_MODULE_4__base_filter_cell_component__["a" /* BaseFilterCellComponent */]));

AutoCompleteFilterCellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-autocomplete-filter-cell',
                template: "\n        <kendo-grid-filter-wrapper-cell\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [showOperators]=\"showOperators\">\n            <kendo-autocomplete\n                kendoFilterInput\n                [data]=\"data\"\n                [valueField]=\"valueField\"\n                [value]=\"currentFilter?.value\">\n            </kendo-autocomplete>\n        </kendo-grid-filter-wrapper-cell>\n    "
            },] },
];
/** @nocollapse */
AutoCompleteFilterCellComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__columns_column_component__["b" /* ColumnComponent */], },
    { type: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
AutoCompleteFilterCellComponent.propDecorators = {
    'showOperators': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'valueField': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 313 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BooleanFilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__boolean_filter_component__ = __webpack_require__(311);





/**
 * Represents a Boolean filter-cell component.
 *
 * @example
 *
 *  ```ts-no-run
 *      <kendo-grid-column field="ProductName" title="Product Name">
 *          <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
 *          <kendo-grid-boolean-filter-cell
 *              [column]="column"
 *              [filter]="filter">
 *          </kendo-grid-boolean-filter-cell>
 *          </ng-template>
 *      </kendo-grid-column>
 *   ```
 */
var BooleanFilterCellComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](BooleanFilterCellComponent, _super);
    function BooleanFilterCellComponent(filterService, localization) {
        return _super.call(this, filterService, localization) || this;
    }
    return BooleanFilterCellComponent;
}(__WEBPACK_IMPORTED_MODULE_4__boolean_filter_component__["a" /* BooleanFilterComponent */]));

BooleanFilterCellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-boolean-filter-cell',
                template: "\n        <kendo-grid-filter-wrapper-cell\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [showOperators]=\"false\"\n            [defaultOperator]=\"operator\">\n            <kendo-dropdownlist\n                kendoFilterInput\n                [defaultItem]=\"defaultItem\"\n                [data]=\"items\"\n                textField=\"text\"\n                valueField=\"value\"\n                [popupSettings]=\"{ width: 'auto' }\"\n                [valuePrimitive]=\"true\"\n                [value]=\"currentFilter?.value\">\n            </kendo-dropdownlist>\n        </kendo-grid-filter-wrapper-cell>\n    "
            },] },
];
/** @nocollapse */
BooleanFilterCellComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 314 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterCellOperatorsComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents a component which accommodates the filter operators.
 */
var FilterCellOperatorsComponent = (function () {
    function FilterCellOperatorsComponent() {
        /**
         * @hidden
         */
        /**
         * The filter operators that will be shown.
         */
        this.operators = [];
        /**
         * Determines if the list of operators will be shown.
         * @type {boolean}
         */
        this.showOperators = true;
        /**
         * Fires when the operator is selected.
         * @type {EventEmitter<string>}
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires when the **Clear** button is clicked.
         * @type {EventEmitter<{}>}
         */
        this.clear = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    Object.defineProperty(FilterCellOperatorsComponent.prototype, "hostClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    FilterCellOperatorsComponent.prototype.onChange = function (dataItem) {
        this.valueChange.emit(dataItem);
    };
    /**
     * @hidden
     */
    FilterCellOperatorsComponent.prototype.clearClick = function () {
        this.clear.emit();
    };
    return FilterCellOperatorsComponent;
}());

FilterCellOperatorsComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-filter-cell-operators',
                template: "\n        <kendo-dropdownlist\n            *ngIf=\"showOperators\"\n            [data]=\"operators\"\n            class=\"k-dropdown-operator\"\n            (valueChange)=\"onChange($event)\"\n            [value]=\"value\"\n            [iconClass]=\"'k-i-filter'\"\n            [valuePrimitive]=\"true\"\n            [textField]=\"'text'\"\n            [popupSettings]=\"{ width: 'auto' }\"\n            [valueField]=\"'value'\">\n        </kendo-dropdownlist>\n        <button [ngClass]=\"{'k-clear-button-visible': showButton}\"\n            type=\"button\"\n            class=\"k-button k-button-icon\"\n            title=\"Clear\"\n            (click)=\"clearClick()\">\n                <span class=\"k-icon k-i-filter-clear\"></span>\n        </button>\n    "
            },] },
];
/** @nocollapse */
FilterCellOperatorsComponent.ctorParameters = function () { return []; };
FilterCellOperatorsComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-filtercell-operator',] },],
    'operators': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'showButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'showOperators': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'clear': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
};


/***/ }),
/* 315 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterCellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);


/**
 * @hidden
 */
var FilterCellComponent = (function () {
    function FilterCellComponent() {
        this._templateContext = {};
    }
    Object.defineProperty(FilterCellComponent.prototype, "templateContext", {
        get: function () {
            this._templateContext.column = this.column;
            this._templateContext.filter = this.filter;
            // tslint:disable-next-line:no-string-literal
            this._templateContext["$implicit"] = this.filter;
            return this._templateContext;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterCellComponent.prototype, "hasTemplate", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.column.filterCellTemplateRef);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterCellComponent.prototype, "isFilterable", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.column) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNullOrEmptyString */])(this.column.field) && this.column.filterable;
        },
        enumerable: true,
        configurable: true
    });
    return FilterCellComponent;
}());

FilterCellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridFilterCell]',
                template: "\n        <ng-template [ngIf]=\"isFilterable\">\n            <ng-container [ngSwitch]=\"hasTemplate\">\n                <ng-container *ngSwitchCase=\"false\">\n                    <ng-container kendoFilterCellHost [column]=\"column\" [filter]=\"filter\"></ng-container>\n                </ng-container>\n                <ng-container *ngSwitchCase=\"true\">\n                    <ng-template\n                        *ngIf=\"column.filterCellTemplateRef\"\n                        [ngTemplateOutlet]=\"column.filterCellTemplateRef\"\n                        [ngTemplateOutletContext]=\"templateContext\">\n                    </ng-template>\n                </ng-container>\n            </ng-container>\n        </ng-template>\n    "
            },] },
];
/** @nocollapse */
FilterCellComponent.ctorParameters = function () { return []; };
FilterCellComponent.propDecorators = {
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 316 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateFilterComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
// tslint:disable:no-access-missing-member




var dateOperators = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["b" /* localizeOperators */])({
    "filterEqOperator": "eq",
    "filterNotEqOperator": "neq",
    // tslint:disable-next-line:object-literal-sort-keys
    "filterAfterOrEqualOperator": "gte",
    "filterAfterOperator": "gt",
    "filterBeforeOrEqualOperator": "lte",
    "filterBeforeOperator": "lt",
    "filterIsNullOperator": "isnull",
    "filterIsNotNullOperator": "isnotnull"
});
/**
 * @hidden
 */
var DateFilterComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DateFilterComponent, _super);
    function DateFilterComponent(filterService, localization) {
        var _this = _super.call(this, filterService) || this;
        _this.localization = localization;
        /**
         * The default filter operator. Defaults to `contains`.
         * @type {string}
         */
        _this.operator = "gte";
        /**
         * Defines the active view that the Calendar initially renders.
         * By default, the active view is `month`.
         *
         * > You have to set `activeView` within the `topView`-`bottomView` range.
         */
        _this.activeView = "month";
        /**
         * Defines the bottommost Calendar view, to which the user can navigate.
         */
        _this.bottomView = "month";
        /**
         * Defines the topmost Calendar view, to which the user can navigate.
         */
        _this.topView = "century";
        _this.defaultOperators = dateOperators(_this.localization);
        return _this;
    }
    Object.defineProperty(DateFilterComponent.prototype, "currentFilter", {
        /**
         * The current filter for the associated column field.
         * @readonly
         * @type {FilterDescriptor}
         */
        get: function () {
            return this.filterByField(this.column.field);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateFilterComponent.prototype, "format", {
        /**
         * Specifies the date format used when the component is not focused.
         * By default, the `column.format` value is used, if set.
         *
         * @readonly
         * @type {string}
         */
        get: function () {
            return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this._format) ? this._format : this.columnFormat;
        },
        /**
         * Specifies the date format used when the component is not focused.
         * By default, the `column.format` value is used, if set.
         */
        set: function (value) {
            this._format = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateFilterComponent.prototype, "columnFormat", {
        get: function () {
            return this.column && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this.column.format) ?
                __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["n" /* extractFormat */])(this.column.format) : "d";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DateFilterComponent.prototype, "currentOperator", {
        /**
         * The current filter operator for the associated column field.
         * @readonly
         * @type {string}
         */
        get: function () {
            return this.currentFilter ? this.currentFilter.operator : this.operator;
        },
        enumerable: true,
        configurable: true
    });
    return DateFilterComponent;
}(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["a" /* BaseFilterCellComponent */]));

DateFilterComponent.propDecorators = {
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'operator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'formatPlaceholder': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'bottomView': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'topView': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 317 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterHostDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);


/**
 * @hidden
 */
var FilterHostDirective = (function () {
    function FilterHostDirective(host, resolver) {
        this.host = host;
        this.resolver = resolver;
    }
    FilterHostDirective.prototype.ngOnInit = function () {
        this.component = this.host.createComponent(this.resolver.resolveComponentFactory(this.componentType()));
        this.initComponent({
            column: this.column,
            filter: this.filter
        });
    };
    FilterHostDirective.prototype.ngOnDestroy = function () {
        if (this.component) {
            this.component.destroy();
            this.component = null;
        }
    };
    FilterHostDirective.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["e" /* anyChanged */])(["column", "filter"], changes)) {
            this.initComponent({
                column: this.column,
                filter: this.filter
            });
        }
    };
    FilterHostDirective.prototype.initComponent = function (_a) {
        var column = _a.column, filter = _a.filter;
        var instance = this.component.instance;
        instance.column = column;
        instance.filter = filter;
    };
    return FilterHostDirective;
}());

FilterHostDirective.propDecorators = {
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 318 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterInputWrapperComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_input_directive__ = __webpack_require__(319);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__base_filter_cell_component__ = __webpack_require__(37);





/**
 * @hidden
 */
var FilterInputWrapperComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](FilterInputWrapperComponent, _super);
    function FilterInputWrapperComponent(filterService) {
        var _this = _super.call(this, filterService) || this;
        _this.operators = [];
        return _this;
    }
    Object.defineProperty(FilterInputWrapperComponent.prototype, "currentFilter", {
        get: function () {
            return this.filterByField(this.column.field);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterInputWrapperComponent.prototype, "currentOperator", {
        get: function () {
            var filter = this.currentFilter;
            if (!this._operator) {
                this._operator = filter ? filter.operator : this.defaultOperator;
            }
            return this._operator;
        },
        set: function (value) {
            this._operator = value;
            if (value === "isnull" || value === "isnotnull" || value === "isempty" || value === "isnotempty") {
                this.applyNoValueFilter(value);
            }
            else if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["o" /* isBlank */])(value) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(this.currentFilter)) {
                this.onChange(this.currentFilter.value);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterInputWrapperComponent.prototype, "defaultOperator", {
        get: function () {
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this._defaultOperator)) {
                return this._defaultOperator;
            }
            else if (this.operators && this.operators.length) {
                return this.operators[0].value;
            }
            return "eq";
        },
        set: function (value) {
            this._defaultOperator = value;
        },
        enumerable: true,
        configurable: true
    });
    FilterInputWrapperComponent.prototype.ngAfterContentInit = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(this.input)) {
            this.changeSubscription = this.input.change.subscribe(this.onChange.bind(this));
        }
    };
    FilterInputWrapperComponent.prototype.ngOnDestroy = function () {
        _super.prototype.ngOnDestroy.call(this);
        if (this.changeSubscription) {
            this.changeSubscription.unsubscribe();
        }
    };
    FilterInputWrapperComponent.prototype.onChange = function (value) {
        this.filterChange(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(value) ?
            this.removeFilter(this.column.field) :
            this.updateFilter({
                field: this.column.field,
                operator: this.currentOperator,
                value: value
            }));
    };
    FilterInputWrapperComponent.prototype.onClear = function () {
        this.onChange(null);
    };
    FilterInputWrapperComponent.prototype.applyNoValueFilter = function (operator) {
        this.filterChange(this.updateFilter({
            field: this.column.field,
            operator: operator,
            value: null
        }));
    };
    FilterInputWrapperComponent.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["d" /* isChanged */])("filter", changes, false)) {
            this._operator = null;
        }
    };
    return FilterInputWrapperComponent;
}(__WEBPACK_IMPORTED_MODULE_4__base_filter_cell_component__["a" /* BaseFilterCellComponent */]));

FilterInputWrapperComponent.propDecorators = {
    'operators': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'input': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_2__filter_input_directive__["a" /* FilterInputDirective */],] },],
    'defaultOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 319 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterInputDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);


/**
 * @hidden
 */
var FilterInputDirective = (function () {
    function FilterInputDirective(valueAccessors) {
        this.change = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.accessor = valueAccessors[0];
    }
    Object.defineProperty(FilterInputDirective.prototype, "value", {
        set: function (value) {
            this.accessor.writeValue(value);
        },
        enumerable: true,
        configurable: true
    });
    FilterInputDirective.prototype.ngOnInit = function () {
        var _this = this;
        this.accessor.registerOnChange(function (x) { return _this.change.emit(x); });
    };
    return FilterInputDirective;
}());

FilterInputDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoFilterInput]'
            },] },
];
/** @nocollapse */
FilterInputDirective.ctorParameters = function () { return [
    { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Self"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],] },] },
]; };
FilterInputDirective.propDecorators = {
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 320 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericFilterComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);

// tslint:disable:no-access-missing-member



var numericOperators = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["b" /* localizeOperators */])({
    "filterEqOperator": "eq",
    "filterNotEqOperator": "neq",
    // tslint:disable-next-line:object-literal-sort-keys
    "filterGteOperator": "gte",
    "filterGtOperator": "gt",
    "filterLteOperator": "lte",
    "filterLtOperator": "lt",
    "filterIsNullOperator": "isnull",
    "filterIsNotNullOperator": "isnotnull"
});
/**
 * Represents a base numeric filter component.
 */
var NumericFilterComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](NumericFilterComponent, _super);
    function NumericFilterComponent(filterService, localization) {
        var _this = _super.call(this, filterService) || this;
        _this.localization = localization;
        /**
         * The default filter operator. Defaults to `eq`.
         * @type {string}
         */
        _this.operator = "eq";
        /**
         * Specifies the value used to increment or decrement the component value.
         * @type {numeric}
         */
        _this.step = 1;
        /**
         * Specifies whether the **Up** and **Down** spin buttons should be rendered.
         * @type {boolean}
         */
        _this.spinners = true;
        _this.defaultOperators = numericOperators(_this.localization);
        return _this;
    }
    Object.defineProperty(NumericFilterComponent.prototype, "format", {
        /**
         * Specifies the number format used when the component is not focused.
         * By default, the `column.format` value is used, if set.
         *
         * @readonly
         * @type {string}
         */
        get: function () {
            return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this._format) ? this._format : this.columnFormat;
        },
        /**
         * Specifies the number format used when the component is not focused.
         * By default, the `column.format` value is used, if set.
         */
        set: function (value) {
            this._format = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericFilterComponent.prototype, "currentFilter", {
        /**
         * The current filter for the associated column field.
         * @readonly
         * @type {FilterDescriptor}
         */
        get: function () {
            return this.filterByField(this.column.field);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericFilterComponent.prototype, "currentOperator", {
        /**
         * The current filter operator for the associated column field.
         * @readonly
         * @type {string}
         */
        get: function () {
            return this.currentFilter ? this.currentFilter.operator : this.operator;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericFilterComponent.prototype, "columnFormat", {
        get: function () {
            return this.column && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this.column.format) ?
                __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["n" /* extractFormat */])(this.column.format) : "n2";
        },
        enumerable: true,
        configurable: true
    });
    return NumericFilterComponent;
}(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["a" /* BaseFilterCellComponent */]));

NumericFilterComponent.propDecorators = {
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'operator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'step': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'spinners': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'decimals': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 321 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AfterEqFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/*
 * Represents the `GreaterOrEqualTo` (**Is after or equal to**) date filter operator.
 */
var AfterEqFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AfterEqFilterOperatorComponent, _super);
    function AfterEqFilterOperatorComponent(localization) {
        return _super.call(this, "after-eq", localization) || this;
    }
    /**
     * @hidden
     */
    AfterEqFilterOperatorComponent.prototype.toJSON = function () {
        return {
            text: this.text,
            value: "gte"
        };
    };
    return AfterEqFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

AfterEqFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return AfterEqFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-after-eq-operator',
                template: ""
            },] },
];
/** @nocollapse */
AfterEqFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 322 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AfterFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/*
 * Represents the `Greater` (**Is after**) date filter operator.
 */
var AfterFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AfterFilterOperatorComponent, _super);
    function AfterFilterOperatorComponent(localization) {
        return _super.call(this, "after", localization) || this;
    }
    /**
     * @hidden
     */
    AfterFilterOperatorComponent.prototype.toJSON = function () {
        return {
            text: this.text,
            value: "gt"
        };
    };
    return AfterFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

AfterFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return AfterFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-after-operator',
                template: ""
            },] },
];
/** @nocollapse */
AfterFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 323 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ContainsFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filter_operator_base__ = __webpack_require__(18);




/**
 * Represents the `Contains` (**Contains**) filter operator.
 */
var ContainsFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ContainsFilterOperatorComponent, _super);
    function ContainsFilterOperatorComponent(localization) {
        return _super.call(this, "contains", localization) || this;
    }
    return ContainsFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_3__filter_operator_base__["a" /* FilterOperatorBase */]));

ContainsFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return ContainsFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-contains-operator',
                template: ""
            },] },
];
/** @nocollapse */
ContainsFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 324 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EndsWithFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filter_operator_base__ = __webpack_require__(18);




/**
 * Represents the `EndsWith` (**Ends with**) string filter operator.
 */
var EndsWithFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](EndsWithFilterOperatorComponent, _super);
    function EndsWithFilterOperatorComponent(localization) {
        return _super.call(this, "endswith", localization) || this;
    }
    return EndsWithFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_3__filter_operator_base__["a" /* FilterOperatorBase */]));

EndsWithFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return EndsWithFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-endswith-operator',
                template: ""
            },] },
];
/** @nocollapse */
EndsWithFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 325 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EqualFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `Equal` (**Is equal to**) filter operator.
 */
var EqualFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](EqualFilterOperatorComponent, _super);
    function EqualFilterOperatorComponent(localization) {
        return _super.call(this, "eq", localization) || this;
    }
    return EqualFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

EqualFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return EqualFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-eq-operator',
                template: ""
            },] },
];
/** @nocollapse */
EqualFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 326 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GreaterFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/*
 * Represents the `Greater` (**Is greater than**) numeric filter operator.
 */
var GreaterFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](GreaterFilterOperatorComponent, _super);
    function GreaterFilterOperatorComponent(localization) {
        return _super.call(this, "gt", localization) || this;
    }
    return GreaterFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

GreaterFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return GreaterFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-gt-operator',
                template: ""
            },] },
];
/** @nocollapse */
GreaterFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 327 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GreaterOrEqualToFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `GreaterOrEqualTo` (**Is greater than or equal to**) numeric filter operator.
 */
var GreaterOrEqualToFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](GreaterOrEqualToFilterOperatorComponent, _super);
    function GreaterOrEqualToFilterOperatorComponent(localization) {
        return _super.call(this, "gte", localization) || this;
    }
    return GreaterOrEqualToFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

GreaterOrEqualToFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return GreaterOrEqualToFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-gte-operator',
                template: ""
            },] },
];
/** @nocollapse */
GreaterOrEqualToFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 328 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IsEmptyFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `IsEmpty` (**Is empty**) filter operator.
 */
var IsEmptyFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](IsEmptyFilterOperatorComponent, _super);
    function IsEmptyFilterOperatorComponent(localization) {
        return _super.call(this, "isempty", localization) || this;
    }
    return IsEmptyFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

IsEmptyFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return IsEmptyFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-isempty-operator',
                template: ""
            },] },
];
/** @nocollapse */
IsEmptyFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 329 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IsNotEmptyFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `IsNotEmpty` (**Is not empty**) filter operator.
 */
var IsNotEmptyFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](IsNotEmptyFilterOperatorComponent, _super);
    function IsNotEmptyFilterOperatorComponent(localization) {
        return _super.call(this, "isnotempty", localization) || this;
    }
    return IsNotEmptyFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

IsNotEmptyFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return IsNotEmptyFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-isnotempty-operator',
                template: ""
            },] },
];
/** @nocollapse */
IsNotEmptyFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 330 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IsNotNullFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `IsNotNull` (**Is not null**) filter operator.
 */
var IsNotNullFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](IsNotNullFilterOperatorComponent, _super);
    function IsNotNullFilterOperatorComponent(localization) {
        return _super.call(this, "isnotnull", localization) || this;
    }
    return IsNotNullFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

IsNotNullFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return IsNotNullFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-isnotnull-operator',
                template: ""
            },] },
];
/** @nocollapse */
IsNotNullFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 331 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IsNullFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `IsNull` (**Is null**) filter operator.
 */
var IsNullFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](IsNullFilterOperatorComponent, _super);
    function IsNullFilterOperatorComponent(localization) {
        return _super.call(this, "isnull", localization) || this;
    }
    return IsNullFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

IsNullFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return IsNullFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-isnull-operator',
                template: ""
            },] },
];
/** @nocollapse */
IsNullFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 332 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LessFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/*
 * Represents the `Less` (**Is less than**) numeric filter operator.
 */
var LessFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LessFilterOperatorComponent, _super);
    function LessFilterOperatorComponent(localization) {
        return _super.call(this, "lt", localization) || this;
    }
    return LessFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

LessFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LessFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-lt-operator',
                template: ""
            },] },
];
/** @nocollapse */
LessFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 333 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LessOrEqualToFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/*
 * Represents the `LessOrEqualTo` (**Is less than or equal to**) numeric filter operator.
 */
var LessOrEqualToFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LessOrEqualToFilterOperatorComponent, _super);
    function LessOrEqualToFilterOperatorComponent(localization) {
        return _super.call(this, "lte", localization) || this;
    }
    return LessOrEqualToFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

LessOrEqualToFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LessOrEqualToFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-lte-operator',
                template: ""
            },] },
];
/** @nocollapse */
LessOrEqualToFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 334 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NotEqualFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `NotEqual` (**Is not equal to**) filter operator.
 */
var NotEqualFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](NotEqualFilterOperatorComponent, _super);
    function NotEqualFilterOperatorComponent(localization) {
        return _super.call(this, "neq", localization) || this;
    }
    return NotEqualFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

NotEqualFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return NotEqualFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-neq-operator',
                template: ""
            },] },
];
/** @nocollapse */
NotEqualFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 335 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DoesNotContainFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `DoesNotContain` (**Does not contain**) filter operator.
 */
var DoesNotContainFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DoesNotContainFilterOperatorComponent, _super);
    function DoesNotContainFilterOperatorComponent(localization) {
        return _super.call(this, "doesnotcontain", localization) || this;
    }
    return DoesNotContainFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

DoesNotContainFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return DoesNotContainFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-not-contains-operator',
                template: ""
            },] },
];
/** @nocollapse */
DoesNotContainFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 336 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StartsWithFilterOperatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__ = __webpack_require__(18);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);




/**
 * Represents the `StartsWith` (**Starts with**) filter operator.
 */
var StartsWithFilterOperatorComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StartsWithFilterOperatorComponent, _super);
    function StartsWithFilterOperatorComponent(localization) {
        return _super.call(this, "startswith", localization) || this;
    }
    return StartsWithFilterOperatorComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */]));

StartsWithFilterOperatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__filter_operator_base__["a" /* FilterOperatorBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return StartsWithFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-filter-startswith-operator',
                template: ""
            },] },
];
/** @nocollapse */
StartsWithFilterOperatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 337 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SharedFilterModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_dropdowns__ = __webpack_require__(556);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_inputs__ = __webpack_require__(374);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_dateinputs__ = __webpack_require__(160);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_popup__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__cell_filter_cell_operators_component__ = __webpack_require__(314);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__filter_input_directive__ = __webpack_require__(319);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__operators_contains_filter_operator_component__ = __webpack_require__(323);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__operators_not_contains_filter_operator_component__ = __webpack_require__(335);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__operators_ends_with_filter_operator_component__ = __webpack_require__(324);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__operators_eq_filter_operator_component__ = __webpack_require__(325);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__operators_is_empty_filter_operator_component__ = __webpack_require__(328);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__operators_is_not_empty_filter_operator_component__ = __webpack_require__(329);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__operators_is_not_null_filter_operator_component__ = __webpack_require__(330);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__operators_isnull_filter_operator_component__ = __webpack_require__(331);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__operators_neq_filter_operator_component__ = __webpack_require__(334);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__operators_starts_with_filter_operator_component__ = __webpack_require__(336);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__operators_gt_filter_operator_component__ = __webpack_require__(326);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__operators_gte_filter_operator_component__ = __webpack_require__(327);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__operators_lt_filter_operator_component__ = __webpack_require__(332);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__operators_lte_filter_operator_component__ = __webpack_require__(333);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__operators_after_filter_operator_component__ = __webpack_require__(322);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__operators_after_eq_filter_operator_component__ = __webpack_require__(321);

























var FILTER_OPERATORS = [
    __WEBPACK_IMPORTED_MODULE_7__cell_filter_cell_operators_component__["a" /* FilterCellOperatorsComponent */],
    __WEBPACK_IMPORTED_MODULE_9__operators_contains_filter_operator_component__["a" /* ContainsFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_10__operators_not_contains_filter_operator_component__["a" /* DoesNotContainFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_11__operators_ends_with_filter_operator_component__["a" /* EndsWithFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_12__operators_eq_filter_operator_component__["a" /* EqualFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_13__operators_is_empty_filter_operator_component__["a" /* IsEmptyFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_14__operators_is_not_empty_filter_operator_component__["a" /* IsNotEmptyFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_15__operators_is_not_null_filter_operator_component__["a" /* IsNotNullFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_16__operators_isnull_filter_operator_component__["a" /* IsNullFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_17__operators_neq_filter_operator_component__["a" /* NotEqualFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_18__operators_starts_with_filter_operator_component__["a" /* StartsWithFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_19__operators_gt_filter_operator_component__["a" /* GreaterFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_20__operators_gte_filter_operator_component__["a" /* GreaterOrEqualToFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_21__operators_lt_filter_operator_component__["a" /* LessFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_22__operators_lte_filter_operator_component__["a" /* LessOrEqualToFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_23__operators_after_filter_operator_component__["a" /* AfterFilterOperatorComponent */],
    __WEBPACK_IMPORTED_MODULE_24__operators_after_eq_filter_operator_component__["a" /* AfterEqFilterOperatorComponent */]
];
var importedModules = [
    __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"],
    __WEBPACK_IMPORTED_MODULE_2__angular_forms__["ReactiveFormsModule"],
    __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormsModule"],
    __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_dropdowns__["a" /* DropDownListModule */],
    __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_dropdowns__["b" /* AutoCompleteModule */],
    __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_inputs__["a" /* InputsModule */],
    __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_dateinputs__["b" /* DatePickerModule */],
    __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_popup__["b" /* PopupModule */]
];
var COMPONENTS = [
    __WEBPACK_IMPORTED_MODULE_8__filter_input_directive__["a" /* FilterInputDirective */]
];
/**
 * @hidden
 */
var SharedFilterModule = (function () {
    function SharedFilterModule() {
    }
    SharedFilterModule.exports = function () {
        return FILTER_OPERATORS.slice();
    };
    return SharedFilterModule;
}());

SharedFilterModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [FILTER_OPERATORS, COMPONENTS],
                exports: [FILTER_OPERATORS, importedModules, COMPONENTS],
                imports: importedModules.slice()
            },] },
];
/** @nocollapse */
SharedFilterModule.ctorParameters = function () { return []; };


/***/ }),
/* 338 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StringFilterComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__ = __webpack_require__(37);
// tslint:disable:no-access-missing-member



var stringOperators = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["b" /* localizeOperators */])({
    "filterEqOperator": "eq",
    "filterNotEqOperator": "neq",
    // tslint:disable-next-line:object-literal-sort-keys
    "filterContainsOperator": "contains",
    "filterNotContainsOperator": "doesnotcontain",
    "filterStartsWithOperator": "startswith",
    "filterEndsWithOperator": "endswith",
    "filterIsNullOperator": "isnull",
    "filterIsNotNullOperator": "isnotnull",
    "filterIsEmptyOperator": "isempty",
    "filterIsNotEmptyOperator": "isnotempty"
});
/**
 * Represents a base string filter component.
 */
var StringFilterComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StringFilterComponent, _super);
    function StringFilterComponent(filterService, localization) {
        var _this = _super.call(this, filterService) || this;
        _this.localization = localization;
        /**
         * The default filter operator. Defaults to `contains`.
         * @type {string}
         */
        _this.operator = "contains";
        _this.defaultOperators = stringOperators(_this.localization);
        return _this;
    }
    Object.defineProperty(StringFilterComponent.prototype, "currentFilter", {
        /**
         * The current filter for the associated column field.
         * @readonly
         * @type {FilterDescriptor}
         */
        get: function () {
            return this.filterByField((this.column || {}).field);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StringFilterComponent.prototype, "currentOperator", {
        /**
         * The current filter operator for the associated column field.
         * @readonly
         * @type {string}
         */
        get: function () {
            return this.currentFilter ? this.currentFilter.operator : this.operator;
        },
        enumerable: true,
        configurable: true
    });
    return StringFilterComponent;
}(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["a" /* BaseFilterCellComponent */]));

StringFilterComponent.propDecorators = {
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'operator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 339 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export count */
/* unused harmony export slice */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupBindingDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__databinding_directive__ = __webpack_require__(175);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_data_query__ = __webpack_require__(75);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_filter_descriptor_differ__ = __webpack_require__(564);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__editing_local_data_changes_service__ = __webpack_require__(66);








var hasGroups = function (items) { return items && items.length && items[0].field && items[0].items; };
var processGroups = function (data, state) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_data_query__["a" /* process */])(data, state).data; };
var removeParentDescriptors = function (parents, owner) { return function (g) { return g.field !== owner.field && !parents.some(function (y) { return y.field === g.field; }); }; };
var findGroup = function (groupIndex, groups) {
    var parents = [];
    return {
        group: groupIndex.split("_").reduce(function (acc, x) {
            var idx = parseInt(x, 10);
            if (acc.items) {
                parents.push(acc);
                return acc.items[idx];
            }
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["a" /* isArray */])(acc) ? acc[idx] : acc;
        }, groups),
        parents: parents
    };
};
var findChildren = function (data, parents) {
    var filters = parents.map(function (p) { return ({ field: p.field, operator: "eq", value: p.value }); });
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_data_query__["b" /* filterBy */])(data, {
        filters: filters,
        logic: "and"
    });
};
/**
 * @hidden
 */
var count = function (groups, includeFooters) {
    if (includeFooters === void 0) { includeFooters = false; }
    return (groups.reduce(function (acc, group) {
        if (!group.skipHeader) {
            acc++;
        }
        if (group.items) {
            var children = count(group.items, includeFooters);
            if (includeFooters && children && !group.hideFooter) {
                acc++;
            }
            acc += children;
        }
        return acc;
    }, 0) // tslint:disable-line:align
    );
};
/**
 * @hidden
 */
var slice = function (groups, skip, take, includeFooters) {
    if (includeFooters === void 0) { includeFooters = false; }
    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["b" /* isPresent */])(take)) {
        return groups;
    }
    var result = [];
    for (var idx = 0, length_1 = groups.length; idx < length_1; idx++) {
        if (take <= 0) {
            break;
        }
        var group = groups[idx];
        var groupItems = group.items;
        var itemCount = count(groupItems, includeFooters);
        if (includeFooters && groupItems.length) {
            itemCount++;
        }
        var skipHeader = skip > 0;
        if (skip) {
            skip--;
            if (itemCount && skip >= itemCount) {
                skip -= itemCount;
                continue;
            }
        }
        if (!skipHeader || itemCount) {
            var items = [];
            var hideFooter = true;
            if (!skipHeader) {
                take--;
            }
            if (take) {
                if (hasGroups(groupItems)) {
                    var children = slice(groupItems, skip, take, includeFooters);
                    items.push.apply(items, children);
                    take -= count(children, includeFooters);
                }
                else {
                    items.push.apply(items, groupItems.slice(skip, Math.min(skip + take, groupItems.length)));
                    take -= items.length;
                }
                if (take && includeFooters) {
                    hideFooter = false;
                    take--;
                }
                skip = 0;
            }
            result.push({
                aggregates: group.aggregates,
                field: group.field,
                hideFooter: hideFooter,
                items: items,
                offset: idx,
                skipHeader: skipHeader,
                value: group.value
            });
        }
    }
    return result;
};
/**
 * A directive which encapsulates the in-memory handling of grouping with virtual scrolling.
 */
var GroupBindingDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](GroupBindingDirective, _super);
    function GroupBindingDirective(grid, localDataChangesService) {
        return _super.call(this, grid, localDataChangesService) || this;
    }
    Object.defineProperty(GroupBindingDirective.prototype, "kendoGridGroupBinding", {
        /**
         * The array of data which will be used to populate the Grid.
         */
        set: function (value) {
            this.groups = null;
            this.grid.resetGroupsState();
            this.data = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupBindingDirective.prototype, "data", {
        /**
         * @hidden
         */
        set: function (value) {
            this.originalData = value || [];
            this.grid.data = this.process(this.state);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupBindingDirective.prototype, "sort", {
        /**
         * Defines the descriptors by which the data will be sorted.
         */
        set: function (value) {
            var clear = this.state.sort !== value;
            this.grid.sort = this.state.sort = value;
            if (clear) {
                this.groups = null;
                this.grid.resetGroupsState();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupBindingDirective.prototype, "filter", {
        /**
         * Defines the descriptor by which the data will be filtered.
         */
        set: function (value) {
            var clear = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__common_filter_descriptor_differ__["a" /* diffFilters */])(this.state.filter, value);
            if (clear) {
                this.state.filter = value;
                this.grid.filter = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["b" /* isPresent */])(value) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__common_filter_descriptor_differ__["b" /* cloneFilters */])(value) : value;
                this.groups = null;
                this.grid.resetGroupsState();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupBindingDirective.prototype, "group", {
        /**
         * Defines the descriptors by which the data will be grouped.
         */
        set: function (value) {
            var clear = this.state.group !== value;
            this.grid.group = this.state.group = value;
            if (clear) {
                this.groups = null;
                this.grid.resetGroupsState();
                this.skip = 0;
            }
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    GroupBindingDirective.prototype.ngOnInit = function () {
        _super.prototype.ngOnInit.call(this);
        this.grid.groupExpand.subscribe(this.groupExpand.bind(this));
        this.grid.groupCollapse.subscribe(this.groupCollapse.bind(this));
    };
    GroupBindingDirective.prototype.groupExpand = function (_a) {
        var groupIndex = _a.groupIndex;
        this.grid.expandGroupChildren(groupIndex);
        var _b = findGroup(groupIndex, this.groups), group = _b.group, parents = _b.parents;
        if (!group.items.length) {
            var descriptors = this.state.group.filter(removeParentDescriptors(parents, group));
            var children = findChildren(this.originalData, parents.concat(group));
            group.items = processGroups(children, {
                filter: this.state.filter,
                group: descriptors,
                sort: this.state.sort
            });
        }
        this.grid.data = this.dataResult(this.state.skip, this.state.take);
    };
    GroupBindingDirective.prototype.groupCollapse = function (_a) {
        var groupIndex = _a.groupIndex;
        var group = findGroup(groupIndex, this.groups).group;
        if (group) {
            group.items = [];
        }
        this.grid.data = this.dataResult(this.state.skip, this.state.take);
    };
    GroupBindingDirective.prototype.process = function (state) {
        if (state.group && state.group.length) {
            return this.processGroups(state);
        }
        else {
            this.groups = null;
        }
        return _super.prototype.process.call(this, state);
    };
    GroupBindingDirective.prototype.processGroups = function (state) {
        if (!this.groups || !this.groups.length) {
            this.groups = processGroups(this.originalData, {
                filter: state.filter,
                group: state.group,
                sort: state.sort
            });
        }
        return this.dataResult(state.skip, state.take);
    };
    GroupBindingDirective.prototype.dataResult = function (skip, take) {
        var includeFooters = this.grid.showGroupFooters;
        return {
            data: slice(this.groups, skip, take, includeFooters),
            total: count(this.groups, includeFooters)
        };
    };
    GroupBindingDirective.prototype.applyState = function (_a) {
        var skip = _a.skip, take = _a.take, sort = _a.sort, group = _a.group, filter = _a.filter;
        this.skip = skip;
        this.state.take = take;
        // this.pageSize = take; // do need to update take as the process with slice correctly
        this.sort = sort;
        this.group = group;
        this.filter = filter;
    };
    return GroupBindingDirective;
}(__WEBPACK_IMPORTED_MODULE_2__databinding_directive__["a" /* DataBindingDirective */]));

GroupBindingDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{ selector: '[kendoGridGroupBinding]' },] },
];
/** @nocollapse */
GroupBindingDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__grid_component__["a" /* GridComponent */], },
    { type: __WEBPACK_IMPORTED_MODULE_7__editing_local_data_changes_service__["a" /* LocalDataChangesService */], },
]; };
GroupBindingDirective.propDecorators = {
    'kendoGridGroupBinding': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"], args: ["kendoGridGroupBinding",] },],
    'sort': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'group': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 340 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BrowserSupportService; });
var getDocument = function () { return typeof document !== 'undefined' ? document : {}; };
/**
 * @hidden
 */
var BrowserSupportService = (function () {
    function BrowserSupportService() {
    }
    Object.defineProperty(BrowserSupportService.prototype, "scrollbarWidth", {
        get: function () {
            var document = getDocument();
            if (!this.scrollbar && document && document.createElement) {
                var div = document.createElement("div");
                div.style.cssText = "overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block";
                div.innerHTML = "&nbsp;";
                document.body.appendChild(div);
                this.scrollbar = div.offsetWidth - div.scrollWidth;
                document.body.removeChild(div);
            }
            return this.scrollbar;
        },
        enumerable: true,
        configurable: true
    });
    return BrowserSupportService;
}());



/***/ }),
/* 341 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResizableContainerDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__resize_service__ = __webpack_require__(191);



/**
 * @hidden
 */
var ResizableContainerDirective = (function () {
    function ResizableContainerDirective(el, renderer, resizeService, grid) {
        this.el = el;
        this.renderer = renderer;
        this.resizeService = resizeService;
        this.grid = grid;
        this.enabled = false;
    }
    Object.defineProperty(ResizableContainerDirective.prototype, "lockedWidth", {
        set: function (value) {
            this._lockedWidth = value;
            if (this.enabled) {
                this.attachResize();
                this.resize();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ResizableContainerDirective.prototype, "kendoGridResizableContainer", {
        set: function (enabled) {
            var refresh = enabled !== this.enabled;
            this.enabled = enabled;
            if (refresh) {
                this.attachResize();
                this.resize();
            }
        },
        enumerable: true,
        configurable: true
    });
    ResizableContainerDirective.prototype.ngOnDestroy = function () {
        if (this.resizeSubscription) {
            this.resizeSubscription.unsubscribe();
        }
    };
    ResizableContainerDirective.prototype.attachResize = function () {
        if (this.resizeSubscription && !this.enabled) {
            this.resizeSubscription.unsubscribe();
            this.resizeSubscription = null;
        }
        if (!this.resizeSubscription && this.enabled) {
            this.resizeSubscription = this.resizeService.changes.subscribe(this.resize.bind(this));
        }
    };
    ResizableContainerDirective.prototype.resize = function () {
        if (this.grid && this.grid.wrapper) {
            var containerElement = this.grid.wrapper.nativeElement;
            var width = this.enabled ? Math.max(containerElement.clientWidth - this._lockedWidth, 0) + "px" : "";
            this.renderer.setStyle(this.el.nativeElement, "width", width);
        }
    };
    return ResizableContainerDirective;
}());

ResizableContainerDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridResizableContainer]'
            },] },
];
/** @nocollapse */
ResizableContainerDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__resize_service__["a" /* ResizeService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__grid_component__["a" /* GridComponent */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };
ResizableContainerDirective.propDecorators = {
    'lockedWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ['lockedWidth',] },],
    'kendoGridResizableContainer': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 342 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return syncRowsHeight; });
var set = function (value) { return function (pair) { return pair.forEach(function (x) { return x.style.height = value; }); }; };
var clearHeight = function (pairs) { return pairs
    .filter(function (_a) {
    var left = _a[0], right = _a[1];
    return left.style.height || right.style.height;
})
    .forEach(set("")); };
var zip = function (arr1, arr2) {
    var result = [];
    for (var idx = 0, len = arr1.length; idx < len; idx++) {
        if (!arr2[idx]) {
            break;
        }
        result.push([arr1[idx], arr2[idx]]);
    }
    return result;
};
var setHeight = function (heights) { return function (row, idx) { return set(heights[idx] + 1 + "px")(row); }; };
var getHeights = function (rows) { return rows.map(function (_a) {
    var left = _a[0], right = _a[1];
    var height = left.offsetHeight;
    var offsetHeight2 = right.offsetHeight;
    if (height < offsetHeight2) {
        return offsetHeight2;
    }
    return height;
}); };
/**
 * @hidden
 */
var syncRowsHeight = function (table1, table2) {
    var activeElement = document.activeElement;
    var rows = zip(table1.rows, table2.rows);
    clearHeight(rows);
    var heights = getHeights(rows);
    [table1, table2].forEach(function (x) { return x.style.display = 'none'; });
    rows.forEach(setHeight(heights));
    [table1, table2].forEach(function (x) { return x.style.display = ''; });
    if (document.activeElement !== activeElement &&
        (table1.contains(activeElement) || table2.contains(activeElement))) {
        activeElement.focus();
    }
};


/***/ }),
/* 343 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(344);




/**
 * Custom component messages override default component messages.
 */
var CustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](CustomMessagesComponent, _super);
    function CustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(CustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return CustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

CustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return CustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-grid-messages',
                template: ""
            },] },
];
/** @nocollapse */
CustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 344 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'groupPanelEmpty': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'noRecords': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerFirstPage': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerLastPage': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerPreviousPage': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerNextPage': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerPage': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerItemsPerPage': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerOf': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'pagerItems': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterEqOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterNotEqOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterIsNullOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterIsNotNullOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterIsEmptyOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterIsNotEmptyOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterStartsWithOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterContainsOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterNotContainsOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterEndsWithOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterGteOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterGtOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterLteOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterLtOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterIsTrue': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterIsFalse': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterBooleanAll': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterAfterOrEqualOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterAfterOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterBeforeOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'filterBeforeOrEqualOperator': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 345 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerInfoComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_element_component__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pager_context_service__ = __webpack_require__(44);

// tslint:disable:no-access-missing-member




/**
 * Displays information about the current page and the total number of records.
 */
var PagerInfoComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PagerInfoComponent, _super);
    function PagerInfoComponent(localization, cd, pagerContext) {
        var _this = _super.call(this, localization, pagerContext) || this;
        _this.cd = cd;
        _this.pagerContext = pagerContext;
        return _this;
    }
    Object.defineProperty(PagerInfoComponent.prototype, "maxItems", {
        /**
         * @hidden
         *
         * @readonly
         * @type {number}
         * @memberOf PagerInfoComponent
         */
        get: function () {
            return Math.min(this.currentPage * this.pageSize, this.total);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerInfoComponent.prototype, "currentPageText", {
        /**
         * @hidden
         *
         * @readonly
         * @type {number}
         * @memberOf PagerInfoComponent
         */
        get: function () {
            return this.total ?
                (this.currentPage - 1) * this.pageSize + 1 :
                0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerInfoComponent.prototype, "classes", {
        /**
         * @hidden
         *
         * @readonly
         * @type {boolean}
         * @memberOf PagerInfoComponent
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    PagerInfoComponent.prototype.onChanges = function (_a) {
        var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;
        this.total = total;
        this.skip = skip;
        this.pageSize = pageSize;
        this.cd.markForCheck();
    };
    return PagerInfoComponent;
}(__WEBPACK_IMPORTED_MODULE_2__pager_element_component__["a" /* PagerElementComponent */]));

PagerInfoComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-pager-info',
                template: "{{currentPageText}} - {{maxItems}} {{textFor('pagerOf')}} {{total}} {{textFor('pagerItems')}}"
            },] },
];
/** @nocollapse */
PagerInfoComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_4__pager_context_service__["a" /* PagerContextService */], },
]; };
PagerInfoComponent.propDecorators = {
    'classes': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ["class.k-pager-info",] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ["class.k-label",] },],
};


/***/ }),
/* 346 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerInputComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_element_component__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pager_context_service__ = __webpack_require__(44);

// tslint:disable:no-access-missing-member




/**
 * Displays an input element which allows typing and rendition of a page number.
 */
var PagerInputComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PagerInputComponent, _super);
    function PagerInputComponent(localization, pagerContext, cd) {
        var _this = _super.call(this, localization, pagerContext) || this;
        _this.pagerContext = pagerContext;
        _this.cd = cd;
        return _this;
    }
    /**
     * @hidden
     *
     * @param {string} value
     *
     * @memberOf PagerInputComponent
     */
    PagerInputComponent.prototype.onInputChange = function (value) {
        var page = parseInt(value, 10);
        if (isNaN(page) || page < 1 || page > this.totalPages) {
            page = this.currentPage;
        }
        this.changePage(page - 1);
    };
    PagerInputComponent.prototype.onChanges = function (_a) {
        var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;
        this.total = total;
        this.skip = skip;
        this.pageSize = pageSize;
        this.cd.markForCheck();
    };
    return PagerInputComponent;
}(__WEBPACK_IMPORTED_MODULE_2__pager_element_component__["a" /* PagerElementComponent */]));

PagerInputComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-pager-input',
                template: "\n     <span [ngClass]=\"{'k-pager-input': true, 'k-label': true}\">\n        {{textFor('pagerPage')}}\n        <input [class.k-textbox]=\"true\" [value]=\"currentPage\" #inputPager (change)=\"onInputChange(inputPager.value)\" />\n        {{textFor('pagerOf')}} {{totalPages}}\n     </span>\n    "
            },] },
];
/** @nocollapse */
PagerInputComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__pager_context_service__["a" /* PagerContextService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectorRef"], },
]; };


/***/ }),
/* 347 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerNextButtonsComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_context_service__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pager_element_component__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__ = __webpack_require__(3);

// tslint:disable: no-access-missing-member




/**
 * Displays buttons for navigating to the next and the last page.
 */
var PagerNextButtonsComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PagerNextButtonsComponent, _super);
    function PagerNextButtonsComponent(localization, pagerContext, cd) {
        var _this = _super.call(this, localization, pagerContext) || this;
        _this.cd = cd;
        return _this;
    }
    Object.defineProperty(PagerNextButtonsComponent.prototype, "disabled", {
        /**
         * @hidden
         *
         * @readonly
         * @type {boolean}
         * @memberOf PagerNextButtonsComponent
         */
        get: function () {
            return this.currentPage === this.totalPages || !this.total;
        },
        enumerable: true,
        configurable: true
    });
    PagerNextButtonsComponent.prototype.onChanges = function (_a) {
        var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;
        this.total = total;
        this.skip = skip;
        this.pageSize = pageSize;
        this.cd.markForCheck();
    };
    return PagerNextButtonsComponent;
}(__WEBPACK_IMPORTED_MODULE_3__pager_element_component__["a" /* PagerElementComponent */]));

PagerNextButtonsComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-pager-next-buttons',
                template: "\n        <a href=\"#\"\n            [title]=\"textFor('pagerNextPage')\"\n            (click)=\"currentPage !== totalPages ? changePage(currentPage) : false\"\n            [ngClass]=\"{\n                'k-link': true,\n                'k-pager-nav': true,\n                'k-state-disabled': disabled,\n                '': true\n            }\">\n            <span [attr.aria-label]=\"textFor('pagerNextPage')\"\n                [ngClass]=\"{\n                    'k-icon':true,\n                    'k-i-arrow-e': true\n                }\">\n            </span>\n        </a>\n        <a href=\"#\"\n            [title]=\"textFor('pagerLastPage')\"\n            (click)=\"currentPage !== totalPages ? changePage(totalPages-1) : false\"\n            [ngClass]=\"{\n                'k-link': true,\n                'k-pager-nav': true,\n                'k-state-disabled': disabled,\n                'k-pager-last': true\n            }\">\n            <span [attr.aria-label]=\"textFor('pagerLastPage')\"\n                [ngClass]=\"{\n                    'k-icon':true,\n                    'k-i-seek-e': true\n                }\">\n            </span>\n        </a>\n    "
            },] },
];
/** @nocollapse */
PagerNextButtonsComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__pager_context_service__["a" /* PagerContextService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectorRef"], },
]; };


/***/ }),
/* 348 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerNumericButtonsComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_context_service__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pager_element_component__ = __webpack_require__(67);

// tslint:disable:no-access-missing-member




/**
 * Displays numeric buttons to enable navigation between the pages.
 */
var PagerNumericButtonsComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PagerNumericButtonsComponent, _super);
    function PagerNumericButtonsComponent(localization, cd, pagerContext) {
        var _this = _super.call(this, localization, pagerContext) || this;
        _this.cd = cd;
        _this.pagerContext = pagerContext;
        return _this;
    }
    Object.defineProperty(PagerNumericButtonsComponent.prototype, "buttons", {
        /**
         * @hidden
         *
         * @readonly
         * @type {number[]}
         * @memberOf PagerNumericButtonsComponent
         */
        get: function () {
            var result = [];
            for (var idx = this.start; idx <= this.end; idx++) {
                result.push(idx);
            }
            return result;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerNumericButtonsComponent.prototype, "end", {
        /**
         * @hidden
         */
        get: function () {
            return Math.min((this.start + this.buttonCount) - 1, this.totalPages);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerNumericButtonsComponent.prototype, "start", {
        /**
         * @hidden
         */
        get: function () {
            var page = this.currentPage;
            var buttonCount = this.buttonCount;
            if (page > buttonCount) {
                var reminder = (page % buttonCount);
                return (reminder === 0) ? (page - buttonCount) + 1 : (page - reminder) + 1;
            }
            return 1;
        },
        enumerable: true,
        configurable: true
    });
    PagerNumericButtonsComponent.prototype.onChanges = function (_a) {
        var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;
        this.total = total;
        this.skip = skip;
        this.pageSize = pageSize;
        this.cd.markForCheck();
    };
    return PagerNumericButtonsComponent;
}(__WEBPACK_IMPORTED_MODULE_4__pager_element_component__["a" /* PagerElementComponent */]));

PagerNumericButtonsComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-pager-numeric-buttons',
                template: "\n       <ul [ngClass]=\"{'k-pager-numbers': true, 'k-reset': true}\">\n            <li *ngIf=\"start > 1\"><a class=\"k-link\" href=\"#\" (click)=\"changePage(start - 2)\">...</a></li>\n            <li *ngFor=\"let num of buttons\">\n                <a href=\"#\"\n                    [ngClass]=\"{'k-link': true, 'k-state-selected':currentPage == num}\"\n                    (click)=\"changePage(num - 1)\">\n                    {{num}}\n                </a>\n            </li>\n            <li *ngIf=\"end < totalPages\"><a class=\"k-link\" href=\"#\" (click)=\"changePage(end)\">...</a></li>\n        </ul>\n    "
            },] },
];
/** @nocollapse */
PagerNumericButtonsComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__pager_context_service__["a" /* PagerContextService */], },
]; };
PagerNumericButtonsComponent.propDecorators = {
    'buttonCount': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 349 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerPageSizesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_element_component__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pager_context_service__ = __webpack_require__(44);

// tslint:disable:no-access-missing-member




/**
 * Displays a drop-down list for the page size selection.
 */
var PagerPageSizesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PagerPageSizesComponent, _super);
    function PagerPageSizesComponent(localization, cd, pagerContext) {
        var _this = _super.call(this, localization, pagerContext) || this;
        _this.cd = cd;
        _this.pagerContext = pagerContext;
        return _this;
    }
    Object.defineProperty(PagerPageSizesComponent.prototype, "classes", {
        /**
         * @hidden
         *
         * @readonly
         * @type {boolean}
         * @memberOf PagerPageSizesComponent
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerPageSizesComponent.prototype, "showInitialPageSize", {
        /**
         * @hidden
         *
         * @readonly
         * @type {boolean}
         * @memberOf PagerPageSizesComponent
         */
        get: function () {
            var _this = this;
            return this.pageSizes
                .filter(function (num) { return num === Number(_this.pageSize); })
                .length === 0;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     *
     * @param {*} value
     *
     * @memberOf PagerPageSizesComponent
     */
    PagerPageSizesComponent.prototype.pageSizeChange = function (value) {
        this.pageSize = parseInt(value, 10);
        this.pagerContext.changePageSize(this.pageSize);
    };
    PagerPageSizesComponent.prototype.onChanges = function (_a) {
        var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;
        this.total = total;
        this.skip = skip;
        this.pageSize = pageSize;
        this.cd.markForCheck();
    };
    return PagerPageSizesComponent;
}(__WEBPACK_IMPORTED_MODULE_2__pager_element_component__["a" /* PagerElementComponent */]));

PagerPageSizesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-pager-page-sizes',
                template: "\n        <select #select (change)=\"pageSizeChange(select.value)\">\n            <option *ngIf=\"showInitialPageSize\" [value]=\"pageSize\">{{pageSize}}</option>\n            <option *ngFor=\"let page of pageSizes\" [value]=\"page\" [selected]=\"page === pageSize ? true : undefined\">\n                {{page}}\n            </option>\n        </select>\n        {{textFor('pagerItemsPerPage')}}\n    "
            },] },
];
/** @nocollapse */
PagerPageSizesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_4__pager_context_service__["a" /* PagerContextService */], },
]; };
PagerPageSizesComponent.propDecorators = {
    'pageSizes': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'classes': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ["class.k-pager-sizes",] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ["class.k-label",] },],
};


/***/ }),
/* 350 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerPrevButtonsComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_context_service__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pager_element_component__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__ = __webpack_require__(3);

// tslint:disable:no-access-missing-member




/**
 * Displays buttons for navigating to the first and the previous page.
 */
var PagerPrevButtonsComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PagerPrevButtonsComponent, _super);
    function PagerPrevButtonsComponent(localization, pagerContext, cd) {
        var _this = _super.call(this, localization, pagerContext) || this;
        _this.cd = cd;
        return _this;
    }
    Object.defineProperty(PagerPrevButtonsComponent.prototype, "disabled", {
        /**
         * @hidden
         *
         * @readonly
         * @type {boolean}
         * @memberOf PagerPrevButtonsComponent
         */
        get: function () {
            return this.currentPage === 1 || !this.total;
        },
        enumerable: true,
        configurable: true
    });
    PagerPrevButtonsComponent.prototype.onChanges = function (_a) {
        var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;
        this.total = total;
        this.skip = skip;
        this.pageSize = pageSize;
        this.cd.markForCheck();
    };
    return PagerPrevButtonsComponent;
}(__WEBPACK_IMPORTED_MODULE_3__pager_element_component__["a" /* PagerElementComponent */]));

PagerPrevButtonsComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-pager-prev-buttons',
                template: "\n        <a href=\"#\"\n            [title]=\"textFor('pagerFirstPage')\"\n            (click)=\"currentPage !== 1 ? changePage(0) : false\"\n            [ngClass]=\"{\n                'k-link': true,\n                'k-pager-nav': true,\n                'k-state-disabled': disabled,\n                'k-pager-first': true\n            }\">\n            <span [attr.aria-label]=\"textFor('pagerFirstPage')\"\n                [ngClass]=\"{\n                    'k-icon':true,\n                    'k-i-seek-w': true\n                }\">\n            </span>\n        </a>\n        <a href=\"#\"\n            [title]=\"textFor('pagerPreviousPage')\"\n            (click)=\"currentPage !== 1 ? changePage(currentPage-2) : false\"\n            [ngClass]=\"{\n                'k-link': true,\n                'k-pager-nav': true,\n                'k-state-disabled': disabled,\n                '': true\n            }\">\n            <span [attr.aria-label]=\"textFor('pagerPreviousPage')\"\n                [ngClass]=\"{\n                    'k-icon':true,\n                    'k-i-arrow-w': true\n                }\">\n            </span>\n        </a>\n    "
            },] },
];
/** @nocollapse */
PagerPrevButtonsComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__pager_context_service__["a" /* PagerContextService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ChangeDetectorRef"], },
]; };


/***/ }),
/* 351 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * Represents the pager template which helps to customize the pager appearance in the Kendo UI Grid.
 *
 * To define a pager template, nest a `<ng-template>` tag with the `kendoPagerTemplate` directive inside `<kendo-grid>`.
 *
 * The template context provides the following fields:
 * - `pageSize`&mdash;The value of the current `pageSize`.
 * - `currentPage`&mdash;The index of the displayed page.
 * - `skip`&mdash;The current skip value.
 * - `total`&mdash;The total number of records.
 * - `totalPages`&mdash;The total number of available pages.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *      <kendo-grid
 *        [kendoGridBinding]="gridData"
 *        [pageSize]="1"
 *        [pageable]="true"
 *      >
 *       <kendo-grid-column field="ProductID" title="ID" width="40">
 *       </kendo-grid-column>
 *       <kendo-grid-column field="ProductName" title="Name" width="250">
 *       </kendo-grid-column>
 *       <kendo-grid-column field="UnitPrice" title="Price" width="80" format="{0:c}">
 *       </kendo-grid-column>
 *
 *       <ng-template kendoPagerTemplate let-totalPages="totalPages" let-currentPage="currentPage">
 *          <kendo-pager-prev-buttons></kendo-pager-prev-buttons>
 *          <kendo-pager-numeric-buttons [buttonCount]="10"></kendo-pager-numeric-buttons>
 *          <kendo-pager-next-buttons></kendo-pager-next-buttons>
 *          <kendo-pager-info></kendo-pager-info>
 *       </ng-template>
 *
 *    </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public gridData = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000,
 *         "Discontinued": false
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000,
 *         "Discontinued": true
 *       }
 *     ];
 * }
 *
 * ```
 */
var PagerTemplateDirective = (function () {
    function PagerTemplateDirective(templateRef) {
        this.templateRef = templateRef;
    }
    return PagerTemplateDirective;
}());

PagerTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoPagerTemplate]'
            },] },
];
/** @nocollapse */
PagerTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 352 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pager_settings__ = __webpack_require__(596);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pager_context_service__ = __webpack_require__(44);




/**
 * @hidden
 */
var PagerComponent = (function () {
    function PagerComponent(pagerContext) {
        this.pagerContext = pagerContext;
        this.total = 0;
        this.skip = 1;
        this.pageChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.settings = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__pager_settings__["a" /* normalize */])({});
    }
    Object.defineProperty(PagerComponent.prototype, "options", {
        set: function (value) {
            this.settings = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__pager_settings__["a" /* normalize */])(value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerComponent.prototype, "pagerWrapClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerComponent.prototype, "gridPagerClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerComponent.prototype, "widgetClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerComponent.prototype, "totalPages", {
        get: function () {
            return Math.ceil((this.total || 0) / this.pageSize);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PagerComponent.prototype, "currentPage", {
        get: function () {
            return Math.floor((this.skip || 0) / this.pageSize) + 1;
        },
        enumerable: true,
        configurable: true
    });
    PagerComponent.prototype.ngOnInit = function () {
        this.pageChangeSubscription = this.pagerContext.pageChange.subscribe(this.changePage.bind(this));
    };
    PagerComponent.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["e" /* anyChanged */])(["pageSize", "skip", "total"], changes, false)) {
            this.pagerContext.notifyChanges({
                pageSize: this.pageSize,
                skip: this.skip,
                total: this.total
            });
        }
    };
    PagerComponent.prototype.ngOnDestroy = function () {
        if (this.pageChangeSubscription) {
            this.pageChangeSubscription.unsubscribe();
        }
    };
    PagerComponent.prototype.changePage = function (event) {
        this.pageChange.emit(event);
    };
    return PagerComponent;
}());

PagerComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-pager',
                template: "\n        <ng-template\n            [ngIf]=\"template?.templateRef\"\n            [templateContext]=\"{\n                templateRef: template?.templateRef,\n                totalPages: totalPages,\n                total: total,\n                skip: skip,\n                pageSize: pageSize,\n                currentPage: currentPage\n            }\">\n        </ng-template>\n        <ng-container *ngIf=\"!template?.templateRef\">\n            <kendo-pager-prev-buttons *ngIf=\"settings.previousNext\"></kendo-pager-prev-buttons>\n            <kendo-pager-numeric-buttons\n                *ngIf=\"settings.type === 'numeric'\"\n                [buttonCount]=\"settings.buttonCount\">\n            </kendo-pager-numeric-buttons>\n            <kendo-pager-input *ngIf=\"settings.type === 'input'\"></kendo-pager-input>\n            <kendo-pager-next-buttons *ngIf=\"settings.previousNext\"></kendo-pager-next-buttons>\n            <kendo-pager-info *ngIf='settings.info'></kendo-pager-info>\n            <kendo-pager-page-sizes *ngIf=\"settings.pageSizes\" [pageSizes]=\"settings.pageSizes\"></kendo-pager-page-sizes>\n        </ng-container>\n  "
            },] },
];
/** @nocollapse */
PagerComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__pager_context_service__["a" /* PagerContextService */], },
]; };
PagerComponent.propDecorators = {
    'total': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skip': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageSize': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'options': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'pagerWrapClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-pager-wrap',] },],
    'gridPagerClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-pager',] },],
    'widgetClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] },],
};


/***/ }),
/* 353 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagerModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pager_component__ = __webpack_require__(352);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pager_prev_buttons_component__ = __webpack_require__(350);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pager_next_buttons_component__ = __webpack_require__(347);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pager_numeric_buttons_component__ = __webpack_require__(348);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pager_input_component__ = __webpack_require__(346);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__pager_info_component__ = __webpack_require__(345);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pager_page_sizes_component__ = __webpack_require__(349);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__pager_template_directive__ = __webpack_require__(351);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__shared_module__ = __webpack_require__(50);











var importedModules = [
    __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"],
    __WEBPACK_IMPORTED_MODULE_10__shared_module__["a" /* SharedModule */]
];
var INTERNAL_COMPONENTS = [
    __WEBPACK_IMPORTED_MODULE_2__pager_component__["a" /* PagerComponent */],
    __WEBPACK_IMPORTED_MODULE_3__pager_prev_buttons_component__["a" /* PagerPrevButtonsComponent */],
    __WEBPACK_IMPORTED_MODULE_4__pager_next_buttons_component__["a" /* PagerNextButtonsComponent */],
    __WEBPACK_IMPORTED_MODULE_5__pager_numeric_buttons_component__["a" /* PagerNumericButtonsComponent */],
    __WEBPACK_IMPORTED_MODULE_6__pager_input_component__["a" /* PagerInputComponent */],
    __WEBPACK_IMPORTED_MODULE_7__pager_info_component__["a" /* PagerInfoComponent */],
    __WEBPACK_IMPORTED_MODULE_8__pager_page_sizes_component__["a" /* PagerPageSizesComponent */],
    __WEBPACK_IMPORTED_MODULE_9__pager_template_directive__["a" /* PagerTemplateDirective */]
];
/**
 * @hidden
 */
var PagerModule = (function () {
    function PagerModule() {
    }
    PagerModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_2__pager_component__["a" /* PagerComponent */],
            __WEBPACK_IMPORTED_MODULE_3__pager_prev_buttons_component__["a" /* PagerPrevButtonsComponent */],
            __WEBPACK_IMPORTED_MODULE_4__pager_next_buttons_component__["a" /* PagerNextButtonsComponent */],
            __WEBPACK_IMPORTED_MODULE_5__pager_numeric_buttons_component__["a" /* PagerNumericButtonsComponent */],
            __WEBPACK_IMPORTED_MODULE_6__pager_input_component__["a" /* PagerInputComponent */],
            __WEBPACK_IMPORTED_MODULE_7__pager_info_component__["a" /* PagerInfoComponent */],
            __WEBPACK_IMPORTED_MODULE_8__pager_page_sizes_component__["a" /* PagerPageSizesComponent */],
            __WEBPACK_IMPORTED_MODULE_9__pager_template_directive__["a" /* PagerTemplateDirective */]
        ];
    };
    return PagerModule;
}());

PagerModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [INTERNAL_COMPONENTS],
                exports: [INTERNAL_COMPONENTS],
                imports: importedModules.slice()
            },] },
];
/** @nocollapse */
PagerModule.ctorParameters = function () { return []; };


/***/ }),
/* 354 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return FOOTER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GridQuery; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__ = __webpack_require__(194);

/**
 * @hidden
 */
var HEADER_CLASS = 'k-grid-header';
/**
 * @hidden
 */
var FOOTER_CLASS = 'k-grid-footer';
var GRID_LIST = 'KENDO-GRID-LIST';
var TABLE = 'TABLE';
var matchesList = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["c" /* matchesNodeName */])(GRID_LIST);
var matchesTable = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["c" /* matchesNodeName */])(TABLE);
var suffix = function (locked) { return locked ? 'locked' : 'wrap'; };
/**
 * @hidden
 */
var GridQuery = (function () {
    function GridQuery(element) {
        this.element = element;
        this.list = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(element, matchesList);
    }
    GridQuery.prototype.content = function (locked) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(this.list, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["b" /* matchesClasses */])("k-grid-content" + (locked ? '-locked' : '')));
    };
    GridQuery.prototype.header = function (locked) {
        this.headerWrap = this.headerWrap || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(this.element, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["b" /* matchesClasses */])(HEADER_CLASS));
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(this.headerWrap, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["b" /* matchesClasses */])(HEADER_CLASS + "-" + suffix(locked)));
    };
    GridQuery.prototype.footer = function (locked) {
        this.footerWrap = this.footerWrap || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(this.element, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["b" /* matchesClasses */])(FOOTER_CLASS));
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(this.footerWrap, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["b" /* matchesClasses */])(FOOTER_CLASS + "-" + suffix(locked)));
    };
    GridQuery.prototype.table = function () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__rendering_common_dom_queries__["e" /* findElement */])(this.element, matchesTable);
    };
    return GridQuery;
}());



/***/ }),
/* 355 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFTemplateDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_pdf_export__ = __webpack_require__(205);



/**
 * Represents the PDF page template of the Kendo UI Grid that helps to customize the PDF pages.
 *
 * To define a page template, nest a `<ng-template>` tag with the `kendoGridPDFTemplate` directive inside `<kendo-grid-pdf>`.
 * The template context provides the following fields:
 * - `pageNumber`&mdash;Defines PDF page number.
 * - `totalPages`&mdash;Defines the total number of PDF pages.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *         <kendo-grid [data]="gridData">
 *             <ng-template kendoGridToolbarTemplate>
 *                 <button kendoGridPDFCommand><span class='k-icon k-i-file-pdf'></span>Export to PDF</button>
 *             </ng-template>
 *             <kendo-grid-column field="ProductName">
 *             </kendo-grid-column>
 *              <kendo-grid-column field="UnitPrice">
 *             </kendo-grid-column>
 *             <kendo-grid-pdf fileName="Products.pdf" paperSize="A4" [margin]="{ top: '1cm', left: '1cm', right: '1cm', bottom: '1cm' }">
 *                 <ng-template kendoGridPDFTemplate let-pageNum="pageNum" let-totalPages="totalPages">
 *                     <div style="position: absolute;top: 5px; left: 5px;">
 *                         Page {{ pageNum }} of {{ totalPages }}
 *                     </div>
 *                 </ng-template>
 *             </kendo-grid-pdf>
 *         </kendo-grid>
 *     `
 * })
 *
 * class AppComponent {
 *     public gridData = [{
 *         "ProductID": 1,
 *         "ProductName": "Chai",
 *         "UnitPrice": 18.0000
 *       }, {
 *         "ProductID": 2,
 *         "ProductName": "Chang",
 *         "UnitPrice": 19.0000
 *       }
 *     ];
 * }
 *
 * ```
 */
var PDFTemplateDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PDFTemplateDirective, _super);
    function PDFTemplateDirective(templateRef) {
        return _super.call(this, templateRef) || this;
    }
    return PDFTemplateDirective;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_pdf_export__["c" /* PDFTemplateDirective */]));

PDFTemplateDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoGridPDFTemplate]'
            },] },
];
/** @nocollapse */
PDFTemplateDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["TemplateRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 356 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scrolling_suspend_service__ = __webpack_require__(201);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pdf_service__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pdf_margin_component__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pdf_template_directive__ = __webpack_require__(355);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__export_element__ = __webpack_require__(597);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__grid_query__ = __webpack_require__(354);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__columns_column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_pdf_export__ = __webpack_require__(205);










var createElement = function (tagName, className) {
    var element = document.createElement(tagName);
    if (className) {
        element.className = className;
    }
    return element;
};
var createDiv = function (className) {
    return createElement('div', className);
};
/**
 * Configures the PDF export settings of the Kendo UI Grid.
 */
var PDFComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PDFComponent, _super);
    function PDFComponent(pdfService, suspendService, ngZone, element) {
        var _this = _super.call(this, element) || this;
        _this.pdfService = pdfService;
        _this.suspendService = suspendService;
        _this.ngZone = ngZone;
        _this.columns = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["QueryList"]();
        _this.saveSubscription = pdfService.savePDF.subscribe(_this.savePDF.bind(_this));
        _this.reset = _this.reset.bind(_this);
        _this.draw = _this.draw.bind(_this);
        return _this;
    }
    PDFComponent.prototype.ngOnDestroy = function () {
        this.saveSubscription.unsubscribe();
        this.reset();
    };
    PDFComponent.prototype.savePDF = function (component) {
        var pageSize = component.pageSize;
        var total = component.view.total;
        var columns = this.columns.toArray();
        if (columns.length) {
            this.originalColumns = component.columns.toArray();
        }
        this.component = component;
        this.suspendService.scroll = true;
        this.initProgress();
        this.renderAllPages = this.allPages && pageSize < total;
        if (this.renderAllPages) {
            this.skip = component.skip;
            this.pageSize = pageSize;
            this.changePage(0, total, this.draw, columns);
        }
        else if (columns.length) {
            this.changeColumns(columns, this.draw);
        }
        else {
            this.draw();
        }
    };
    PDFComponent.prototype.initProgress = function () {
        var wrapperElement = this.component.wrapper.nativeElement;
        var progress = this.progress = createDiv('k-loading-pdf-mask');
        var overlay = wrapperElement.cloneNode(true);
        progress.appendChild(overlay);
        progress.appendChild(createDiv('k-loading-color'));
        progress.appendChild(createElement('span', 'k-i-loading k-icon'));
        this.originalHeight = wrapperElement.style.height;
        this.originalOverflow = wrapperElement.style.overflow;
        wrapperElement.style.height = wrapperElement.offsetHeight + 'px';
        wrapperElement.style.overflow = 'hidden';
        wrapperElement.appendChild(progress);
        this.applyScroll(overlay);
    };
    PDFComponent.prototype.applyScroll = function (overlay) {
        var query = new __WEBPACK_IMPORTED_MODULE_7__grid_query__["a" /* GridQuery */](this.component.wrapper.nativeElement);
        var content = query.content();
        if (content) {
            var overlayQuery = new __WEBPACK_IMPORTED_MODULE_7__grid_query__["a" /* GridQuery */](overlay);
            var overlayContent = overlayQuery.content();
            overlayContent.scrollTop = content.scrollTop;
            overlayContent.scrollLeft = content.scrollLeft;
            overlayQuery.header().scrollLeft = query.header().scrollLeft;
            var footer = query.footer();
            if (footer) {
                overlayQuery.footer().scrollLeft = footer.scrollLeft;
            }
            var lockedContent = query.content(true);
            if (lockedContent) {
                var overlayLockedContent = overlayQuery.content(true);
                overlayLockedContent.scrollTop = lockedContent.scrollTop;
                overlayLockedContent.scrollLeft = lockedContent.scrollLeft;
            }
        }
    };
    PDFComponent.prototype.draw = function () {
        var _this = this;
        this.ngZone.runOutsideAngular(function () {
            var container = _this.container = createDiv('k-grid-pdf-export-element');
            var element = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__export_element__["a" /* exportElement */])(_this.component.wrapper.nativeElement);
            container.appendChild(element);
            document.body.appendChild(container);
            _this.save(element, _this.fileName);
        });
    };
    PDFComponent.prototype.drawOptions = function () {
        var options = _super.prototype.drawOptions.call(this);
        options._destructive = true;
        return options;
    };
    PDFComponent.prototype.cleanup = function () {
        _super.prototype.cleanup.call(this);
        if (this.component) {
            var originalColumns = this.originalColumns;
            delete this.originalColumns;
            if (this.renderAllPages) {
                this.changePage(this.skip, this.pageSize, this.reset, originalColumns);
            }
            else if (originalColumns) {
                this.changeColumns(originalColumns, this.reset);
            }
            else {
                this.reset();
            }
        }
        else {
            this.reset();
        }
        this.removeContainer();
    };
    PDFComponent.prototype.removeContainer = function () {
        if (this.container) {
            document.body.removeChild(this.container);
            delete this.container;
        }
    };
    PDFComponent.prototype.changePage = function (skip, take, callback, columns) {
        var _this = this;
        this.ngZone.run(function () {
            _this.pdfService.dataChanged.take(1).subscribe(function () {
                if (columns && columns.length) {
                    _this.changeColumns(columns, callback);
                }
                else {
                    _this.onStable(callback);
                }
            });
            _this.component.notifyPageChange('pdf', { skip: skip, take: take });
        });
    };
    PDFComponent.prototype.changeColumns = function (columns, callback) {
        var _this = this;
        this.ngZone.run(function () {
            _this.onStable(callback);
            _this.component.columns.reset(columns);
        });
    };
    PDFComponent.prototype.reset = function () {
        this.suspendService.scroll = false;
        this.renderAllPages = false;
        if (!this.component) {
            return;
        }
        var wrapperElement = this.component.wrapper.nativeElement;
        wrapperElement.removeChild(this.progress);
        wrapperElement.style.height = this.originalHeight;
        wrapperElement.style.overflow = this.originalOverflow;
        delete this.progress;
        delete this.component;
    };
    PDFComponent.prototype.onStable = function (callback) {
        var _this = this;
        // not sure if it is an actual scenario. occurs in the tests.
        // onStable is triggered in the same pass without the change detection
        // thus the callback is called before the changes are applied without the timeout
        setTimeout(function () {
            _this.ngZone.onStable.asObservable().take(1).subscribe(callback);
        }, 0); // tslint:disable-line: align
    };
    return PDFComponent;
}(__WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_pdf_export__["b" /* PDFExportComponent */]));

PDFComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-pdf',
                template: ''
            },] },
];
/** @nocollapse */
PDFComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__pdf_service__["a" /* PDFService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__scrolling_suspend_service__["a" /* SuspendService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ElementRef"], },
]; };
PDFComponent.propDecorators = {
    'allPages': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChildren"], args: [__WEBPACK_IMPORTED_MODULE_8__columns_column_base__["a" /* ColumnBase */],] },],
    'marginComponent': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_4__pdf_margin_component__["a" /* PDFMarginComponent */],] },],
    'pageTemplateDirective': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_5__pdf_template_directive__["a" /* PDFTemplateDirective */],] },],
};


/***/ }),
/* 357 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BodyModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_command_column_component__ = __webpack_require__(301);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_checkbox_column_component__ = __webpack_require__(561);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selection_selection_checkbox_directive__ = __webpack_require__(606);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__cell_template_directive__ = __webpack_require__(68);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__no_records_template_directive__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__editing_edit_template_directive__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__table_body_component__ = __webpack_require__(365);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__cell_component__ = __webpack_require__(601);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__editing_edit_command_directive__ = __webpack_require__(571);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__editing_cancel_command_directive__ = __webpack_require__(569);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__editing_save_command_directive__ = __webpack_require__(573);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__editing_remove_command_directive__ = __webpack_require__(572);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__editing_add_command_directive__ = __webpack_require__(568);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__shared_module__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__grouping_group_module__ = __webpack_require__(124);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__progress_kendo_angular_inputs__ = __webpack_require__(374);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__progress_kendo_angular_dateinputs__ = __webpack_require__(160);




















var exported = [
    __WEBPACK_IMPORTED_MODULE_3__columns_command_column_component__["a" /* CommandColumnComponent */],
    __WEBPACK_IMPORTED_MODULE_4__columns_checkbox_column_component__["a" /* CheckboxColumnComponent */],
    __WEBPACK_IMPORTED_MODULE_5__selection_selection_checkbox_directive__["a" /* SelectionCheckboxDirective */],
    __WEBPACK_IMPORTED_MODULE_6__cell_template_directive__["a" /* CellTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_8__editing_edit_template_directive__["a" /* EditTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_9__table_body_component__["a" /* TableBodyComponent */],
    __WEBPACK_IMPORTED_MODULE_7__no_records_template_directive__["a" /* NoRecordsTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_10__cell_component__["a" /* CellComponent */],
    __WEBPACK_IMPORTED_MODULE_11__editing_edit_command_directive__["a" /* EditCommandDirective */],
    __WEBPACK_IMPORTED_MODULE_12__editing_cancel_command_directive__["a" /* CancelCommandDirective */],
    __WEBPACK_IMPORTED_MODULE_13__editing_save_command_directive__["a" /* SaveCommandDirective */],
    __WEBPACK_IMPORTED_MODULE_14__editing_remove_command_directive__["a" /* RemoveCommandDirective */],
    __WEBPACK_IMPORTED_MODULE_15__editing_add_command_directive__["a" /* AddCommandDirective */]
];
var importedModules = [
    __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"],
    __WEBPACK_IMPORTED_MODULE_2__angular_forms__["ReactiveFormsModule"],
    __WEBPACK_IMPORTED_MODULE_2__angular_forms__["FormsModule"],
    __WEBPACK_IMPORTED_MODULE_16__shared_module__["a" /* SharedModule */],
    __WEBPACK_IMPORTED_MODULE_17__grouping_group_module__["a" /* GroupModule */],
    __WEBPACK_IMPORTED_MODULE_18__progress_kendo_angular_inputs__["b" /* NumericTextBoxModule */],
    __WEBPACK_IMPORTED_MODULE_19__progress_kendo_angular_dateinputs__["b" /* DatePickerModule */]
];
/**
 * @hidden
 */
var BodyModule = (function () {
    function BodyModule() {
    }
    BodyModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_3__columns_command_column_component__["a" /* CommandColumnComponent */],
            __WEBPACK_IMPORTED_MODULE_4__columns_checkbox_column_component__["a" /* CheckboxColumnComponent */],
            __WEBPACK_IMPORTED_MODULE_5__selection_selection_checkbox_directive__["a" /* SelectionCheckboxDirective */],
            __WEBPACK_IMPORTED_MODULE_6__cell_template_directive__["a" /* CellTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_7__no_records_template_directive__["a" /* NoRecordsTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_8__editing_edit_template_directive__["a" /* EditTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_11__editing_edit_command_directive__["a" /* EditCommandDirective */],
            __WEBPACK_IMPORTED_MODULE_12__editing_cancel_command_directive__["a" /* CancelCommandDirective */],
            __WEBPACK_IMPORTED_MODULE_13__editing_save_command_directive__["a" /* SaveCommandDirective */],
            __WEBPACK_IMPORTED_MODULE_14__editing_remove_command_directive__["a" /* RemoveCommandDirective */],
            __WEBPACK_IMPORTED_MODULE_15__editing_add_command_directive__["a" /* AddCommandDirective */]
        ];
    };
    return BodyModule;
}());

BodyModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [exported],
                exports: [exported],
                imports: importedModules.slice()
            },] },
];
/** @nocollapse */
BodyModule.ctorParameters = function () { return []; };


/***/ }),
/* 358 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColGroupComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__columns_column_common__ = __webpack_require__(27);


/**
 * @hidden
 */
var ColGroupComponent = (function () {
    function ColGroupComponent() {
        this.columns = [];
        this.groups = [];
    }
    Object.defineProperty(ColGroupComponent.prototype, "columnsToRender", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__columns_column_common__["c" /* columnsToRender */])(this.columns);
        },
        enumerable: true,
        configurable: true
    });
    return ColGroupComponent;
}());

ColGroupComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridColGroup]',
                template: "\n    <ng-template [ngIf]=\"true\">\n        <col [class.k-group-col]=\"true\" *ngFor=\"let g of groups\" />\n        <col [class.k-hierarchy-col]=\"true\" *ngIf=\"detailTemplate?.templateRef\"/>\n        <col *ngFor=\"let column of columnsToRender\" [style.width.px]=\"column.width\"/>\n    </ng-template>\n    "
            },] },
];
/** @nocollapse */
ColGroupComponent.ctorParameters = function () { return []; };
ColGroupComponent.propDecorators = {
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 359 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TemplateContextDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var TemplateContextDirective = (function () {
    function TemplateContextDirective(viewContainerRef) {
        this.viewContainerRef = viewContainerRef;
    }
    Object.defineProperty(TemplateContextDirective.prototype, "templateContext", {
        set: function (context) {
            this.removeView();
            if (context.templateRef) {
                this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
            }
        },
        enumerable: true,
        configurable: true
    });
    TemplateContextDirective.prototype.ngOnDestroy = function () {
        this.removeView();
    };
    TemplateContextDirective.prototype.removeView = function () {
        if (this.insertedViewRef) {
            this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
            this.insertedViewRef = undefined;
        }
    };
    return TemplateContextDirective;
}());

TemplateContextDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[templateContext]' // tslint:disable-line:directive-selector
            },] },
];
/** @nocollapse */
TemplateContextDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"], },
]; };
TemplateContextDirective.propDecorators = {
    'templateContext': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 360 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FooterComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__columns_column_common__ = __webpack_require__(27);


/**
 * @hidden
 */
var FooterComponent = (function () {
    function FooterComponent() {
        this.columns = [];
        this.groups = [];
        this.lockedColumnsCount = 0;
    }
    Object.defineProperty(FooterComponent.prototype, "footerClass", {
        get: function () {
            return !this.scrollable;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FooterComponent.prototype, "columnsToRender", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__columns_column_common__["c" /* columnsToRender */])(this.columns || []);
        },
        enumerable: true,
        configurable: true
    });
    return FooterComponent;
}());

FooterComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridFooter]',
                template: "\n    <ng-template [ngIf]=\"true\">\n        <tr [class.k-footer-template]=\"true\">\n            <td\n                [class.k-group-cell]=\"true\"\n                *ngFor=\"let g of groups\">\n            </td>\n            <td\n                [class.k-hierarchy-cell]=\"true\"\n                *ngIf=\"detailTemplate?.templateRef\">\n            </td>\n            <td\n                [ngClass]=\"column.footerClass\"\n                [ngStyle]=\"column.footerStyle\"\n                *ngFor=\"let column of columnsToRender; let columnIndex = index\">\n                <ng-template\n                    [templateContext]=\"{\n                        templateRef: column.footerTemplateRef,\n                        columnIndex: lockedColumnsCount + columnIndex,\n                        column: column,\n                        $implicit: column\n                    }\">\n                </ng-template>\n            </td>\n        </tr>\n    </ng-template>\n    "
            },] },
];
/** @nocollapse */
FooterComponent.ctorParameters = function () { return []; };
FooterComponent.propDecorators = {
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'scrollable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'lockedColumnsCount': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'footerClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-footer',] },],
};


/***/ }),
/* 361 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FooterModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shared_module__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__footer_component__ = __webpack_require__(360);




var exportedModules = [
    __WEBPACK_IMPORTED_MODULE_3__footer_component__["a" /* FooterComponent */]
];
var importedModules = [
    __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"],
    __WEBPACK_IMPORTED_MODULE_2__shared_module__["a" /* SharedModule */]
];
/**
 * @hidden
 */
var FooterModule = (function () {
    function FooterModule() {
    }
    FooterModule.exports = function () {
        return [];
    };
    return FooterModule;
}());

FooterModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [exportedModules],
                exports: [exportedModules],
                imports: importedModules.slice()
            },] },
];
/** @nocollapse */
FooterModule.ctorParameters = function () { return []; };


/***/ }),
/* 362 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HeaderComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__columns_column_group_component__ = __webpack_require__(90);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_sort_settings__ = __webpack_require__(562);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_draggable_directive__ = __webpack_require__(119);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__grouping_group_connection_service__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__columns_column_common__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__selection_selection_service__ = __webpack_require__(91);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__filtering_menu_single_popup_service__ = __webpack_require__(122);










/**
 * @hidden
 */
var HeaderComponent = (function () {
    function HeaderComponent(groupDragService, selectionService, popupService) {
        this.groupDragService = groupDragService;
        this.selectionService = selectionService;
        this.popupService = popupService;
        this.columns = [];
        this.groups = [];
        this.sort = new Array();
        this.sortable = false;
        this.groupable = false;
        this.lockedColumnsCount = 0;
        this.resizable = false;
        this.sortChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    Object.defineProperty(HeaderComponent.prototype, "headerClass", {
        get: function () {
            return !this.scrollable;
        },
        enumerable: true,
        configurable: true
    });
    HeaderComponent.prototype.sortColumn = function (column, event, link, icon) {
        var target = event ? event.target : null;
        if (column.headerTemplateRef && target !== link && target !== icon) {
            return false;
        }
        this.sortChange.emit(this.toggleSort(column));
        //prevent default
        return false;
    };
    HeaderComponent.prototype.sortIcon = function (field) {
        var state = this.sortDescriptor(field);
        return {
            'k-icon': __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* isPresent */])(state.dir),
            'k-i-sort-desc-sm': state.dir === "desc",
            'k-i-sort-asc-sm': state.dir === "asc"
        };
    };
    HeaderComponent.prototype.toggleSort = function (column) {
        var _a = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__columns_sort_settings__["a" /* normalize */])(this.sortable, column.sortable), allowUnsort = _a.allowUnsort, mode = _a.mode;
        var descriptor = this.toggleDirection(column.field, allowUnsort);
        if (mode === 'single') {
            return [descriptor];
        }
        return this.sort.filter(function (desc) { return desc.field !== column.field; }).concat([descriptor]);
    };
    HeaderComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        var isNotGrouped = function (_a) {
            var column = _a.column;
            return _this.groupable && !_this.groups.some(function (group) { return group.field === column.field; });
        };
        this.draggablesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["f" /* observe */])(this.draggables).subscribe(function (items) {
            return _this.groupDragService.connect(items.filter(function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* isPresent */])(x.column.field); }), isNotGrouped);
        });
    };
    HeaderComponent.prototype.ngOnDestroy = function () {
        this.groupDragService.unsubscribe();
        if (this.draggablesSubscription) {
            this.draggablesSubscription.unsubscribe();
        }
        if (this.popupService) {
            this.popupService.destroy();
        }
    };
    HeaderComponent.prototype.selectAllCheckboxId = function () {
        return "k-grid" + this.selectionService.id + "-select-all";
    };
    HeaderComponent.prototype.isFirstOnRow = function (column, index) {
        var _this = this;
        var isTailing = function (c) { return c &&
            (_this.columnsForLevel(c.level).indexOf(c) > 0 || isTailing(c.parent)); };
        return index === 0 && !this.groups.length && !this.detailTemplate && isTailing(column.parent);
    };
    Object.defineProperty(HeaderComponent.prototype, "showFilterMenu", {
        get: function () {
            return typeof this.filterable === 'string' && this.filterable.indexOf('menu') > -1;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HeaderComponent.prototype, "showFilterRow", {
        get: function () {
            return this.filterable === true || (typeof this.filterable === 'string' && this.filterable.indexOf('row') > -1);
        },
        enumerable: true,
        configurable: true
    });
    HeaderComponent.prototype.isFilterable = function (column) {
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["h" /* isNullOrEmptyString */])(column.field) && column.filterable === true;
    };
    HeaderComponent.prototype.isSortable = function (column) {
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["h" /* isNullOrEmptyString */])(column.field)
            && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["g" /* isTruthy */])(this.sortable) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["g" /* isTruthy */])(column.sortable);
    };
    HeaderComponent.prototype.isCheckboxColumn = function (column) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__columns_column_base__["c" /* isCheckboxColumn */])(column) && !column.templateRef;
    };
    HeaderComponent.prototype.toggleDirection = function (field, allowUnsort) {
        var descriptor = this.sortDescriptor(field);
        var dir = 'asc';
        if (descriptor.dir === 'asc') {
            dir = 'desc';
        }
        else if (descriptor.dir === 'desc' && allowUnsort) {
            dir = undefined;
        }
        return { dir: dir, field: field };
    };
    HeaderComponent.prototype.columnsForLevel = function (level) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__columns_column_common__["c" /* columnsToRender */])(this.columns ? this.columns.filter(function (column) { return column.level === level; }) : []);
    };
    HeaderComponent.prototype.isColumnGroupComponent = function (column) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__columns_column_group_component__["a" /* isColumnGroupComponent */])(column);
    };
    HeaderComponent.prototype.sortDescriptor = function (field) {
        return this.sort.find(function (item) { return item.field === field; }) || { field: field };
    };
    Object.defineProperty(HeaderComponent.prototype, "columnLevels", {
        get: function () {
            return new Array((this.totalColumnLevels || 0) + 1);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HeaderComponent.prototype, "leafColumns", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__columns_column_common__["c" /* columnsToRender */])(this.columns || []).filter(function (x) { return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__columns_column_group_component__["a" /* isColumnGroupComponent */])(x); });
        },
        enumerable: true,
        configurable: true
    });
    return HeaderComponent;
}());

HeaderComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                providers: [__WEBPACK_IMPORTED_MODULE_6__grouping_group_connection_service__["b" /* GroupDragService */]],
                selector: '[kendoGridHeader]',
                styles: ["\n        .k-column-resizer {\n            cursor: col-resize;\n            display: block;\n            height: 1000%;\n            position: absolute;\n            right: 0;\n            top: 0;\n            width: .5em;\n        }\n    "],
                template: "\n    <ng-template [ngIf]=\"true\">\n        <tr *ngFor=\"let i of columnLevels; let levelIndex = index\">\n            <th\n                [class.k-group-cell]=\"true\"\n                [class.k-header]=\"true\"\n                *ngFor=\"let g of groups\">\n            </th>\n            <th\n                [class.k-hierarchy-cell]=\"true\"\n                [class.k-header]=\"true\"\n                *ngIf=\"detailTemplate?.templateRef\">\n            </th>\n            <ng-template ngFor let-column [ngForOf]=\"columnsForLevel(levelIndex)\" let-columnIndex=\"index\">\n                <th [kendoGridDraggable]=\"column\"\n                    [class.k-header]=\"true\"\n                    [class.k-first]=\"isFirstOnRow(column, columnIndex)\"\n                    *ngIf=\"!isColumnGroupComponent(column)\"\n                    [ngClass]=\"column.headerClass\"\n                    [ngStyle]=\"column.headerStyle\"\n                    [attr.rowspan]=\"column.rowspan(totalColumnLevels)\"\n                    [attr.colspan]=\"column.colspan\">\n                    <kendo-grid-filter-menu\n                        *ngIf=\"showFilterMenu && isFilterable(column)\"\n                        [column]=\"column\"\n                        [filter]=\"filter\">\n                    </kendo-grid-filter-menu>\n                    <ng-template [ngIf]=\"!isSortable(column)\">\n                        <ng-template\n                            [templateContext]=\"{\n                                templateRef: column.headerTemplateRef,\n                                columnIndex: lockedColumnsCount + columnIndex,\n                                column: column,\n                                $implicit: column\n                            }\">\n                        </ng-template>\n                        <ng-template [ngIf]=\"!column.headerTemplateRef\">{{column.displayTitle}}</ng-template>\n                    </ng-template>\n                    <ng-template [ngIf]=\"isSortable(column)\">\n                        <a href=\"#\" #link class=\"k-link\" (click)=\"sortColumn(column, $event, link, sortSpan)\">\n                            <ng-template\n                                [templateContext]=\"{\n                                    templateRef: column.headerTemplateRef,\n                                    columnIndex: columnIndex,\n                                    column: column,\n                                    $implicit: column\n                                }\">\n                            </ng-template>\n                            <ng-template [ngIf]=\"!column.headerTemplateRef\">{{column.displayTitle}}</ng-template>\n                            <span #sortSpan [ngClass]=\"sortIcon(column.field)\"></span>\n                        </a>\n                    </ng-template>\n                    <ng-template [ngIf]=\"isCheckboxColumn(column) && !column.headerTemplateRef && column.showSelectAll\">\n                        <input class=\"k-checkbox\" [attr.id]=\"selectAllCheckboxId()\" kendoGridSelectAllCheckbox>\n                        <label class=\"k-checkbox-label\" [attr.for]=\"selectAllCheckboxId()\"></label>\n                    </ng-template>\n                    <span kendoGridColumnHandle\n                        kendoGridDraggable\n                        class=\"k-column-resizer\"\n                        *ngIf=\"resizable\"\n                        [column]=\"column\"\n                        [columns]=\"columns\">\n                    </span>\n                </th>\n                <th *ngIf=\"isColumnGroupComponent(column)\"\n                    [class.k-header]=\"true\"\n                    [class.k-first]=\"isFirstOnRow(column, columnIndex)\"\n                    [ngClass]=\"column.headerClass\"\n                    [ngStyle]=\"column.headerStyle\"\n                    [attr.rowspan]=\"column.rowspan(totalColumnLevels)\"\n                    [attr.colspan]=\"column.colspan\">\n                        <ng-template\n                            [templateContext]=\"{\n                                templateRef: column.headerTemplateRef,\n                                columnIndex: lockedColumnsCount + columnIndex,\n                                column: column,\n                                $implicit: column\n                            }\">\n                        </ng-template>\n                        <ng-template [ngIf]=\"!column.headerTemplateRef\">{{column.displayTitle}}</ng-template>\n                        <span kendoGridColumnHandle\n                            kendoGridDraggable\n                            class=\"k-column-resizer\"\n                            *ngIf=\"resizable\"\n                            [column]=\"column\"\n                            [columns]=\"columns\">\n                        </span>\n                </th>\n            </ng-template>\n        </tr>\n        <tr kendoGridFilterRow\n            *ngIf=\"showFilterRow\"\n            [columns]=\"leafColumns\"\n            [filter]=\"filter\"\n            [groups]=\"groups\"\n            [detailTemplate]=\"detailTemplate\"\n        ></tr>\n    </ng-template>\n    "
            },] },
];
/** @nocollapse */
HeaderComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_6__grouping_group_connection_service__["b" /* GroupDragService */], },
    { type: __WEBPACK_IMPORTED_MODULE_8__selection_selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_9__filtering_menu_single_popup_service__["a" /* SinglePopupService */], },
]; };
HeaderComponent.propDecorators = {
    'totalColumnLevels': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'scrollable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'sort': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'sortable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groupable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'lockedColumnsCount': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'resizable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'sortChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'headerClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-header',] },],
    'draggables': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: [__WEBPACK_IMPORTED_MODULE_5__common_draggable_directive__["a" /* DraggableDirective */],] },],
};


/***/ }),
/* 363 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HeaderModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__header_component__ = __webpack_require__(362);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grouping_group_module__ = __webpack_require__(124);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shared_module__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__filtering_cell_row_filtering_module__ = __webpack_require__(181);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__header_template_directive__ = __webpack_require__(198);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__column_resizing_column_handle_directive__ = __webpack_require__(559);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__selection_selectall_checkbox_directive__ = __webpack_require__(605);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__filtering_menu_filter_menu_module__ = __webpack_require__(185);










var exportedModules = [
    __WEBPACK_IMPORTED_MODULE_2__header_component__["a" /* HeaderComponent */],
    __WEBPACK_IMPORTED_MODULE_6__header_template_directive__["a" /* HeaderTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_7__column_resizing_column_handle_directive__["a" /* ColumnHandleDirective */],
    __WEBPACK_IMPORTED_MODULE_8__selection_selectall_checkbox_directive__["a" /* SelectAllCheckboxDirective */]
];
var importedModules = [
    __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"],
    __WEBPACK_IMPORTED_MODULE_3__grouping_group_module__["a" /* GroupModule */],
    __WEBPACK_IMPORTED_MODULE_5__filtering_cell_row_filtering_module__["a" /* RowFilterModule */],
    __WEBPACK_IMPORTED_MODULE_9__filtering_menu_filter_menu_module__["a" /* FilterMenuModule */],
    __WEBPACK_IMPORTED_MODULE_4__shared_module__["a" /* SharedModule */]
];
/**
 * @hidden
 */
var HeaderModule = (function () {
    function HeaderModule() {
    }
    HeaderModule.exports = function () {
        return [
            __WEBPACK_IMPORTED_MODULE_6__header_template_directive__["a" /* HeaderTemplateDirective */],
            __WEBPACK_IMPORTED_MODULE_8__selection_selectall_checkbox_directive__["a" /* SelectAllCheckboxDirective */]
        ];
    };
    return HeaderModule;
}());

HeaderModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [exportedModules],
                exports: [exportedModules],
                imports: importedModules.slice()
            },] },
];
/** @nocollapse */
HeaderModule.ctorParameters = function () { return []; };


/***/ }),
/* 364 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export SCROLLER_FACTORY_TOKEN */
/* unused harmony export DEFAULT_SCROLLER_FACTORY */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ListComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_merge__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_do__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_do__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_switchMapTo__ = __webpack_require__(500);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_switchMapTo___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_switchMapTo__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__scrolling_row_height_service__ = __webpack_require__(603);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__scrolling_scroller_service__ = __webpack_require__(604);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__details_details_service__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__columns_columns_container__ = __webpack_require__(300);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__data_change_notification_service__ = __webpack_require__(174);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__layout_row_sync__ = __webpack_require__(342);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__scrolling_suspend_service__ = __webpack_require__(201);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__grouping_groups_service__ = __webpack_require__(125);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__columns_column_common__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__scrolling_scroll_sync_service__ = __webpack_require__(367);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__layout_resize_service__ = __webpack_require__(191);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__progress_kendo_angular_resize_sensor__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__layout_browser_support_service__ = __webpack_require__(340);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__editing_edit_service__ = __webpack_require__(36);

























/**
 * @hidden
 */
var SCROLLER_FACTORY_TOKEN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]('grid-scroll-service-factory');
/**
 * @hidden
 */
function DEFAULT_SCROLLER_FACTORY(observable) {
    return new __WEBPACK_IMPORTED_MODULE_11__scrolling_scroller_service__["a" /* ScrollerService */](observable);
}
var wheelDeltaY = function (e) {
    var deltaY = e.wheelDeltaY;
    if (e.wheelDelta && (deltaY === undefined || deltaY)) {
        return e.wheelDelta;
    }
    else if (e.detail && e.axis === e.VERTICAL_AXIS) {
        return (-e.detail) * 10;
    }
    return 0;
};
var preventLockedScroll = function (el) { return function (event) {
    if (el.scrollHeight > el.offsetHeight + el.scrollTop && el.scrollTop > 0) {
        event.preventDefault();
    }
}; };
var translateY = function (renderer, value) { return function (el) { return renderer.setStyle(el, "transform", "translateY(" + value + "px)"); }; };
var maybeNativeElement = function (el) { return el ? el.nativeElement : null; };
var hasScrollbar = function (el, parent) { return el.nativeElement.offsetWidth > parent.nativeElement.clientWidth; };
var setHeight = function (renderer) { return function (_a) {
    var el = _a.el, height = _a.height;
    return renderer.setStyle(el, "height", height + "px");
}; };
/**
 * @hidden
 */
var ListComponent = (function () {
    function ListComponent(scrollerFactory, detailsService, changeNotification, suspendService, rtl, groupsService, ngZone, renderer, scrollSyncService, resizeService, editService, supportService) {
        if (rtl === void 0) { rtl = false; }
        var _this = this;
        this.changeNotification = changeNotification;
        this.suspendService = suspendService;
        this.rtl = rtl;
        this.groupsService = groupsService;
        this.ngZone = ngZone;
        this.renderer = renderer;
        this.scrollSyncService = scrollSyncService;
        this.resizeService = resizeService;
        this.editService = editService;
        this.groups = [];
        this.skip = 0;
        this.columns = new __WEBPACK_IMPORTED_MODULE_14__columns_columns_container__["a" /* ColumnsContainer */](function () { return []; });
        this.selectable = false;
        this.groupable = false;
        this.pageChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.resizeSensors = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["QueryList"]();
        this.dispatcher = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__["Subject"]();
        this.scroller = scrollerFactory(this.dispatcher);
        this.subscriptions = detailsService.changes.subscribe(function (x) { return _this.detailExpand(x); });
        this.scrollbarWidth = supportService.scrollbarWidth;
    }
    Object.defineProperty(ListComponent.prototype, "hostClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListComponent.prototype, "showFooter", {
        get: function () {
            return this.groupable && this.groupable.showFooter;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListComponent.prototype, "lockedLeafColumns", {
        get: function () {
            return this.columns.lockedLeafColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListComponent.prototype, "nonLockedLeafColumns", {
        get: function () {
            return this.columns.nonLockedLeafColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListComponent.prototype, "lockedWidth", {
        get: function () {
            var groupCellsWidth = this.groups.length * 30;
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_19__columns_column_common__["a" /* expandColumns */])(this.lockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, groupCellsWidth);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListComponent.prototype, "nonLockedWidth", {
        get: function () {
            var nonLockedLeafColumns = this.nonLockedLeafColumns;
            if (this.lockedLeafColumns.length) {
                return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_19__columns_column_common__["a" /* expandColumns */])(nonLockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, 0);
            }
            if (this.rtl) {
                return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_19__columns_column_common__["a" /* expandColumns */])(nonLockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + curr.width; }, 0) || "100%";
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListComponent.prototype, "isLocked", {
        get: function () {
            return this.lockedLeafColumns.length > 0;
        },
        enumerable: true,
        configurable: true
    });
    ListComponent.prototype.ngOnInit = function () {
        this.init();
        this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowSync.bind(this)));
    };
    ListComponent.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils__["d" /* isChanged */])("skip", changes) && !this.rebind) {
            this.skipScroll = true;
            this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils__["e" /* anyChanged */])(["total", "take"], changes)) {
            this.init();
        }
        this.rebind = false;
    };
    ListComponent.prototype.ngAfterViewInit = function () {
        this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);
        this.attachContainerScroll();
        this.initResizeService();
    };
    ListComponent.prototype.syncRowsHeight = function () {
        if (this.lockedContainer) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__layout_row_sync__["a" /* syncRowsHeight */])(this.lockedTable.nativeElement, this.table.nativeElement);
        }
    };
    ListComponent.prototype.ngOnDestroy = function () {
        if (this.subscriptions) {
            this.subscriptions.unsubscribe();
        }
        if (this.resizeService) {
            this.resizeService.destroy();
        }
        this.cleanupScroller();
    };
    ListComponent.prototype.init = function () {
        if (this.suspendService.scroll) {
            return;
        }
        this.rowHeightService = new __WEBPACK_IMPORTED_MODULE_10__scrolling_row_height_service__["a" /* RowHeightService */](this.total, this.rowHeight, this.detailRowHeight);
        this.totalHeight = this.rowHeightService.totalHeight();
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils__["c" /* isUniversal */])()) {
            this.ngZone.runOutsideAngular(this.createScroller.bind(this));
        }
    };
    ListComponent.prototype.detailExpand = function (_a) {
        var index = _a.index, expand = _a.expand;
        if (expand) {
            this.rowHeightService.expandDetail(index);
        }
        else {
            this.rowHeightService.collapseDetail(index);
        }
        this.totalHeight = this.rowHeightService.totalHeight();
    };
    ListComponent.prototype.attachContainerScroll = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils__["c" /* isUniversal */])()) {
            this.ngZone.runOutsideAngular(function () {
                return _this.subscriptions.add(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].fromEvent(_this.container.nativeElement, 'scroll')
                    .map(function (event) { return event.target; })
                    .filter(function () { return !_this.suspendService.scroll; })
                    .do(_this.onContainerScroll.bind(_this))
                    .subscribe(_this.dispatcher));
            });
            this.scrollSyncService.registerEmitter(this.container.nativeElement, "body");
            if (this.lockedContainer) {
                this.subscriptions.add(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].fromEvent(this.lockedContainer.nativeElement, 'mousewheel')
                    .merge(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].fromEvent(this.lockedContainer.nativeElement, 'DOMMouseScroll'))
                    .filter(function (event) { return !event.ctrlKey; })
                    .do(preventLockedScroll(this.container.nativeElement))
                    .map(wheelDeltaY)
                    .subscribe(function (x) { return _this.container.nativeElement.scrollTop -= x; }));
                this.syncRowsHeight();
            }
        }
    };
    ListComponent.prototype.createScroller = function () {
        var _this = this;
        this.cleanupScroller();
        var observable = this.scroller
            .create(this.rowHeightService, this.skip, this.take, this.total);
        this.skipScroll = false;
        this.scrollerSubscription =
            observable
                .filter(function (x) { return x instanceof __WEBPACK_IMPORTED_MODULE_11__scrolling_scroller_service__["b" /* PageAction */]; })
                .filter(function () {
                var temp = _this.skipScroll;
                _this.skipScroll = false;
                return !temp;
            })
                .do(function () { return _this.rebind = true; })
                .subscribe(function (x) { return _this.ngZone.run(function () { return _this.pageChange.emit(x); }); })
                .add(observable
                .filter(function (x) { return x instanceof __WEBPACK_IMPORTED_MODULE_11__scrolling_scroller_service__["c" /* ScrollAction */]; })
                .subscribe(this.scroll.bind(this)));
    };
    ListComponent.prototype.scroll = function (_a) {
        var _b = _a.offset, offset = _b === void 0 ? 0 : _b;
        [
            maybeNativeElement(this.table),
            maybeNativeElement(this.lockedTable)
        ].filter(__WEBPACK_IMPORTED_MODULE_12__utils__["b" /* isPresent */]).forEach(translateY(this.renderer, offset));
    };
    ListComponent.prototype.onContainerScroll = function (_a) {
        var scrollTop = _a.scrollTop;
        if (this.lockedContainer) {
            this.lockedContainer.nativeElement.scrollTop = scrollTop;
        }
    };
    ListComponent.prototype.handleRowSync = function () {
        var _this = this;
        var filter = function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils__["b" /* isPresent */])(_this.lockedContainer); };
        return this.changeNotification.changes
            .merge(this.groupsService.changes
            .filter(filter)
            .switchMapTo(this.ngZone.onStable.asObservable().take(1)))
            .merge(this.editService.changed)
            .merge(this.resizeService.changes)
            .filter(filter)
            .subscribe(function () {
            var scrollTop = _this.container.nativeElement.scrollTop;
            _this.syncContainerHeight();
            _this.syncRowsHeight();
            _this.lockedContainer.nativeElement.scrollTop = _this.container.nativeElement.scrollTop = scrollTop;
            _this.resizeSensors.forEach(function (sensor) { return sensor.acceptSize(); });
        });
    };
    ListComponent.prototype.cleanupScroller = function () {
        if (this.scrollerSubscription) {
            this.scrollerSubscription.unsubscribe();
        }
        if (this.scroller) {
            this.scroller.destroy();
        }
    };
    ListComponent.prototype.initResizeService = function () {
        this.resizeService.connect(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].merge.apply(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"], this.resizeSensors.map(function (sensor) { return sensor.resize; })));
    };
    ListComponent.prototype.syncContainerHeight = function () {
        var _this = this;
        [maybeNativeElement(this.lockedContainer)]
            .filter(__WEBPACK_IMPORTED_MODULE_12__utils__["b" /* isPresent */])
            .map(function (el) {
            var height = _this.container.nativeElement.offsetHeight;
            if (hasScrollbar(_this.table, _this.container)) {
                height -= _this.scrollbarWidth;
            }
            return { el: el, height: height };
        })
            .forEach(setHeight(this.renderer));
    };
    return ListComponent;
}());

ListComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: SCROLLER_FACTORY_TOKEN,
                        useValue: DEFAULT_SCROLLER_FACTORY
                    }
                ],
                selector: 'kendo-grid-list',
                template: "\n    <div #lockedContainer class=\"k-grid-content-locked\"\n        *ngIf=\"isLocked\" [style.width.px]=\"lockedWidth\">\n        <div>\n            <table [locked]=\"true\" #lockedTable class=\"k-grid-table\">\n                <colgroup kendoGridColGroup\n                    [groups]=\"groups\"\n                    [columns]=\"lockedLeafColumns\"\n                    [detailTemplate]=\"detailTemplate\">\n                </colgroup>\n                <tbody kendoGridTableBody\n                    [groups]=\"groups\"\n                    [data]=\"data\"\n                    [noRecordsText]=\"''\"\n                    [columns]=\"lockedLeafColumns\"\n                    [detailTemplate]=\"detailTemplate\"\n                    [showGroupFooters]=\"showFooter\"\n                    [skip]=\"skip\"\n                    [selectable]=\"selectable\"\n                    [rowClass]=\"rowClass\">\n                </tbody>\n            </table>\n            <kendo-resize-sensor></kendo-resize-sensor>\n        </div>\n        <div class=\"k-height-container\">\n            <div [style.height.px]=\"totalHeight\"></div>\n        </div>\n    </div><div #container class=\"k-grid-content k-virtual-content\"\n        [kendoGridResizableContainer]=\"lockedLeafColumns.length\"\n        [lockedWidth]=\"lockedWidth + 1\">\n        <div>\n            <table [style.width.px]=\"nonLockedWidth\" #table\n                class=\"k-grid-table\">\n                <colgroup kendoGridColGroup\n                    [groups]=\"isLocked ? [] : groups\"\n                    [columns]=\"nonLockedLeafColumns\"\n                    [detailTemplate]=\"detailTemplate\">\n                </colgroup>\n                <tbody kendoGridTableBody\n                    [skipGroupDecoration]=\"isLocked\"\n                    [data]=\"data\"\n                    [groups]=\"groups\"\n                    [showGroupFooters]=\"showFooter\"\n                    [columns]=\"nonLockedLeafColumns\"\n                    [detailTemplate]=\"detailTemplate\"\n                    [noRecordsTemplate]=\"noRecordsTemplate\"\n                    [lockedColumnsCount]=\"lockedLeafColumns.length\"\n                    [skip]=\"skip\"\n                    [selectable]=\"selectable\"\n                    [rowClass]=\"rowClass\">\n                </tbody>\n            </table>\n            <kendo-resize-sensor *ngIf=\"isLocked\"></kendo-resize-sensor>\n        </div>\n        <kendo-resize-sensor *ngIf=\"isLocked\"></kendo-resize-sensor>\n        <div class=\"k-height-container\">\n            <div [style.height.px]=\"totalHeight\"></div>\n        </div>\n    </div>\n    "
            },] },
];
/** @nocollapse */
ListComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [SCROLLER_FACTORY_TOKEN,] },] },
    { type: __WEBPACK_IMPORTED_MODULE_13__details_details_service__["a" /* DetailsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_15__data_change_notification_service__["a" /* ChangeNotificationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_17__scrolling_suspend_service__["a" /* SuspendService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_18__grouping_groups_service__["a" /* GroupsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_20__scrolling_scroll_sync_service__["a" /* ScrollSyncService */], },
    { type: __WEBPACK_IMPORTED_MODULE_21__layout_resize_service__["a" /* ResizeService */], },
    { type: __WEBPACK_IMPORTED_MODULE_24__editing_edit_service__["a" /* EditService */], },
    { type: __WEBPACK_IMPORTED_MODULE_23__layout_browser_support_service__["a" /* BrowserSupportService */], },
]; };
ListComponent.propDecorators = {
    'hostClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-grid-container",] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'total': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailRowHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'take': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skip': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'noRecordsTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selectable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groupable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'container': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["container",] },],
    'lockedContainer': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["lockedContainer",] },],
    'lockedTable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["lockedTable",] },],
    'table': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ["table",] },],
    'resizeSensors': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: [__WEBPACK_IMPORTED_MODULE_22__progress_kendo_angular_resize_sensor__["a" /* ResizeSensorComponent */],] },],
};


/***/ }),
/* 365 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TableBodyComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__columns_column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__details_details_service__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__grouping_groups_service__ = __webpack_require__(125);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__data_change_notification_service__ = __webpack_require__(174);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__editing_edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__columns_column_common__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__common_dom_queries__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__common_dom_events_service__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__selection_selection_service__ = __webpack_require__(91);












var NON_DATA_CELL_CLASSES = 'k-hierarchy-cell k-detail-cell k-group-cell';
var NON_DATA_ROW_CLASSES = 'k-grouping-row k-group-footer k-detail-row k-grid-norecords';
var IGNORE_TARGET_CLASSSES = 'k-icon';
var IGNORE_CONTAINER_CLASSES = 'k-widget k-grid-ignore-click';
var columnCellIndex = function (cell, cells) {
    var cellIndex = 0;
    for (var idx = 0; idx < cells.length; idx++) {
        if (cells[idx] === cell) {
            return cellIndex;
        }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["f" /* hasClasses */])(cells[idx], 'k-hierarchy-cell k-group-cell')) {
            cellIndex++;
        }
    }
};
/**
 * @hidden
 */
var TableBodyComponent = (function () {
    function TableBodyComponent(detailsService, groupsService, changeNotification, editService, localization, ngZone, renderer, element, domEvents, selectionService) {
        this.detailsService = detailsService;
        this.groupsService = groupsService;
        this.changeNotification = changeNotification;
        this.editService = editService;
        this.localization = localization;
        this.ngZone = ngZone;
        this.renderer = renderer;
        this.element = element;
        this.domEvents = domEvents;
        this.selectionService = selectionService;
        this.columns = [];
        this.groups = [];
        this.skip = 0;
        this.noRecordsText = this.localization.get('noRecords');
        this.skipGroupDecoration = false;
        this.showGroupFooters = false;
        this.lockedColumnsCount = 0;
        this.rowClass = function () { return null; };
    }
    Object.defineProperty(TableBodyComponent.prototype, "newDataItem", {
        get: function () {
            return this.editService.newDataItem;
        },
        enumerable: true,
        configurable: true
    });
    TableBodyComponent.prototype.toggleRow = function (index, dataItem) {
        this.detailsService.toggleRow(index, dataItem);
        return false;
    };
    TableBodyComponent.prototype.trackByFn = function (_, item) {
        return item.data ? item.data : item;
    };
    TableBodyComponent.prototype.isExpanded = function (index) {
        return this.detailsService.isExpanded(index);
    };
    TableBodyComponent.prototype.detailButtonStyles = function (index) {
        var expanded = this.isExpanded(index);
        return { 'k-minus': expanded, 'k-plus': !expanded };
    };
    TableBodyComponent.prototype.isGroup = function (item) {
        return item.type === 'group';
    };
    TableBodyComponent.prototype.isDataItem = function (item) {
        return !this.isGroup(item) && !this.isFooter(item);
    };
    TableBodyComponent.prototype.isFooter = function (item) {
        return item.type === 'footer';
    };
    TableBodyComponent.prototype.isInExpandedGroup = function (item) {
        return this.groupsService.isInExpandedGroup(item.groupIndex, false);
    };
    TableBodyComponent.prototype.isParentGroupExpanded = function (item) {
        return this.groupsService.isInExpandedGroup(item.index || item.groupIndex);
    };
    TableBodyComponent.prototype.isOdd = function (item) {
        return item.index % 2 === 0;
    };
    TableBodyComponent.prototype.isSelectable = function () {
        return this.selectable && this.selectable.enabled !== false;
    };
    TableBodyComponent.prototype.isRowSelected = function (item) {
        return this.selectionService.isSelected(item.index);
    };
    TableBodyComponent.prototype.selectionCheckboxId = function (itemIndex) {
        return "k-grid" + this.selectionService.id + "-checkbox" + itemIndex;
    };
    TableBodyComponent.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["d" /* isChanged */])("columns", changes, false)) {
            this.changeNotification.notify();
        }
    };
    TableBodyComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.ngZone.runOutsideAngular(function () {
            var clickHandler = _this.clickHandler.bind(_this);
            var mousedownSubscription = _this.renderer.listen(_this.element.nativeElement, 'mousedown', clickHandler);
            var clickSubscription = _this.renderer.listen(_this.element.nativeElement, 'click', clickHandler);
            var contextmenuSubscription = _this.renderer.listen(_this.element.nativeElement, 'contextmenu', clickHandler);
            _this.clickSubscription = function () {
                mousedownSubscription();
                clickSubscription();
                contextmenuSubscription();
            };
        });
    };
    TableBodyComponent.prototype.ngOnDestroy = function () {
        if (this.clickSubscription) {
            this.clickSubscription();
        }
    };
    Object.defineProperty(TableBodyComponent.prototype, "columnsSpan", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__columns_column_common__["e" /* columnsSpan */])(this.columns);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TableBodyComponent.prototype, "colSpan", {
        get: function () {
            return this.columnsSpan + this.groups.length + (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["b" /* isPresent */])(this.detailTemplate) ? 1 : 0);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TableBodyComponent.prototype, "footerColumns", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__columns_column_common__["c" /* columnsToRender */])(this.columns);
        },
        enumerable: true,
        configurable: true
    });
    TableBodyComponent.prototype.showGroupHeader = function (item) {
        return !item.data.skipHeader;
    };
    TableBodyComponent.prototype.isSpanColumn = function (column) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__columns_column_base__["b" /* isSpanColumn */])(column) && !column.templateRef;
    };
    TableBodyComponent.prototype.isCheckboxColumn = function (column) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__columns_column_base__["c" /* isCheckboxColumn */])(column) && !column.templateRef;
    };
    TableBodyComponent.prototype.childColumns = function (column) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__columns_column_common__["c" /* columnsToRender */])([column]);
    };
    TableBodyComponent.prototype.isBoundColumn = function (column) {
        return column.field && !column.templateRef;
    };
    TableBodyComponent.prototype.clickHandler = function (eventArg) {
        var target = eventArg.target;
        var cell = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["a" /* closest */])(target, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["c" /* matchesNodeName */])('td'));
        var row = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["a" /* closest */])(cell, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["c" /* matchesNodeName */])('tr'));
        var body = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["a" /* closest */])(row, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["c" /* matchesNodeName */])('tbody'));
        if (cell && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["f" /* hasClasses */])(cell, NON_DATA_CELL_CLASSES) &&
            !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["f" /* hasClasses */])(row, NON_DATA_ROW_CLASSES) &&
            body === this.element.nativeElement) {
            this.editService.preventCellClose();
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["g" /* isFocusable */])(target, false) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["c" /* matchesNodeName */])('label')(target) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["f" /* hasClasses */])(target, IGNORE_TARGET_CLASSSES) &&
                !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["h" /* closestInScope */])(target, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_queries__["b" /* matchesClasses */])(IGNORE_CONTAINER_CLASSES), cell)) {
                var args = this.cellClickArgs(cell, row, eventArg);
                if (eventArg.type === 'mousedown') {
                    this.domEvents.cellMousedown.emit(args);
                }
                else {
                    if (args.isEditedColumn || !this.editService.closeCell(eventArg)) {
                        this.domEvents.cellClick.emit(Object.assign(args, {
                            isEdited: args.isEditedRow || args.isEditedColumn
                        }));
                    }
                }
            }
        }
    };
    TableBodyComponent.prototype.cellClickArgs = function (cell, row, eventArg) {
        var index = columnCellIndex(cell, row.cells);
        var column = this.columns.toArray()[index];
        var columnIndex = this.lockedColumnsCount + index;
        var rowIndex = row.getAttribute('data-kendo-grid-item-index');
        rowIndex = rowIndex ? parseInt(rowIndex, 10) : -1;
        var dataItem = rowIndex === -1 ? this.editService.newDataItem : this.data.at(rowIndex - this.skip);
        var isEditedColumn = this.editService.isEditedColumn(rowIndex, column);
        var isEditedRow = this.editService.isEdited(rowIndex);
        return {
            column: column,
            columnIndex: columnIndex,
            dataItem: dataItem,
            isEditedColumn: isEditedColumn,
            isEditedRow: isEditedRow,
            originalEvent: eventArg,
            rowIndex: rowIndex,
            type: eventArg.type
        };
    };
    return TableBodyComponent;
}());

TableBodyComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridTableBody]',
                template: "\n    <ng-template [ngIf]=\"editService.hasNewItem\">\n        <tr class=\"k-grid-add-row k-grid-edit-row\">\n            <ng-template [ngIf]=\"!skipGroupDecoration\">\n                <td [class.k-group-cell]=\"true\" *ngFor=\"let g of groups\"></td>\n            </ng-template>\n            <td [class.k-hierarchy-cell]=\"true\"\n                *ngIf=\"detailTemplate?.templateRef\">\n            </td>\n            <td\n                kendoGridCell\n                [rowIndex]=\"-1\"\n                [isNew]=\"true\"\n                [column]=\"column\"\n                [dataItem]=\"newDataItem\"\n                [ngClass]=\"column.cssClass\"\n                [ngStyle]=\"column.style\"\n                [attr.colspan]=\"column.colspan\"\n                *ngFor=\"let column of columns; let columnIndex = index\">\n                <ng-template\n                    [templateContext]=\"{\n                        templateRef: column.templateRef,\n                        dataItem: newDataItem,\n                        column: column,\n                        columnIndex: columnIndex,\n                        rowIndex: -1,\n                        isNew: true,\n                        $implicit: newDataItem\n                        }\">\n                </ng-template>\n                <ng-template [ngIf]=\"isBoundColumn(column)\">{{newDataItem | valueOf: column.field: column.format}}</ng-template>\n            </td>\n        </tr>\n    </ng-template>\n    <tr *ngIf=\"data?.length === 0 || data == null\" class=\"k-grid-norecords\">\n        <td [attr.colspan]=\"colSpan\">\n            <ng-template\n                [ngIf]=\"noRecordsTemplate?.templateRef\"\n                [templateContext]=\"{\n                    templateRef: noRecordsTemplate?.templateRef\n                 }\">\n            </ng-template>\n            <ng-container *ngIf=\"!noRecordsTemplate?.templateRef\">\n                {{noRecordsText}}\n            </ng-container>\n        </td>\n    </tr>\n    <ng-template ngFor\n        [ngForOf]=\"data\"\n        [ngForTrackBy]=\"trackByFn\"\n        let-item>\n        <tr *ngIf=\"isGroup(item) && isParentGroupExpanded(item) && showGroupHeader(item)\"\n            kendoGridGroupHeader\n            [columns]=\"columns\"\n            [groups]=\"groups\"\n            [item]=\"item\"\n            [hasDetails]=\"detailTemplate?.templateRef\"\n            [skipGroupDecoration]=\"skipGroupDecoration\">\n        </tr>\n        <tr\n            *ngIf=\"isDataItem(item) && isInExpandedGroup(item)\"\n            [ngClass]=\"rowClass({ dataItem: item.data, index: item.index })\"\n            [class.k-alt]=\"isOdd(item)\"\n            [class.k-master-row]=\"detailTemplate?.templateRef\"\n            [class.k-grid-edit-row]=\"editService.hasEdited(item.index)\"\n            [attr.data-kendo-grid-item-index]=\"item.index\"\n            [class.k-state-selected]=\"isSelectable() && isRowSelected(item)\">\n            <ng-template [ngIf]=\"!skipGroupDecoration\">\n                <td [class.k-group-cell]=\"true\" *ngFor=\"let g of groups\"></td>\n            </ng-template>\n            <td [class.k-hierarchy-cell]=\"true\"\n                *ngIf=\"detailTemplate?.templateRef\">\n                <a class=\"k-icon\"\n                    *ngIf=\"detailTemplate.showIf(item.data, item.index)\"\n                    [ngClass]=\"detailButtonStyles(item.index)\"\n                    href=\"#\" tabindex=\"-1\" (click)=\"toggleRow(item.index, item.data)\"></a>\n            </td>\n            <td\n                kendoGridCell\n                [rowIndex]=\"item.index\"\n                [column]=\"column\"\n                [dataItem]=\"item.data\"\n                [ngClass]=\"column.cssClass\"\n                [class.k-grid-edit-cell]=\"editService.isEditedColumn(item.index, column)\"\n                [ngStyle]=\"column.style\"\n                [attr.colspan]=\"column.colspan\"\n                *ngFor=\"let column of columns; let columnIndex = index\">\n                <ng-template\n                    [templateContext]=\"{\n                        templateRef: column.templateRef,\n                        dataItem: item.data,\n                        column: column,\n                        columnIndex: lockedColumnsCount + columnIndex,\n                        rowIndex: item.index,\n                        $implicit: item.data\n                        }\">\n                </ng-template>\n                <ng-template [ngIf]=\"isSpanColumn(column)\">\n                    <ng-template ngFor let-childColumn [ngForOf]=\"childColumns(column)\">\n                        {{item.data | valueOf: childColumn.field: childColumn.format}}\n                    </ng-template>\n                </ng-template>\n                <ng-template [ngIf]=\"isBoundColumn(column)\">{{item.data | valueOf: column.field: column.format}}</ng-template>\n                <ng-template [ngIf]=\"isCheckboxColumn(column)\">\n                    <input class=\"k-checkbox\" [kendoGridSelectionCheckbox]=\"item.index\" [attr.id]=\"selectionCheckboxId(item.index)\">\n                    <label class=\"k-checkbox-label\" [attr.for]=\"selectionCheckboxId(item.index)\"></label>\n                </ng-template>\n            </td>\n        </tr>\n        <tr *ngIf=\"isDataItem(item) && isInExpandedGroup(item) && detailTemplate?.templateRef &&\n            detailTemplate.showIf(item.data, item.index) && isExpanded(item.index)\"\n            [class.k-detail-row]=\"true\"\n            [class.k-alt]=\"isOdd(item)\">\n            <td [class.k-group-cell]=\"true\" *ngFor=\"let g of groups\"></td>\n            <td [class.k-hierarchy-cell]=\"true\"></td>\n            <td [class.k-detail-cell]=\"true\"\n                [attr.colspan]=\"columnsSpan\">\n                <ng-template\n                    [templateContext]=\"{\n                        templateRef: detailTemplate?.templateRef,\n                        dataItem: item.data,\n                        rowIndex: item.index,\n                        $implicit: item.data\n                        }\">\n                </ng-template>\n            </td>\n        </tr>\n        <tr *ngIf=\"isFooter(item) && (isInExpandedGroup(item) || (showGroupFooters && isParentGroupExpanded(item)))\n            && !item.data.hideFooter\"\n            [class.k-group-footer]=\"true\">\n            <ng-template [ngIf]=\"!skipGroupDecoration\">\n                <td [class.k-group-cell]=\"true\" *ngFor=\"let g of groups\"></td>\n            </ng-template>\n            <td [class.k-hierarchy-cell]=\"true\"\n                *ngIf=\"detailTemplate?.templateRef\">\n            </td>\n            <td\n                *ngFor=\"let column of footerColumns; let columnIndex = index\">\n                <ng-template\n                    [templateContext]=\"{\n                        templateRef: column.groupFooterTemplateRef,\n                        group: item.data,\n                        field: column.field,\n                        column: column,\n                        $implicit: item.data?.aggregates\n                        }\">\n                </ng-template>\n           </td>\n        </tr>\n    </ng-template>\n    "
            },] },
];
/** @nocollapse */
TableBodyComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__details_details_service__["a" /* DetailsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_3__grouping_groups_service__["a" /* GroupsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__data_change_notification_service__["a" /* ChangeNotificationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_6__editing_edit_service__["a" /* EditService */], },
    { type: __WEBPACK_IMPORTED_MODULE_7__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_10__common_dom_events_service__["a" /* DomEventsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_11__selection_selection_service__["a" /* SelectionService */], },
]; };
TableBodyComponent.propDecorators = {
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'noRecordsTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'data': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skip': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selectable': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'noRecordsText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skipGroupDecoration': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'showGroupFooters': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'lockedColumnsCount': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 366 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__grid_component__ = __webpack_require__(34);


/**
 * @hidden
 */
var ToolbarComponent = (function () {
    function ToolbarComponent(grid) {
        this.grid = grid;
    }
    Object.defineProperty(ToolbarComponent.prototype, "classNames", {
        get: function () {
            return 'k-header k-grid-toolbar';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ToolbarComponent.prototype, "toolbarTemplateRef", {
        get: function () {
            return this.grid.toolbarTemplate ? this.grid.toolbarTemplate.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    return ToolbarComponent;
}());

ToolbarComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-toolbar',
                template: "\n        <ng-template\n            *ngIf=\"toolbarTemplateRef\"\n            [ngTemplateOutlet]=\"toolbarTemplateRef\">\n        </ng-template>\n    "
            },] },
];
/** @nocollapse */
ToolbarComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__grid_component__["a" /* GridComponent */], },
]; };
ToolbarComponent.propDecorators = {
    'classNames': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class',] },],
};


/***/ }),
/* 367 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollSyncService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_of__ = __webpack_require__(241);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_of__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_distinctUntilChanged__ = __webpack_require__(147);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_distinctUntilChanged___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_distinctUntilChanged__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_do__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_do__);










/**
 * @hidden
 */
var ScrollSyncService = (function () {
    function ScrollSyncService(ngZone) {
        this.ngZone = ngZone;
        this.changes = new __WEBPACK_IMPORTED_MODULE_3_rxjs_Subject__["Subject"]();
        this.elements = [];
        this.changeSubscription = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__["Subscription"](function () { });
        this.headerSubscription = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__["Subscription"](function () { });
        this.bodySubscription = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__["Subscription"](function () { });
        this.changeSubscription.add(this.changes
            .distinctUntilChanged(function (x, y) { return x.scrollLeft === y.scrollLeft; })
            .subscribe(this.scrollLeft.bind(this)));
    }
    ScrollSyncService.prototype.registerEmitter = function (el, sourceType) {
        var _this = this;
        this.unregister(sourceType);
        this.elements.push({ element: el, sourceType: sourceType });
        if (sourceType === "body" || sourceType === "header") {
            this.ngZone.runOutsideAngular(function () {
                var obs = __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].fromEvent(el, "scroll")
                    .map(function (_a) {
                    var _b = _a.target, scrollLeft = _b.scrollLeft, scrollRight = _b.scrollRight;
                    return ({
                        scrollLeft: scrollLeft,
                        scrollRight: scrollRight,
                        sourceType: sourceType
                    });
                });
                var subscription = obs.filter(function (x) { return !_this.source || _this.source === x.sourceType; })
                    .do(function (x) { return _this.source = x.sourceType; })
                    .subscribe(function (x) { return _this.changes.next(x); });
                subscription.add(obs.filter(function (x) { return _this.source && _this.source !== x.sourceType; })
                    .subscribe(function () { return _this.source = undefined; }));
                if (sourceType === "body") {
                    _this.bodySubscription.add(subscription);
                }
                else {
                    _this.headerSubscription.add(subscription);
                }
            });
        }
    };
    /**
     * destroy
     */
    ScrollSyncService.prototype.destroy = function () {
        this.changeSubscription.unsubscribe();
        this.headerSubscription.unsubscribe();
        this.bodySubscription.unsubscribe();
    };
    ScrollSyncService.prototype.scrollLeft = function (_a) {
        var _this = this;
        var scrollLeft = _a.scrollLeft, sourceType = _a.sourceType;
        this.ngZone.runOutsideAngular(function () {
            _this.elements
                .filter(function (x) { return sourceType !== x.sourceType; })
                .forEach(function (_a) {
                var element = _a.element;
                return element.scrollLeft = scrollLeft;
            });
        });
    };
    ScrollSyncService.prototype.unregister = function (sourceType) {
        var index = this.elements.findIndex(function (x) { return x.sourceType === sourceType; });
        if (index > -1) {
            if (sourceType === "header") {
                this.headerSubscription.unsubscribe();
            }
            else if (sourceType === "body") {
                this.bodySubscription.unsubscribe();
            }
            this.elements.splice(index, 1);
        }
    };
    return ScrollSyncService;
}());

ScrollSyncService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ScrollSyncService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 368 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Selection; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(7);
/* tslint:disable:no-input-rename */


/**
 * @hidden
 */
var Selection = (function () {
    function Selection(grid) {
        this.grid = grid;
        /**
         * Defines the collection that will store the selected item keys.
         */
        this.selectedKeys = [];
        /**
         * Fires when the `selectedKeys` collection has been updated.
         */
        this.selectedKeysChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.init();
    }
    Selection.prototype.init = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["b" /* isPresent */])(this.grid.rowSelected)) {
            this.grid.rowSelected = function (row) {
                return _this.selectedKeys.indexOf(_this.getItemKey(row)) >= 0;
            };
        }
        this.selectionChangeSubscription = this.grid
            .selectionChange
            .subscribe(this.onSelectionChange.bind(this));
    };
    /**
     * @hidden
     */
    Selection.prototype.destroy = function () {
        this.selectionChangeSubscription.unsubscribe();
    };
    /**
     * @hidden
     */
    Selection.prototype.reset = function () {
        this.selectedKeys.splice(0, this.selectedKeys.length);
    };
    Selection.prototype.getItemKey = function (row) {
        if (this.selectionKey) {
            if (typeof this.selectionKey === "string") {
                return row.dataItem[this.selectionKey];
            }
            if (typeof this.selectionKey === "function") {
                return this.selectionKey(row);
            }
        }
        return row.index;
    };
    Selection.prototype.onSelectionChange = function (selection) {
        var _this = this;
        selection.deselectedRows.forEach(function (item) {
            var itemKey = _this.getItemKey(item);
            var itemIndex = _this.selectedKeys.indexOf(itemKey);
            if (itemIndex >= 0) {
                _this.selectedKeys.splice(itemIndex, 1);
            }
        });
        if (this.grid.selectableSettings.mode === "single" && this.selectedKeys.length > 0) {
            this.reset();
        }
        selection.selectedRows.forEach(function (item) {
            var itemKey = _this.getItemKey(item);
            if (_this.selectedKeys.indexOf(itemKey) < 0) {
                _this.selectedKeys.push(itemKey);
            }
        });
        this.selectedKeysChange.emit(this.selectedKeys);
    };
    return Selection;
}());

Selection.propDecorators = {
    'selectedKeys': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selectionKey': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["kendoGridSelectBy",] },],
    'selectedKeysChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
};


/***/ }),
/* 369 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectionDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__selection_default__ = __webpack_require__(368);




/**
 * A directive which stores the row selection state of the Grid in memory.
 */
var SelectionDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](SelectionDirective, _super);
    function SelectionDirective(grid) {
        var _this = _super.call(this, grid) || this;
        _this.grid = grid;
        return _this;
    }
    /**
     * @hidden
     */
    SelectionDirective.prototype.ngOnInit = function () {
        if (this.grid.selectable === false) {
            this.grid.selectable = true;
        }
        this.grid.selectionDirective = true;
    };
    /**
     * @hidden
     */
    SelectionDirective.prototype.ngOnDestroy = function () {
        _super.prototype.destroy.call(this);
    };
    return SelectionDirective;
}(__WEBPACK_IMPORTED_MODULE_3__selection_default__["a" /* Selection */]));

SelectionDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoGridSelectBy]'
            },] },
];
/** @nocollapse */
SelectionDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__grid_component__["a" /* GridComponent */], },
]; };


/***/ }),
/* 370 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return KendoDraggableDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__telerik_kendo_draggable__ = __webpack_require__(471);


/**
 * @hidden
 */
var KendoDraggableDirective = (function () {
    function KendoDraggableDirective(ngEl) {
        var _this = this;
        this.kendoDrag = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.kendoPress = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.kendoRelease = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.draggable = new __WEBPACK_IMPORTED_MODULE_1__telerik_kendo_draggable__["a" /* default */]({
            drag: function (e) {
                if (e.hasOwnProperty("originalEvent")) {
                    e.originalEvent.preventDefault();
                }
                _this.kendoDrag.next(e);
            },
            press: function (e) { return _this.kendoPress.next(e); },
            release: function (e) { return _this.kendoRelease.next(e); }
        });
        this.draggable.bindTo(ngEl.nativeElement);
    }
    KendoDraggableDirective.prototype.ngOnDestroy = function () {
        this.draggable.destroy();
    };
    return KendoDraggableDirective;
}());

KendoDraggableDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoDraggable]'
            },] },
];
/** @nocollapse */
KendoDraggableDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
]; };
KendoDraggableDirective.propDecorators = {
    'kendoDrag': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'kendoPress': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'kendoRelease': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
};


/***/ }),
/* 371 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EventsOutsideAngularDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/* tslint:disable:no-input-rename */
/**
 * @hidden
 */
var EventsOutsideAngularDirective = (function () {
    function EventsOutsideAngularDirective(element, ngZone, renderer) {
        this.element = element;
        this.ngZone = ngZone;
        this.renderer = renderer;
        this.events = {};
    }
    EventsOutsideAngularDirective.prototype.ngOnInit = function () {
        var _this = this;
        if (!this.element || !this.element.nativeElement) {
            return;
        }
        var events = this.events;
        this.subscriptions = [];
        this.ngZone.runOutsideAngular(function () {
            for (var name_1 in events) {
                if (events.hasOwnProperty(name_1)) {
                    _this.subscriptions.push(_this.renderer.listen(_this.element.nativeElement, name_1, events[name_1]));
                }
            }
        });
    };
    EventsOutsideAngularDirective.prototype.ngOnDestroy = function () {
        if (this.subscriptions) {
            for (var idx = 0; idx < this.subscriptions.length; idx++) {
                this.subscriptions[idx]();
            }
            this.subscriptions = null;
        }
    };
    return EventsOutsideAngularDirective;
}());

EventsOutsideAngularDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoEventsOutsideAngular]'
            },] },
];
/** @nocollapse */
EventsOutsideAngularDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
]; };
EventsOutsideAngularDirective.propDecorators = {
    'events': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ['kendoEventsOutsideAngular',] },],
};


/***/ }),
/* 372 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return fractionLength; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return toFixedPrecision; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return add; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return subtract; });
/* unused harmony export multiply */
/* unused harmony export divide */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return remainder; });
var MAX_PRECISION = 20;
/**
 * @hidden
 */
var fractionLength = function (value) {
    return (String(value).split('.')[1] || "").length;
};
var maxFractionLength = function (value1, value2) {
    return Math.max(fractionLength(value1), fractionLength(value2));
};
/**
 * @hidden
 */
var toFixedPrecision = function (value, precision) {
    var maxPrecision = Math.min(precision, MAX_PRECISION);
    return parseFloat(value.toFixed(maxPrecision));
};
/**
 * @hidden
 */
var add = function (value1, value2) {
    var maxPrecision = maxFractionLength(value1, value2);
    return toFixedPrecision(value1 + value2, maxPrecision);
};
/**
 * @hidden
 */
var subtract = function (value1, value2) {
    return add(value1, -value2);
};
/**
 * @hidden
 */
var multiply = function (value1, value2) {
    var maxPrecision = fractionLength(value1) + fractionLength(value2);
    return toFixedPrecision(value1 * value2, maxPrecision);
};
/**
 * @hidden
 */
var divide = function (dividend, divisor) {
    if (divisor === 0) {
        return NaN;
    }
    var power = maxFractionLength(dividend, divisor);
    var correctionValue = Math.pow(10, power);
    return ((correctionValue * dividend) / (correctionValue * divisor));
};
/**
 * @hidden
 */
var remainder = function (dividend, divisor) {
    return Math.abs(subtract(dividend, multiply(divisor, Math.floor(divide(dividend, divisor)))));
};


/***/ }),
/* 373 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DraggableModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_draggable__ = __webpack_require__(370);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);




/**
 * @hidden
 */
/**
 * @hidden
 */
var DraggableModule = (function () {
    function DraggableModule() {
    }
    return DraggableModule;
}());

DraggableModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [__WEBPACK_IMPORTED_MODULE_1__common_draggable__["a" /* KendoDraggableDirective */]],
                exports: [__WEBPACK_IMPORTED_MODULE_1__common_draggable__["a" /* KendoDraggableDirective */]],
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"]],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
DraggableModule.ctorParameters = function () { return []; };


/***/ }),
/* 374 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slider_slider_component__ = __webpack_require__(387);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__switch_switch_component__ = __webpack_require__(390);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__textbox_textbox_container_component__ = __webpack_require__(392);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__textbox_textbox_directive__ = __webpack_require__(204);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__numerictextbox_numerictextbox_component__ = __webpack_require__(383);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__numerictextbox_localization_custom_messages_component__ = __webpack_require__(381);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__maskedtextbox_maskedtextbox_component__ = __webpack_require__(376);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__inputs_module__ = __webpack_require__(607);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__common_draggable__ = __webpack_require__(370);
/* unused harmony reexport KendoDraggableDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__slider_slider_ticks_component__ = __webpack_require__(386);
/* unused harmony reexport SliderTicksComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__slider_module__ = __webpack_require__(384);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__switch_module__ = __webpack_require__(388);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__numerictextbox_module__ = __webpack_require__(379);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__maskedtextbox_module__ = __webpack_require__(375);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__textbox_module__ = __webpack_require__(391);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__common_events_outside_angular_directive__ = __webpack_require__(371);
/* unused harmony reexport SliderComponent */
/* unused harmony reexport SwitchComponent */
/* unused harmony reexport NumericTextBoxComponent */
/* unused harmony reexport NumericTextBoxCustomMessagesComponent */
/* unused harmony reexport MaskedTextBoxComponent */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_7__inputs_module__["a"]; });
/* unused harmony reexport SliderModule */
/* unused harmony reexport SwitchModule */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_12__numerictextbox_module__["a"]; });
/* unused harmony reexport MaskedTextBoxModule */
/* unused harmony reexport TextBoxContainerComponent */
/* unused harmony reexport TextBoxDirective */
/* unused harmony reexport TextBoxModule */
/* unused harmony reexport EventsOutsideAngularDirective */



















/***/ }),
/* 375 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MaskedTextBoxModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__maskedtextbox_maskedtextbox_component__ = __webpack_require__(376);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);




/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the MaskedTextBox component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the MaskedTextBox module
 * import { MaskedTextBoxModule } from '@progress/kendo-angular-inputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, MaskedTextBoxModule], // import MaskedTextBox module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var MaskedTextBoxModule = (function () {
    function MaskedTextBoxModule() {
    }
    return MaskedTextBoxModule;
}());

MaskedTextBoxModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [__WEBPACK_IMPORTED_MODULE_1__maskedtextbox_maskedtextbox_component__["a" /* MaskedTextBoxComponent */]],
                exports: [__WEBPACK_IMPORTED_MODULE_1__maskedtextbox_maskedtextbox_component__["a" /* MaskedTextBoxComponent */]],
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"]],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
MaskedTextBoxModule.ctorParameters = function () { return []; };


/***/ }),
/* 376 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MaskedTextBoxComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__masking_service__ = __webpack_require__(608);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_changes__ = __webpack_require__(202);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_dom_utils__ = __webpack_require__(70);






var resolvedPromise = Promise.resolve(null);
/**
 * Represents the Kendo UI MaskedTextBox component for Angular.
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *     selector: 'my-app',
 *     template: `
 *      <kendo-maskedtextbox
 *          [mask]="mask1"
 *          [value]="value2">
 *      </kendo-maskedtextbox>
 *     `
 * })
 *
 * class AppComponent {
 *  public value1: number = 9580128055807792;
 *  public mask1: string = "0000-0000-0000-0000";
 * }
 * ```
 */
var MaskedTextBoxComponent = (function () {
    function MaskedTextBoxComponent(service, renderer, hostElement, rtl) {
        this.service = service;
        this.renderer = renderer;
        this.hostElement = hostElement;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_dom_utils__["a" /* guid */])();
        /**
         * Determines whether the component is disabled.
         */
        this.disabled = false;
        /**
         * A prompt character for the masked value.
         * @default `_`
         */
        this.prompt = '_';
        /**
         * A character representing an empty position in the raw value.
         * @default ' '
         */
        this.promptPlaceholder = ' ';
        /**
         * Indicates whether to include literals in the raw value.
         * @default false
         */
        this.includeLiterals = false;
        /**
         * Determines whether the built-in mask validator is enforced when validating a form.
         * @default true
         */
        this.maskValidation = true;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Fires each time the user focuses the input element.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-maskedtextbox (focus)="handleFocus()"></kendo-maskedtextbox>
         * `
         * })
         * class AppComponent {
         *   public handleFocus(): void {
         *      console.log("Component is focused");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onFocus` property.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-maskedtextbox (blur)="handleBlur()"></kendo-maskedtextbox>
         * `
         * })
         * class AppComponent {
         *   public handleBlur(): void {
         *      console.log("Component is blurred");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onBlur` property.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the value changes.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.focused = false;
        this.defaultRules = {
            "#": /[\d\s\+\-]/,
            "&": /[\S]/,
            "0": /[\d]/,
            "9": /[\d\s]/,
            "?": /[a-zA-Z\s]/,
            "A": /[a-zA-Z0-9]/,
            "C": /./,
            "L": /[a-zA-Z]/,
            "a": /[a-zA-Z0-9\s]/
        };
        this.isPasted = false;
        this.selection = [0, 0];
        this.onChange = function (_) { };
        this.onTouched = function () { };
        this.direction = rtl ? 'rtl' : 'ltr';
        this.updateService();
        this.hostElement = hostElement.nativeElement;
    }
    Object.defineProperty(MaskedTextBoxComponent.prototype, "hostClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskedTextBoxComponent.prototype, "hostFocusedClass", {
        get: function () {
            return this.focused;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskedTextBoxComponent.prototype, "hostDisabledClass", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskedTextBoxComponent.prototype, "rules", {
        /**
         * Exposes the RegExp-based mask validation array.
         */
        get: function () {
            return this._rules || this.defaultRules;
        },
        set: function (value) {
            this._rules = Object.assign({}, this.defaultRules, value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskedTextBoxComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    MaskedTextBoxComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.hostElement, "tabindex");
    };
    /**
     * @hidden
     * Used by the TextBoxContainer to determine if the component is empty.
     */
    MaskedTextBoxComponent.prototype.isEmpty = function () {
        return !this.mask;
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.handleFocus = function (event) {
        this.focused = true;
        this.onFocus.emit(event);
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.handleBlur = function (event) {
        this.focused = false;
        this.onBlur.emit(event);
        this.onTouched();
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.handleDragDrop = function () {
        return false;
    };
    /**
     * Focuses the MaskedTextBox component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="maskedinput.focus()">Focus the input</button>
     *  <kendo-maskedtextbox #maskedinput></kendo-maskedtextbox>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    MaskedTextBoxComponent.prototype.focus = function () {
        if (!this.input) {
            return;
        }
        this.input.nativeElement.focus();
    };
    /**
     * Blurs the MaskedTextBox component.
     */
    MaskedTextBoxComponent.prototype.blur = function () {
        if (!this.input) {
            return;
        }
        this.input.nativeElement.blur();
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.pasteHandler = function (e) {
        var _a = e.target, selectionStart = _a.selectionStart, selectionEnd = _a.selectionEnd;
        if (selectionEnd === selectionStart) {
            return;
        }
        this.isPasted = true;
        this.selection = [selectionStart, selectionEnd];
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.inputHandler = function (e) {
        var value = e.target.value;
        var _a = this.selection, start = _a[0], end = _a[1];
        if (!this.mask) {
            this.updateValue(value);
            this.isPasted = false;
            return;
        }
        var result;
        if (this.isPasted) {
            this.isPasted = false;
            var rightPart = this.maskedValue.length - end;
            var to = value.length - rightPart;
            result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end);
        }
        else {
            result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
        }
        this.updateInput(result.value, result.selection);
        this.updateValue(result.value);
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.ngOnChanges = function (changes) {
        var _this = this;
        if (!this.mask) {
            this.updateInput(this.value);
            return;
        }
        var next = this.extractChanges(changes);
        this.updateService(next);
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_changes__["a" /* isChanged */])('value', changes)) {
            var maskedValue = this.service.maskRaw(this.value);
            if (maskedValue !== this.maskedValue) {
                this.updateInput(maskedValue);
            }
        }
        else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_changes__["b" /* anyChanged */])(['promptPlaceholder', 'includeLiterals'], changes)) {
            resolvedPromise.then(function () {
                _this.updateValue(_this.maskedValue);
            });
        }
        else {
            this.updateInput(this.service.maskRaw(this.value));
        }
    };
    /**
     * @hidden
     * Writes a new value to the element.
     */
    MaskedTextBoxComponent.prototype.writeValue = function (value) {
        this.value = value === null ? '' : value;
        this.updateInput(this.service.maskRaw(this.value));
    };
    /**
     * @hidden
     * Sets the function that will be called when a `change` event is triggered.
     */
    MaskedTextBoxComponent.prototype.registerOnChange = function (fn) {
        this.onChange = fn;
    };
    /**
     * @hidden
     * Sets the function that will be called when a `touch` event is triggered.
     */
    MaskedTextBoxComponent.prototype.registerOnTouched = function (fn) {
        this.onTouched = fn;
    };
    /**
     * @hidden
     * Called when the status of the component changes to or from `disabled`.
     * Depending on the value, it enables or disables the appropriate DOM element.
     *
     * @param isDisabled
     */
    MaskedTextBoxComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.validate = function (_) {
        if (this.maskValidation === false || !this.mask) {
            return null;
        }
        if (!this.service.validationValue(this.maskedValue)) {
            return null;
        }
        if (this.maskedValue.indexOf(this.prompt) !== -1) {
            return {
                patternError: {
                    mask: this.mask,
                    maskedValue: this.maskedValue,
                    value: this.value
                }
            };
        }
        return null;
    };
    /**
     * @hidden
     */
    MaskedTextBoxComponent.prototype.updateValue = function (maskedValue) {
        if (this.mask && !this.service.validationValue(maskedValue)) {
            this.value = '';
        }
        else {
            this.value = this.service.rawValue(maskedValue);
        }
        this.onChange(this.value);
        this.valueChange.emit(this.value);
    };
    MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) {
        if (maskedValue === void 0) { maskedValue = ''; }
        this.maskedValue = maskedValue;
        this.renderer.setProperty(this.input.nativeElement, "value", maskedValue);
        if (selection !== undefined) {
            this.input.nativeElement.setSelectionRange(selection, selection);
        }
    };
    MaskedTextBoxComponent.prototype.extractChanges = function (changes) {
        return Object.keys(changes).filter(function (key) { return key !== 'rules'; }).reduce(function (obj, key) {
            obj[key] = changes[key].currentValue;
            return obj;
        }, {}); // tslint:disable-line:align
    };
    MaskedTextBoxComponent.prototype.updateService = function (extra) {
        var config = Object.assign({
            includeLiterals: this.includeLiterals,
            mask: this.mask,
            prompt: this.prompt,
            promptPlaceholder: this.promptPlaceholder,
            rules: this.rules
        }, extra); // tslint:disable-line:align
        this.service.update(config);
    };
    return MaskedTextBoxComponent;
}());

MaskedTextBoxComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoMaskedTextBox',
                providers: [
                    __WEBPACK_IMPORTED_MODULE_3__masking_service__["a" /* MaskingService */],
                    {
                        multi: true,
                        provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return MaskedTextBoxComponent; }) /* tslint:disable-line */
                    },
                    {
                        multi: true,
                        provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALIDATORS"],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return MaskedTextBoxComponent; }) /* tslint:disable-line */
                    }
                ],
                selector: 'kendo-maskedtextbox',
                template: "\n        <input type=\"text\"\n            #input\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            autocapitalize=\"off\"\n            spellcheck=\"false\"\n            class=\"k-textbox\"\n            [id]=\"id\"\n            [tabindex]=\"tabIndex\"\n            [attr.title]=\"title\"\n            [disabled]=\"disabled\"\n            (focus)=\"handleFocus($event)\"\n            (blur)=\"handleBlur($event)\"\n            (dragstart)=\"handleDragDrop()\"\n            (drop)=\"handleDragDrop()\"\n        />\n    "
            },] },
];
/** @nocollapse */
MaskedTextBoxComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__masking_service__["a" /* MaskingService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
MaskedTextBoxComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'direction': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-maskedtextbox',] },],
    'hostFocusedClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'hostDisabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'mask': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rules': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'prompt': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'promptPlaceholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'includeLiterals': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'maskValidation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'input': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['input',] },],
    'pasteHandler': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['paste', ['$event'],] },],
    'inputHandler': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['input', ['$event'],] },],
};


/***/ }),
/* 377 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return Parser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mask; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return literal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return unmask; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return unliteral; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return token; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return rawMask; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return rawLiteral; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__result__ = __webpack_require__(378);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stream__ = __webpack_require__(610);


var toArray = function (value) { return (value || '').split(''); };
var ESCAPE_CHARACTER = '\\';
/**
 * @hidden
 */
var Parser = (function () {
    function Parser(parse) {
        this.parse = parse;
    }
    Parser.prototype.run = function (input, control) {
        if (control === void 0) { control = ''; }
        if (input instanceof __WEBPACK_IMPORTED_MODULE_1__stream__["a" /* Stream */]) {
            return this.parse(input);
        }
        else {
            return this.parse(new __WEBPACK_IMPORTED_MODULE_1__stream__["a" /* Stream */](toArray(input), toArray(control)));
        }
    };
    //map :: Functor f => f a ~> (a -> b) -> f b
    Parser.prototype.map = function (f) {
        var _this = this;
        return new Parser(function (stream) { return _this.parse(stream).map(f); });
    };
    //chain :: Chain m => m a ~> (a -> m b) -> m b
    Parser.prototype.chain = function (f) {
        var _this = this;
        return new Parser(function (stream) { return _this.parse(stream).chain(function (v, s) { return f(v).run(s); }); });
    };
    Parser.prototype.isLiteral = function (c) {
        return this.run(c).type === __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Literal;
    };
    return Parser;
}());

/**
 * @hidden
 */
var mask = function (_a) {
    var prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder;
    return function (rule) { return new Parser(function (stream) {
        while (!stream.eof()) {
            var _a = stream.peek(), char = _a.char, control = _a.control;
            if (char === control && control === prompt) {
                stream.eat();
                return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](prompt, stream, __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Mask);
            }
            if (rule.test(char)) {
                stream.eat();
                return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](char, stream, __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Mask);
            }
            if (char === promptPlaceholder) {
                stream.eat();
                return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](prompt, stream, __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Mask);
            }
            stream.eat_input();
        }
        stream.eat();
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](prompt, stream, __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Mask);
    }); };
};
/**
 * @hidden
 */
var literal = function (token) { return new Parser(function (stream) {
    //    let {char, control} = stream.peek();
    var char = stream.peek().char;
    if (char === token) {
        stream.eat();
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](token, stream, __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Literal);
    }
    //    if (control === token) {
    //        while (!stream.eof() && char !== token) {
    //            stream.eat_input();
    //            char = stream.peek().char;
    //        }
    //    }
    //
    //    if (control !== undefined) {
    //        stream.eat();
    //    }
    return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](token, stream, __WEBPACK_IMPORTED_MODULE_0__result__["a" /* ResultType */].Literal);
}); };
/**
 * @hidden
 */
var unmask = function (prompt) { return function (rule) { return new Parser(function (stream) {
    while (!stream.eof()) {
        var _a = stream.peek(), char = _a.char, control = _a.control;
        if (char === prompt && control === prompt) {
            stream.eat();
            return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](char, stream);
        }
        if (rule.test(char)) {
            stream.eat();
            return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](char, stream);
        }
        stream.eat_input();
    }
    stream.eat();
    return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */]('', stream);
}); }; };
/**
 * @hidden
 */
var unliteral = function (token) { return new Parser(function (stream) {
    if (stream.eof()) {
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */]('', stream);
    }
    var char = stream.peek().char;
    if (char === token) {
        stream.eat();
    }
    return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](token, stream);
}); };
/**
 * @hidden
 */
var token = function (rules, creator) { return new Parser(function (stream) {
    var char = stream.next().char;
    var rule = rules[char];
    if (char === ESCAPE_CHARACTER) {
        char = stream.next().char;
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](creator.literal(char), stream);
    }
    if (!rule) {
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](creator.literal(char), stream);
    }
    return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](creator.mask(rule), stream);
}); };
/**
 * @hidden
 */
var rawMask = function (_a) {
    var prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder;
    return new Parser(function (stream) {
        var char = stream.next().char;
        if (char === prompt) {
            return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](promptPlaceholder, stream);
        }
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](char, stream);
    });
};
/**
 * @hidden
 */
var rawLiteral = function (includeLiterals) { return new Parser(function (stream) {
    var char = stream.next().char;
    if (includeLiterals) {
        return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */](char, stream);
    }
    return new __WEBPACK_IMPORTED_MODULE_0__result__["b" /* Result */]('', stream);
}); };


/***/ }),
/* 378 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResultType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Result; });
/**
 * @hidden
 */
var ResultType;
(function (ResultType) {
    ResultType[ResultType["Literal"] = 0] = "Literal";
    ResultType[ResultType["Mask"] = 1] = "Mask";
    ResultType[ResultType["Undefined"] = 2] = "Undefined";
})(ResultType || (ResultType = {}));
/**
 * @hidden
 */
var Result = (function () {
    function Result(value, rest, type) {
        if (type === void 0) { type = ResultType.Undefined; }
        this.value = value;
        this.rest = rest;
        this.type = type;
    }
    //map :: Functor f => f a ~> (a -> b) -> f b
    Result.prototype.map = function (fn) {
        return new Result(fn(this.value), this.rest);
    };
    //chain :: Chain m => m a ~> (a -> m b) -> m b
    Result.prototype.chain = function (fn) {
        return fn(this.value, this.rest);
    };
    Result.prototype.fold = function (s, _ /*we don't need it*/) {
        return s(this.value, this.rest);
    };
    Result.prototype.concat = function (r) {
        return this.map(function (vs, _) { return r.chain(function (v, __) { return vs.concat([v]); }); });
    };
    Result.prototype.toString = function () {
        return "Result({ value: '" + this.value + "', rest: " + this.rest + " })";
    };
    return Result;
}());



/***/ }),
/* 379 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericTextBoxModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__numerictextbox_numerictextbox_component__ = __webpack_require__(383);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__numerictextbox_localization_localized_messages_directive__ = __webpack_require__(612);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__numerictextbox_localization_custom_messages_component__ = __webpack_require__(381);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_events_outside_angular_directive__ = __webpack_require__(371);







var COMPONENT_EXPORTS = [
    __WEBPACK_IMPORTED_MODULE_1__numerictextbox_numerictextbox_component__["a" /* NumericTextBoxComponent */],
    __WEBPACK_IMPORTED_MODULE_5__numerictextbox_localization_custom_messages_component__["a" /* NumericTextBoxCustomMessagesComponent */]
];
var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_4__numerictextbox_localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */],
    __WEBPACK_IMPORTED_MODULE_6__common_events_outside_angular_directive__["a" /* EventsOutsideAngularDirective */]
].concat(COMPONENT_EXPORTS);
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the NumericTextBox component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the NumericTextBox module
 * import { NumericTextBoxModule } from '@progress/kendo-angular-inputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, NumericTextBoxModule], // import NumericTextBox module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var NumericTextBoxModule = (function () {
    function NumericTextBoxModule() {
    }
    return NumericTextBoxModule;
}());

NumericTextBoxModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_EXPORTS],
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"]],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
NumericTextBoxModule.ctorParameters = function () { return []; };


/***/ }),
/* 380 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return MIN_DOC_LINK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return MAX_DOC_LINK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return POINT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return INITIAL_SPIN_DELAY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SPIN_DELAY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return EXPONENT_REGEX; });
/**
 * @hidden
 */
var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/inputs/api/NumericTextBoxComponent/#toc-min';
/**
 * @hidden
 */
var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/inputs/api/NumericTextBoxComponent/#toc-max';
/**
 * @hidden
 */
var POINT = ".";
/**
 * @hidden
 */
var INITIAL_SPIN_DELAY = 500;
/**
 * @hidden
 */
var SPIN_DELAY = 50;
/**
 * @hidden
 */
var EXPONENT_REGEX = /[eE][\-+]?[0-9]+/;


/***/ }),
/* 381 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericTextBoxCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(382);




/**
 * Custom component messages override default component messages.
 */
var NumericTextBoxCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](NumericTextBoxCustomMessagesComponent, _super);
    function NumericTextBoxCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(NumericTextBoxCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return NumericTextBoxCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

NumericTextBoxCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return NumericTextBoxCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-numerictextbox-messages',
                template: ""
            },] },
];
/** @nocollapse */
NumericTextBoxCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 382 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'decrement': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'increment': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 383 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericTextBoxComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_enums__ = __webpack_require__(203);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_changes__ = __webpack_require__(202);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_dom_utils__ = __webpack_require__(70);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_math__ = __webpack_require__(372);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__validators_max_validator__ = __webpack_require__(619);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__validators_min_validator__ = __webpack_require__(620);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__constants__ = __webpack_require__(380);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils__ = __webpack_require__(613);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__arrow_direction__ = __webpack_require__(611);














/**
 * Represents the Kendo UI NumericTextBox component for Angular.
 */
var NumericTextBoxComponent = (function () {
    function NumericTextBoxComponent(intl, renderer, localizationService, ngZone, hostElement, rtl) {
        var _this = this;
        this.intl = intl;
        this.renderer = renderer;
        this.localizationService = localizationService;
        this.ngZone = ngZone;
        this.hostElement = hostElement;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_dom_utils__["a" /* guid */])();
        /**
         * Determines whether the component is disabled.
         */
        this.disabled = false;
        /**
         * Sets the title of the input element of the NumericTextBox.
         */
        this.title = '';
        /**
         * Specifies whether the value will be auto-corrected based on the min and max values.
         */
        this.autoCorrect = false;
        /**
         * Specifies the number of decimals that the user can enter when the input is focused.
         */
        this.decimals = null;
        /**
         * Specifies the value used to increment or decrement the component value.
         */
        this.step = 1;
        /**
         * Specifies whether the **Up** and **Down** spin buttons should be rendered.
         */
        this.spinners = true;
        /**
         * Determines whether the built-in min or max validators are enforced when validating a form.
         *
         * > The Angular 4.2.0 version introduces the `min` and `max` validation directives. As a result, even if you set `rangeValidation`
         * to `false`, the built-in Angular validators will be executed.
         */
        this.rangeValidation = true; //TODO: test
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Specifies the value of the NumericTextBox component.
         */
        this.value = null;
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        /**
         * Fires each time the user focuses the input element.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        //TODO: test
        /**
         * Fires each time the input element gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * @hidden
         */
        this.focused = false;
        /**
         * @hidden
         */
        this.ArrowDirection = __WEBPACK_IMPORTED_MODULE_12__arrow_direction__["a" /* ArrowDirection */];
        /**
         * @hidden
         */
        this.arrowDirection = __WEBPACK_IMPORTED_MODULE_12__arrow_direction__["a" /* ArrowDirection */].None;
        this.inputValue = '';
        this.minValidateFn = __WEBPACK_IMPORTED_MODULE_11__utils__["a" /* noop */];
        this.maxValidateFn = __WEBPACK_IMPORTED_MODULE_11__utils__["a" /* noop */];
        this._format = "n2";
        /**
         * @hidden
         */
        this.releaseArrow = function () {
            clearTimeout(_this.spinTimeout);
            if (_this.arrowDirection !== __WEBPACK_IMPORTED_MODULE_12__arrow_direction__["a" /* ArrowDirection */].None) {
                _this.ngZone.run(function () {
                    _this.arrowDirection = __WEBPACK_IMPORTED_MODULE_12__arrow_direction__["a" /* ArrowDirection */].None;
                });
            }
        };
        /**
         * @hidden
         */
        this.handleInput = function () {
            var input = _this.numericInput.nativeElement;
            var selectionStart = input.selectionStart, selectionEnd = input.selectionEnd, inputValue = input.value;
            if (_this.pressedKey === __WEBPACK_IMPORTED_MODULE_1__common_enums__["a" /* Keys */].numpad_dot) {
                inputValue = _this.replaceNumpadDotValue();
            }
            if (!_this.isValid(inputValue)) {
                input.value = _this.inputValue;
                _this.setSelection(selectionStart - 1, selectionEnd - 1);
                return;
            }
            var parsedValue = _this.intl.parseNumber(inputValue);
            var value = _this.restrictDecimals(parsedValue);
            if (_this.autoCorrect) {
                var limited = _this.limitInputValue(value);
                value = limited.value;
                selectionStart = limited.selectionStart;
                selectionEnd = limited.selectionEnd;
            }
            if (parsedValue !== value || !_this.focused) {
                _this.setInputValue(value);
                _this.setSelection(selectionStart, selectionEnd);
            }
            else {
                _this.inputValue = inputValue;
            }
            _this.ngZone.run(function () {
                _this.updateValue(value);
            });
            _this.previousSelection = null;
        };
        /**
         * @hidden
         */
        this.handleDragEnter = function () {
            if (!_this.focused) {
                _this.setInputValue(_this.value, true);
            }
        };
        /**
         * @hidden
         */
        this.handleKeyDown = function (e) {
            if (_this.disabled) {
                return;
            }
            var step;
            if (e.keyCode === __WEBPACK_IMPORTED_MODULE_1__common_enums__["a" /* Keys */].down) {
                step = -1;
            }
            else if (e.keyCode === __WEBPACK_IMPORTED_MODULE_1__common_enums__["a" /* Keys */].up) {
                step = 1;
            }
            if (step && _this.step) {
                e.preventDefault();
                _this.ngZone.run(function () {
                    _this.addStep(step);
                });
            }
            var input = _this.numericInput.nativeElement;
            _this.previousSelection = {
                start: input.selectionStart,
                end: input.selectionEnd
            };
            _this.pressedKey = e.keyCode;
        };
        //TODO: disable tslint and move those to the constructor level
        this.ngChange = function (_) { };
        this.ngTouched = function () { };
        this.direction = rtl ? 'rtl' : 'ltr';
        this.hostElement = hostElement.nativeElement;
    }
    Object.defineProperty(NumericTextBoxComponent.prototype, "format", {
        /**
         * Specifies the number format which is used when the component is not focused.
         * If set to `null` or `undefined`, the default format will be used.
         */
        get: function () {
            var format = this._format;
            return format !== null && format !== undefined ? format : 'n2';
        },
        set: function (value) {
            this._format = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericTextBoxComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericTextBoxComponent.prototype, "widgetClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    NumericTextBoxComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.hostElement, "tabindex");
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.arrowPress = function (direction, e) {
        e.preventDefault();
        if (!this.disabled) {
            this.focused = true;
            this.focus();
            this.arrowDirection = direction;
            if (this.step) {
                this.spin(direction, __WEBPACK_IMPORTED_MODULE_10__constants__["a" /* INITIAL_SPIN_DELAY */]);
            }
            else {
                this.setInputValue();
            }
        }
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.ngOnChanges = function (changes) {
        this.verifySettings();
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_changes__["b" /* anyChanged */])(['min', 'max', 'rangeValidation'], changes, false)) {
            this.minValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__validators_min_validator__["a" /* createMinValidator */])(this.min) : __WEBPACK_IMPORTED_MODULE_11__utils__["a" /* noop */];
            this.maxValidateFn = this.rangeValidation ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__validators_max_validator__["a" /* createMaxValidator */])(this.max) : __WEBPACK_IMPORTED_MODULE_11__utils__["a" /* noop */];
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_changes__["b" /* anyChanged */])(['autoCorrect', 'decimals', 'min'], changes)) {
            delete this.numericRegex;
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_changes__["b" /* anyChanged */])(['value', 'format'], changes, false)) {
            this.verifyValue(this.value);
            this.value = this.restrictModelValue(this.value);
            this.setInputValue();
        }
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.ngOnDestroy = function () {
        clearTimeout(this.spinTimeout);
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.validate = function (control) {
        return this.minValidateFn(control) || this.maxValidateFn(control);
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.writeValue = function (value) {
        this.verifyValue(value);
        var restrictedValue = this.restrictModelValue(value);
        this.value = restrictedValue;
        this.setInputValue();
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.registerOnChange = function (fn) {
        this.ngChange = fn;
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.registerOnTouched = function (fn) {
        this.ngTouched = fn;
    };
    /**
     * @hidden
     * Called when the status of the component changes to or from `disabled`.
     * Depending on the value, it enables or disables the appropriate DOM element.
     *
     * @param isDisabled
     */
    NumericTextBoxComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * Focuses the NumericTextBox component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="numerictextbox.focus()">Focus NumericTextBox</button>
     *  <kendo-numerictextbox #numerictextbox></kendo-numerictextbox>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    NumericTextBoxComponent.prototype.focus = function () {
        if (!this.numericInput) {
            return;
        }
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_dom_utils__["b" /* invokeElementMethod */])(this.numericInput, 'focus');
    };
    /**
     * Blurs the NumericTextBox component.
     */
    NumericTextBoxComponent.prototype.blur = function () {
        if (!this.numericInput) {
            return;
        }
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_dom_utils__["b" /* invokeElementMethod */])(this.numericInput, 'blur');
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.handleFocus = function () {
        var _this = this;
        if (!this.focused) {
            this.focused = true;
            this.setInputValue();
            this.ngZone.runOutsideAngular(function () {
                setTimeout(function () {
                    _this.setSelection(0, _this.inputValue.length);
                }, 0); /* tslint:disable-line  align */
            });
        }
        this.onFocus.emit();
    };
    /**
     * @hidden
     */
    NumericTextBoxComponent.prototype.handleBlur = function () {
        this.focused = false;
        //blur is thrown before input when dragging the input text in IE
        if (this.inputValue !== this.elementValue) {
            this.handleInput();
        }
        this.ngTouched();
        this.setInputValue();
        this.onBlur.emit();
    };
    Object.defineProperty(NumericTextBoxComponent.prototype, "incrementTitle", {
        /**
         * @hidden
         */
        get: function () {
            return this.localizationService.get('increment');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericTextBoxComponent.prototype, "decrementTitle", {
        /**
         * @hidden
         */
        get: function () {
            return this.localizationService.get('decrement');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericTextBoxComponent.prototype, "decimalSeparator", {
        get: function () {
            var numberSymbols = this.intl.numberSymbols();
            return numberSymbols.decimal;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NumericTextBoxComponent.prototype, "elementValue", {
        get: function () {
            return this.numericInput.nativeElement.value;
        },
        set: function (value) {
            this.renderer.setProperty(this.numericInput.nativeElement, 'value', value);
        },
        enumerable: true,
        configurable: true
    });
    NumericTextBoxComponent.prototype.updateValue = function (candidate) {
        if (candidate === this.value) {
            return;
        }
        this.value = candidate;
        this.ngChange(candidate);
        this.valueChange.emit(candidate);
    };
    NumericTextBoxComponent.prototype.replaceNumpadDotValue = function () {
        var value = this.inputValue || "";
        if (this.previousSelection) {
            var input = this.numericInput.nativeElement;
            var selectionStart = input.selectionStart, selectionEnd = input.selectionEnd;
            var _a = this.previousSelection, start = _a.start, end = _a.end;
            input.value = value = value.substring(0, start) + this.decimalSeparator + value.substring(end);
            this.setSelection(selectionStart, selectionEnd);
        }
        return value;
    };
    NumericTextBoxComponent.prototype.isValid = function (value) {
        if (!this.numericRegex) {
            this.numericRegex = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["b" /* numericRegex */])({
                autoCorrect: this.autoCorrect,
                decimals: this.decimals,
                min: this.min,
                separator: this.decimalSeparator
            });
        }
        return this.numericRegex.test(value);
    };
    NumericTextBoxComponent.prototype.spin = function (step, timeout) {
        var _this = this;
        clearTimeout(this.spinTimeout);
        this.spinTimeout = setTimeout(function () {
            _this.spin(step, __WEBPACK_IMPORTED_MODULE_10__constants__["b" /* SPIN_DELAY */]);
        }, timeout); /* tslint:disable-line  align */
        this.addStep(step);
    };
    NumericTextBoxComponent.prototype.addStep = function (step) {
        var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_math__["a" /* add */])(this.value || 0, this.step * step);
        value = this.limitValue(value);
        value = this.restrictDecimals(value);
        this.setInputValue(value);
        this.updateValue(value);
    };
    NumericTextBoxComponent.prototype.setSelection = function (start, end) {
        if (this.focused) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_dom_utils__["b" /* invokeElementMethod */])(this.numericInput, 'setSelectionRange', start, end);
        }
    };
    NumericTextBoxComponent.prototype.limitValue = function (value) {
        var result = value;
        if (!this.isInRange(value)) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(this.max) && value > this.max) {
                result = this.max;
            }
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(this.min) && value < this.min) {
                result = this.min;
            }
        }
        return result;
    };
    NumericTextBoxComponent.prototype.limitInputValue = function (value) {
        var _a = this.numericInput.nativeElement, selectionStart = _a.selectionStart, selectionEnd = _a.selectionEnd, enteredValue = _a.value;
        var limitedValue = value;
        var selectToEnd = false;
        if (!this.isInRange(value)) {
            var lengthChange = enteredValue.length - String(this.inputValue).length;
            var _b = this, min = _b.min, max = _b.max;
            var hasMax = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(max);
            var hasMin = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(min);
            var padLimit = void 0, replaceNext = void 0;
            var correctedValue = value;
            if (selectionStart === 0 && this.inputValue.substr(1) === enteredValue) {
                return {
                    value: null,
                    selectionStart: selectionStart,
                    selectionEnd: selectionEnd
                };
            }
            if (hasMax && value > max) {
                if (value > 0) {
                    replaceNext = true;
                }
                else {
                    padLimit = max;
                }
            }
            else if (hasMin && value < min) {
                if (value > 0) {
                    padLimit = min;
                }
                else {
                    replaceNext = true;
                }
            }
            if (padLimit) {
                var paddedValue = this.tryPadValue(value, padLimit);
                if (paddedValue && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["d" /* decimalPart */])(value) !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["d" /* decimalPart */])(padLimit)) {
                    correctedValue = paddedValue;
                    selectToEnd = true;
                }
            }
            else if (replaceNext) {
                if (this.inputValue && selectionStart !== enteredValue.length) {
                    correctedValue = parseFloat(enteredValue.substr(0, selectionStart) +
                        enteredValue.substr(selectionStart + lengthChange));
                }
            }
            limitedValue = this.limitValue(correctedValue);
            selectToEnd = (selectToEnd || limitedValue !== correctedValue) && this.previousSelection &&
                (this.previousSelection.end - this.previousSelection.start + lengthChange) > 0;
        }
        return {
            value: limitedValue,
            selectionStart: selectionStart,
            selectionEnd: selectToEnd ? String(limitedValue).length : selectionEnd
        };
    };
    NumericTextBoxComponent.prototype.tryPadValue = function (value, limit) {
        var limitLength = String(Math.floor(limit)).length;
        var zeroPadded = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["e" /* pad */])(value, limitLength);
        var zeroPaddedNext = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["e" /* pad */])(value, limitLength + 1);
        var result;
        if (this.isInRange(zeroPadded)) {
            result = zeroPadded;
        }
        else if (this.isInRange(zeroPaddedNext)) {
            result = zeroPaddedNext;
        }
        return result;
    };
    NumericTextBoxComponent.prototype.isInRange = function (value) {
        return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(value) || ((!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(this.min) || this.min <= value) && (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumber */])(this.max) || value <= this.max));
    };
    NumericTextBoxComponent.prototype.restrictModelValue = function (value) {
        var result = this.restrictDecimals(value, true);
        if (this.autoCorrect && this.limitValue(result) !== result) {
            result = null;
        }
        return result;
    };
    NumericTextBoxComponent.prototype.restrictDecimals = function (value, round) {
        var decimals = this.decimals;
        var result = value;
        if (value && decimals !== null && decimals >= 0) {
            var stringValue = String(value);
            if (round || __WEBPACK_IMPORTED_MODULE_10__constants__["c" /* EXPONENT_REGEX */].test(stringValue)) {
                result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_math__["b" /* toFixedPrecision */])(value, decimals);
            }
            else {
                var parts = stringValue.split(__WEBPACK_IMPORTED_MODULE_10__constants__["d" /* POINT */]);
                var fraction = parts[1];
                if (fraction && fraction.length > decimals) {
                    fraction = fraction.substr(0, decimals);
                    result = parseFloat("" + parts[0] + __WEBPACK_IMPORTED_MODULE_10__constants__["d" /* POINT */] + fraction);
                }
            }
        }
        return result;
    };
    NumericTextBoxComponent.prototype.formatInputValue = function (value) {
        return String(value).replace(__WEBPACK_IMPORTED_MODULE_10__constants__["d" /* POINT */], this.decimalSeparator);
    };
    NumericTextBoxComponent.prototype.formatValue = function (value, focused) {
        var formattedValue;
        if (value === null || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__utils__["f" /* defined */])(value) || value === '') {
            formattedValue = '';
        }
        else if (focused) {
            formattedValue = this.formatInputValue(value);
        }
        else {
            formattedValue = this.intl.formatNumber(value, this.format);
        }
        return formattedValue;
    };
    NumericTextBoxComponent.prototype.setInputValue = function (value, focused) {
        if (value === void 0) { value = this.value; }
        if (focused === void 0) { focused = this.focused; }
        var formattedValue = this.formatValue(value, focused);
        this.elementValue = formattedValue;
        this.inputValue = formattedValue;
    };
    NumericTextBoxComponent.prototype.verifySettings = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
            return;
        }
        if (this.min !== null && this.max !== null && this.min > this.max) {
            throw new Error("The max value should be bigger than the min. See " + __WEBPACK_IMPORTED_MODULE_10__constants__["e" /* MIN_DOC_LINK */] + " and " + __WEBPACK_IMPORTED_MODULE_10__constants__["f" /* MAX_DOC_LINK */] + ".");
        }
    };
    NumericTextBoxComponent.prototype.verifyValue = function (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])() && value && typeof value !== 'number') {
            throw new Error("The NumericTextBox component requires value of type Number and " + JSON.stringify(value) + " was set.");
        }
    };
    return NumericTextBoxComponent;
}());

NumericTextBoxComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoNumericTextBox',
                providers: [
                    __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    { provide: __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */], useValue: 'kendo.numerictextbox' },
                    { provide: __WEBPACK_IMPORTED_MODULE_7__angular_forms__["NG_VALUE_ACCESSOR"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return NumericTextBoxComponent; }), multi: true },
                    { provide: __WEBPACK_IMPORTED_MODULE_7__angular_forms__["NG_VALIDATORS"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return NumericTextBoxComponent; }), multi: true } /* tslint:disable-line */
                ],
                selector: 'kendo-numerictextbox',
                template: "\n        <ng-container kendoNumericTextBoxLocalizedMessages\n            i18n-increment=\"kendo.numerictextbox.increment|The title for the **Increment** button in the NumericTextBox\"\n            increment=\"Increase value\"\n            i18n-decrement=\"kendo.numerictextbox.decrement|The title for the **Decrement** button in the NumericTextBox\"\n            decrement=\"Decrease value\"\n        >\n        </ng-container>\n        <span class=\"k-numeric-wrap\" [class.k-state-disabled]=\"disabled\" [class.k-state-focused]=\"focused\">\n            <input\n            role=\"spinbutton\"\n            class=\"k-input\"\n            autocomplete=\"off\"\n            autocorrect=\"off\"\n            [id]=\"id\"\n            [attr.aria-valuemin]=\"min\"\n            [attr.aria-valuemax]=\"max\"\n            [attr.aria-valuenow]=\"value\"\n            [attr.title]=\"title\"\n            [attr.placeholder]=\"placeholder\"\n            [tabindex]=\"tabIndex\"\n            [class.k-formatted-value]=\"!focused\"\n            [disabled]=\"disabled\"\n            (focus)=\"handleFocus()\"\n            (blur)=\"handleBlur()\"\n            [kendoEventsOutsideAngular]=\"{ dragenter: handleDragEnter, keydown: handleKeyDown, input: handleInput }\"\n            #numericInput />\n            <span class=\"k-select\" *ngIf=\"spinners\" [kendoEventsOutsideAngular]=\"{ mouseup: releaseArrow, mouseleave: releaseArrow }\">\n                <span\n                    (mousedown)=\"arrowPress(ArrowDirection.Up, $event)\"\n                    [attr.aria-label]=\"incrementTitle\"\n                    [title]=\"incrementTitle\"\n                    [class.k-state-active]=\"arrowDirection === ArrowDirection.Up\"\n                    class=\"k-link k-link-increase\"\n                >\n                    <span class=\"k-icon k-i-arrow-n\"></span>\n                </span>\n                <span\n                    (mousedown)=\"arrowPress(ArrowDirection.Down, $event)\"\n                    [attr.aria-label]=\"decrementTitle\"\n                    [title]=\"decrementTitle\"\n                    [class.k-state-active]=\"arrowDirection === ArrowDirection.Down\"\n                    class=\"k-link k-link-decrease\"\n                >\n                    <span class=\"k-icon k-i-arrow-s\"></span>\n                </span>\n            </span>\n        </span>\n      "
            },] },
];
/** @nocollapse */
NumericTextBoxComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_8__progress_kendo_angular_intl__["b" /* IntlService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
NumericTextBoxComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'autoCorrect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'decimals': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'step': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'spinners': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rangeValidation': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'numericInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['numericInput',] },],
    'direction': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
    'widgetClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-numerictextbox',] },],
};


/***/ }),
/* 384 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SliderModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__slider_slider_component__ = __webpack_require__(387);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__slider_slider_ticks_component__ = __webpack_require__(386);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__draggable_module__ = __webpack_require__(373);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_resize_sensor__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__slider_localization_localized_messages_directive__ = __webpack_require__(615);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__slider_localization_custom_messages_component__ = __webpack_require__(614);









var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__slider_slider_component__["a" /* SliderComponent */],
    __WEBPACK_IMPORTED_MODULE_3__slider_slider_ticks_component__["a" /* SliderTicksComponent */],
    __WEBPACK_IMPORTED_MODULE_8__slider_localization_custom_messages_component__["a" /* SliderCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_7__slider_localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */]
];
var COMPONENT_EXPORTS = [
    __WEBPACK_IMPORTED_MODULE_1__slider_slider_component__["a" /* SliderComponent */],
    __WEBPACK_IMPORTED_MODULE_8__slider_localization_custom_messages_component__["a" /* SliderCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_7__slider_localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Slider component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Inputs module
 * import { SliderModule } from '@progress/kendo-angular-inputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, SliderModule], // import Slider module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var SliderModule = (function () {
    function SliderModule() {
    }
    return SliderModule;
}());

SliderModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: COMPONENT_DIRECTIVES,
                exports: COMPONENT_EXPORTS,
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_4__draggable_module__["a" /* DraggableModule */], __WEBPACK_IMPORTED_MODULE_6__progress_kendo_angular_resize_sensor__["b" /* ResizeSensorModule */]],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
SliderModule.ctorParameters = function () { return []; };


/***/ }),
/* 385 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'decrement': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'increment': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'dragHandle': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 386 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SliderTicksComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__telerik_kendo_inputs_common__ = __webpack_require__(233);



/**
 * @hidden
 */
var SliderTick = (function () {
    function SliderTick(value) {
        this.value = value;
        this.classes = {
            'k-tick': true
        };
    }
    return SliderTick;
}());
/* tslint:disable:component-selector */
/**
 * @hidden
 */
var SliderTicksComponent = (function () {
    function SliderTicksComponent(rtl) {
        this.rtl = rtl;
        this.wrapperClasses = 'k-reset k-slider-items';
        this.ticks = [];
    }
    SliderTicksComponent.prototype.ngOnChanges = function (_) {
        this.createTicks();
    };
    SliderTicksComponent.prototype.createTicks = function () {
        var count = __WEBPACK_IMPORTED_MODULE_2__telerik_kendo_inputs_common__["b" /* SliderUtil */].calculateTicksCount(this.max, this.min, this.step);
        var tickValueProps = {
            min: this.min,
            max: this.max,
            smallStep: this.step
        };
        var result = [];
        for (var i = 0; i < count; i++) {
            result.push(new SliderTick(__WEBPACK_IMPORTED_MODULE_2__telerik_kendo_inputs_common__["b" /* SliderUtil */].calculateValueFromTick(i, tickValueProps)));
        }
        if (this.rtl || this.vertical) {
            result = result.reverse();
        }
        if (result.length > 0) {
            Object.assign(result[0].classes, this.endTickClasses(true));
            Object.assign(result[result.length - 1].classes, this.endTickClasses(false));
        }
        this.ticks = result;
    };
    SliderTicksComponent.prototype.endTickClasses = function (first) {
        return {
            'k-first': (first && !this.vertical) || (!first && this.vertical),
            'k-last': (!first && !this.vertical) || (first && this.vertical)
        };
    };
    return SliderTicksComponent;
}());

SliderTicksComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoSliderTicks]',
                template: "\n    <li #tickElement *ngFor=\"let tick of ticks;\"\n        [ngClass]=\"tick.classes\"\n        title=\"{{ tickTitle(tick.value) }}\"\n        role=\"presentation\"\n     >&nbsp;</li>\n  "
            },] },
];
/** @nocollapse */
SliderTicksComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
SliderTicksComponent.propDecorators = {
    'wrapperClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class',] },],
    'tickTitle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'vertical': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'step': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tickElements': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: ['tickElement',] },],
};


/***/ }),
/* 387 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SliderComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__ = __webpack_require__(233);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_enums__ = __webpack_require__(203);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common_changes__ = __webpack_require__(202);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils__ = __webpack_require__(616);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__common_dom_utils__ = __webpack_require__(70);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_add_observable_interval__ = __webpack_require__(145);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rxjs_add_observable_interval___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_rxjs_add_observable_interval__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_add_observable_merge__ = __webpack_require__(104);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_rxjs_add_observable_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_rxjs_add_observable_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_delay__ = __webpack_require__(146);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_delay___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_rxjs_add_operator_delay__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_concatMap__ = __webpack_require__(243);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_rxjs_add_operator_concatMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_add_operator_startWith__ = __webpack_require__(499);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_rxjs_add_operator_startWith___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_rxjs_add_operator_startWith__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_takeUntil__ = __webpack_require__(107);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_takeUntil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_rxjs_add_operator_takeUntil__);


















/**
 * Represents the Kendo UI Slider component for Angular.
 */
var SliderComponent = (function () {
    function SliderComponent(localizationService, renderer, hostElement, rtl) {
        var _this = this;
        this.localizationService = localizationService;
        this.renderer = renderer;
        this.hostElement = hostElement;
        this.rtl = rtl;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__common_dom_utils__["a" /* guid */])();
        /**
         * Makes the Slider side arrow buttons appear. When set to `false`, the buttons are not displayed.
         */
        this.showButtons = true;
        /**
         * Denotes the location of the tick marks in the Slider.
         *
         * The available options are:
         *   * `before`&mdash;Tick marks are located to the top side of the horizontal track or to the left side of a vertical track.
         *   * `after`&mdash;Tick marks are located to the bottom side of the horizontal track or to the right side of the vertical track.
         *   * `both`&mdash;Tick marks are located on both sides of the track.
         *   * `none`&mdash;Tick marks are not visible. The actual elements are not added to the DOM tree.
         */
        this.tickPlacement = 'both';
        /**
         * Defines the title of the ticks. The default title for each tick is its Slider value.
         * If a callback function is used, it accepts an argument holding the value of the component and returns a string with the new title.
         */
        this.title = __WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__["b" /* SliderUtil */].identity;
        /**
         * If set to `true`, it changes the orientation of the Slider from horizontal to vertical.
         */
        this.vertical = false;
        /**
         * The minimum value of the Slider. The attribute accepts both integers and floating-point numbers.
         */
        this.min = 0;
        /**
         * The maximum value of the Slider. The attribute accepts both integers and floating-point numbers.
         */
        this.max = 10;
        /**
         * The step value of the Slider. The attribute accepts only positive numbers. Can be both integer or a float number.
         */
        this.smallStep = 1;
        /**
         * If set to `true`, it disables the Slider.
         */
        this.disabled = false;
        /**
         * The current value of the Slider when initially displayed.
         * The component can use either the `value` binging or `NgModel`, but not both of them at the same time.
         */
        this.value = 0;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Fires each time the user focuses the input element.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.dragging = false;
        this.decreaseButtonSubscription = __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__["Subscription"].EMPTY;
        this.increaseButtonSubscription = __WEBPACK_IMPORTED_MODULE_3_rxjs_Subscription__["Subscription"].EMPTY;
        /**
         * @hidden
         */
        this.ifEnabled = function (callback, event) {
            if (!_this.disabled) {
                callback.call(_this, event);
            }
        };
        this.ngChange = function (_) { };
        this.ngTouched = function () { };
        this.decreaseValue = function () {
            _this.changeValue(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["a" /* decreaseValueToStep */])(_this.value, _this.getProps()));
        };
        this.increaseValue = function () {
            _this.changeValue(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["b" /* increaseValueToStep */])(_this.value, _this.getProps()));
        };
        this.direction = rtl ? 'rtl' : 'ltr';
        this.hostElement = hostElement.nativeElement;
    }
    Object.defineProperty(SliderComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "horizontalClass", {
        get: function () {
            return !this.vertical;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "verticalClass", {
        get: function () {
            return this.vertical;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "sliderClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "transitionsClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "widgetClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "stateDefaultClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "disabledClass", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "focusedClass", {
        get: function () {
            return this.focused;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "ariaDisabled", {
        get: function () {
            return this.disabled ? true : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "ariaMin", {
        get: function () {
            return this.min;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "ariaMax", {
        get: function () {
            return this.max;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "ariaValue", {
        get: function () {
            return this.value ? this.value : this.min;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "reverse", {
        get: function () {
            return this.rtl && !this.vertical;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "keyBinding", {
        get: function () {
            var reverse = this.reverse;
            var increment = function (_a) {
                var value = _a.value, smallStep = _a.smallStep;
                return value + smallStep;
            };
            var decrement = function (_a) {
                var value = _a.value, smallStep = _a.smallStep;
                return value - smallStep;
            };
            return _a = {},
                _a[__WEBPACK_IMPORTED_MODULE_6__common_enums__["a" /* Keys */].left] = reverse ? increment : decrement,
                _a[__WEBPACK_IMPORTED_MODULE_6__common_enums__["a" /* Keys */].right] = reverse ? decrement : increment,
                _a[__WEBPACK_IMPORTED_MODULE_6__common_enums__["a" /* Keys */].down] = decrement,
                _a[__WEBPACK_IMPORTED_MODULE_6__common_enums__["a" /* Keys */].up] = increment,
                _a[__WEBPACK_IMPORTED_MODULE_6__common_enums__["a" /* Keys */].home] = function (_a) {
                    var min = _a.min;
                    return min;
                },
                _a[__WEBPACK_IMPORTED_MODULE_6__common_enums__["a" /* Keys */].end] = function (_a) {
                    var max = _a.max;
                    return max;
                },
                _a;
            var _a;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     * Called when the status of the component changes to or from `disabled`.
     * Depending on the value, it enables or disables the appropriate DOM element.
     *
     * @param isDisabled
     */
    SliderComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.handleFocus = function () {
        this.focused = true;
        this.onFocus.emit();
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.handleBlur = function () {
        this.focused = false;
        this.ngTouched();
        this.onBlur.emit();
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.keydown = function (event) {
        this.onKeyDown(event);
    };
    SliderComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.hostElement, "tabindex");
    };
    /**
     * Focuses the Slider component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="slider.focus()">Focus</button>
     *  <kendo-slider #slider></kendo-slider>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    SliderComponent.prototype.focus = function () {
        if (!this.wrapper) {
            return;
        }
        this.wrapper.nativeElement.focus();
    };
    /**
     * Blurs the Slider component.
     */
    SliderComponent.prototype.blur = function () {
        if (!this.wrapper) {
            return;
        }
        this.wrapper.nativeElement.blur();
    };
    SliderComponent.prototype.ngOnChanges = function (changes) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__common_changes__["a" /* isChanged */])('value', changes)) {
            this.sizeComponent(false);
        }
    };
    SliderComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["c" /* isDocumentAvailable */])()) {
            return;
        }
        if (this.showButtons) {
            this.increaseButtonSubscription = this.setValueChangeInterval(this.increaseButton.nativeElement, function () { return _this.increaseValue(); });
            this.decreaseButtonSubscription = this.setValueChangeInterval(this.decreaseButton.nativeElement, function () { return _this.decreaseValue(); });
        }
        this.sizeComponent(false);
        if (this.ticks) {
            this.ticks.tickElements
                .changes
                .subscribe(function () { return _this.sizeComponent(false); });
        }
    };
    SliderComponent.prototype.ngOnDestroy = function () {
        this.decreaseButtonSubscription.unsubscribe();
        this.increaseButtonSubscription.unsubscribe();
    };
    Object.defineProperty(SliderComponent.prototype, "incrementMessage", {
        /**
         * @hidden
         */
        get: function () {
            return this.incrementTitle || this.localizationService.get('increment');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "decrementMessage", {
        /**
         * @hidden
         */
        get: function () {
            return this.decrementTitle || this.localizationService.get('decrement');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SliderComponent.prototype, "dragHandleMessage", {
        /**
         * @hidden
         */
        get: function () {
            return this.dragHandleTitle || this.localizationService.get('dragHandle');
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    SliderComponent.prototype.onWrapClick = function (args) {
        var target = args.target;
        if (!(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["d" /* isButton */])(target) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["d" /* isButton */])(target.parentNode))) {
            var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["e" /* eventValue */])(args, this.track.nativeElement, this.getProps());
            this.changeValue(value);
        }
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.handleDragPress = function (args) {
        if (args.originalEvent) {
            args.originalEvent.preventDefault();
        }
        this.focus();
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.onHandleDrag = function (args) {
        this.dragging = true;
        this.changeValue(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["e" /* eventValue */])(args, this.track.nativeElement, this.getProps()));
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.onKeyDown = function (e) {
        var options = this.getProps();
        var disabled = options.disabled, max = options.max, min = options.min;
        var handler = this.keyBinding[e.keyCode];
        if (handler && !disabled) {
            var value = handler(options);
            this.changeValue(__WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__["b" /* SliderUtil */].trimValue(max, min, value));
            e.preventDefault();
        }
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.onHandleRelease = function () {
        this.dragging = false; //needed for animation
    };
    //ngModel binding
    /**
     * @hidden
     */
    SliderComponent.prototype.writeValue = function (value) {
        this.value = value;
        this.sizeComponent(true);
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.registerOnChange = function (fn) {
        this.ngChange = fn;
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.registerOnTouched = function (fn) {
        this.ngTouched = fn;
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.changeValue = function (value) {
        this.value = value;
        this.ngChange(value);
        this.valueChange.emit(value);
        this.sizeComponent(true);
    };
    /**
     * @hidden
     */
    SliderComponent.prototype.sizeComponent = function (animate) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__utils__["c" /* isDocumentAvailable */])()) {
            return;
        }
        var wrapper = this.wrapper.nativeElement;
        var props = this.getProps();
        var model = new __WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__["c" /* SliderModel */](props, wrapper, this.track.nativeElement);
        model.resizeTrack();
        if (this.ticks) {
            model.resizeTicks(this.ticksContainer.nativeElement, this.ticks.tickElements.map(function (element) { return element.nativeElement; }));
        }
        this.handleAnimation(animate); //first time the widget is initialized the selection should not be animated
        model.positionHandle(this.draghandle.nativeElement);
        model.positionSelection(this.draghandle.nativeElement, this.sliderSelection.nativeElement);
        if (this.fixedTickWidth) {
            model.resizeWrapper();
        }
    };
    SliderComponent.prototype.setValueChangeInterval = function (element, callback) {
        var _this = this;
        var mousedown = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].fromEvent(element, 'mousedown');
        var mouseup = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].fromEvent(element, 'mouseup');
        var mouseout = __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].fromEvent(element, 'mouseout');
        var subscription = mousedown
            .filter(function (e) { return e.button === 0; })
            .filter(function () { return !_this.disabled; })
            .concatMap(function () {
            return __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].interval(150)
                .startWith(-1)
                .takeUntil(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].merge(mouseup, mouseout));
        })
            .subscribe(function () {
            _this.focus();
            callback();
        });
        return subscription;
    };
    SliderComponent.prototype.handleAnimation = function (animate) {
        var transition = '';
        if (!animate) {
            transition = 'none';
        }
        this.draghandle.nativeElement.style.transition = transition;
        this.sliderSelection.nativeElement.style.transition = transition;
    };
    SliderComponent.prototype.getProps = function () {
        return {
            buttons: this.showButtons,
            disabled: this.disabled,
            fixedTickWidth: this.fixedTickWidth,
            max: this.max,
            min: this.min,
            reverse: this.reverse,
            smallStep: this.smallStep,
            value: __WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__["b" /* SliderUtil */].trimValue(this.max, this.min, this.value),
            vertical: this.vertical,
            rtl: this.rtl
        };
    };
    return SliderComponent;
}());

SliderComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoSlider',
                providers: [
                    __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    { provide: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */], useValue: 'kendo.slider' },
                    { multi: true, provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"], useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return SliderComponent; }) } /* tslint:disable-line */
                ],
                selector: 'kendo-slider',
                template: "\n        <ng-container kendoSliderLocalizedMessages\n            i18n-increment=\"kendo.slider.increment|The title of the **Increase** button of the Slider.\"\n            increment=\"increment\"\n            i18n-decrement=\"kendo.slider.decrement|The title of the **Decrease** button of the Slider.\"\n            decrement=\"decrement\"\n            i18n-dragHandle=\"kendo.slider.dragHandle|The title of the drag handle of the Slider.\"\n            dragHandle=\"Drag\"\n        >\n\n        <div class=\"k-slider-wrap\" #wrap\n            [id]=\"id\"\n            [class.k-slider-buttons]=\"showButtons\"\n            [class.k-slider-topleft]=\"tickPlacement === 'before'\"\n            [class.k-slider-bottomright]=\"tickPlacement === 'after'\"\n            (click)=\"ifEnabled(onWrapClick, $event)\"\n            [attr.tabindex]=\"(this.disabled ? undefined : tabIndex)\"\n            (focus)=\"handleFocus()\"\n            (blur)=\"handleBlur()\"\n            >\n            <a\n                #decreaseButton\n                *ngIf=\"showButtons\"\n                class=\"k-button k-button-decrease\"\n                [title]=\"decrementMessage\"\n                [attr.aria-label]=\"decrementMessage\"\n            >\n                <span\n                    [class.k-icon]=\"true\"\n                    [class.k-i-arrow-w]=\"!vertical\"\n                    [class.k-i-arrow-s]=\"vertical\"\n                >\n                </span>\n            </a>\n            <a\n                *ngIf=\"showButtons\"\n                #increaseButton\n                class=\"k-button k-button-increase\"\n                [title]=\"incrementMessage\"\n                [attr.aria-label]=\"incrementMessage\"\n            >\n                <span\n                    [class.k-icon]=\"true\"\n                    [class.k-i-arrow-e]=\"!vertical\"\n                    [class.k-i-arrow-n]=\"vertical\"\n                >\n                </span>\n            </a>\n            <ul kendoSliderTicks\n                #ticks\n                *ngIf=\"tickPlacement !== 'none'\"\n                [tickTitle]=\"title\"\n                [vertical]=\"vertical\"\n                [step]=\"smallStep\"\n                [min]=\"min\"\n                [max]=\"max\"\n            >\n            </ul>\n        <div #track\n            class=\"k-slider-track\"\n            >\n            <div #sliderSelection\n                [class.k-slider-selection]=\"true\"\n                [class.k-pressed]=\"dragging\"\n                >\n            </div>\n                <a #draghandle\n                    [class.k-draghandle]=\"true\"\n                    [class.k-pressed]=\"dragging\"\n                    [title]=\"dragHandleMessage\"\n                    kendoDraggable\n                    (kendoPress)=\"ifEnabled(handleDragPress ,$event)\"\n                    (kendoDrag)=\"ifEnabled(onHandleDrag ,$event)\"\n                    (kendoRelease)=\"ifEnabled(onHandleRelease, $event)\"\n                >Drag</a>\n            </div>\n\n            <kendo-resize-sensor (resize)=\"sizeComponent(false)\"></kendo-resize-sensor>\n        </div>\n\n  "
            },] },
];
/** @nocollapse */
SliderComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
]; };
SliderComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'incrementTitle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'decrementTitle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'showButtons': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tickPlacement': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'dragHandleTitle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'vertical': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'smallStep': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'fixedTickWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'wrapper': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['wrap',] },],
    'track': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['track',] },],
    'draghandle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['draghandle',] },],
    'sliderSelection': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['sliderSelection',] },],
    'ticksContainer': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['ticks', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] },] },],
    'ticks': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['ticks',] },],
    'decreaseButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['decreaseButton',] },],
    'increaseButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['increaseButton',] },],
    'direction': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
    'horizontalClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-slider-horizontal',] },],
    'verticalClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-slider-vertical',] },],
    'sliderClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-slider',] },],
    'transitionsClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-slider-transitions',] },],
    'widgetClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] },],
    'stateDefaultClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-default',] },],
    'disabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'focusedClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'ariaDisabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-disabled',] },],
    'ariaMin': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-valuemin',] },],
    'ariaMax': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-valuemax',] },],
    'ariaValue': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-valuenow',] },],
    'keydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
};


/***/ }),
/* 388 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SwitchModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__switch_switch_component__ = __webpack_require__(390);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__draggable_module__ = __webpack_require__(373);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_resize_sensor__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__switch_localization_localized_messages_directive__ = __webpack_require__(618);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__switch_localization_custom_messages_component__ = __webpack_require__(617);








var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__switch_switch_component__["a" /* SwitchComponent */],
    __WEBPACK_IMPORTED_MODULE_7__switch_localization_custom_messages_component__["a" /* SwitchCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_6__switch_localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */]
];
var COMPONENT_EXPORTS = [
    __WEBPACK_IMPORTED_MODULE_1__switch_switch_component__["a" /* SwitchComponent */],
    __WEBPACK_IMPORTED_MODULE_7__switch_localization_custom_messages_component__["a" /* SwitchCustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_6__switch_localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Switch component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Switch module
 * import { SwitchModule } from '@progress/kendo-angular-inputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, SwitchModule], // import Switch module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var SwitchModule = (function () {
    function SwitchModule() {
    }
    return SwitchModule;
}());

SwitchModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: COMPONENT_DIRECTIVES,
                exports: COMPONENT_EXPORTS,
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_common__["CommonModule"], __WEBPACK_IMPORTED_MODULE_3__draggable_module__["a" /* DraggableModule */], __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_resize_sensor__["b" /* ResizeSensorModule */]],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
SwitchModule.ctorParameters = function () { return []; };


/***/ }),
/* 389 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Messages; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);



/**
 * @hidden
 */
var Messages = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](Messages, _super);
    function Messages() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Messages;
}(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["d" /* ComponentMessages */]));

Messages.propDecorators = {
    'on': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'off': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 390 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SwitchComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_enums__ = __webpack_require__(203);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__ = __webpack_require__(233);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_dom_utils__ = __webpack_require__(70);






/**
 * Represents the Kendo UI Switch component for Angular.
 */
var SwitchComponent = (function () {
    function SwitchComponent(rtl, renderer, hostElement, localizationService) {
        var _this = this;
        this.rtl = rtl;
        this.renderer = renderer;
        this.hostElement = hostElement;
        this.localizationService = localizationService;
        /**
         * @hidden
         */
        this.id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_dom_utils__["a" /* guid */])();
        /**
         * Sets the current value of the Switch when initially displayed.
         */
        this.checked = false;
        /**
         * Disables the Switch when set to `true`.
         */
        this.disabled = false;
        /**
         * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
         */
        this.tabindex = 0;
        /**
         * Fires each time the user focuses the input element.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.ngChange = function (_) { };
        this.ngTouched = function () { };
        /**
         * @hidden
         */
        this.changeValue = function (value) {
            _this.checked = value;
            _this.ngChange(value);
            _this.valueChange.emit(value);
        };
        this.keyDownHandler = function (event) {
            var keyCode = event.keyCode;
            if (keyCode === __WEBPACK_IMPORTED_MODULE_3__common_enums__["a" /* Keys */].space || keyCode === __WEBPACK_IMPORTED_MODULE_3__common_enums__["a" /* Keys */].enter) {
                _this.controller.change(!_this.checked);
                event.preventDefault();
            }
        };
        this.ifEnabled = function (callback, event) {
            if (!_this.disabled) {
                callback(event);
            }
        };
        this.applyStyle = function (props) {
            Object.keys(props).forEach(function (x) {
                _this.dragHandle.nativeElement.style[x] = props[x];
            });
        };
        this.updateView = function (elements) {
            if (_this.isDocumentAvailable()) {
                _this.applyStyle(_this.controller.addAnimation(elements.handle));
            }
        };
        this.direction = rtl ? 'rtl' : 'ltr';
        this.controller = new __WEBPACK_IMPORTED_MODULE_4__telerik_kendo_inputs_common__["a" /* SwitchController */](this.updateView, this.changeValue);
        this.hostElement = hostElement.nativeElement;
    }
    Object.defineProperty(SwitchComponent.prototype, "tabIndex", {
        get: function () {
            return this.tabindex;
        },
        /**
         * @hidden
         */
        set: function (tabIndex) {
            this.tabindex = tabIndex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "ariaDisabled", {
        get: function () {
            return this.disabled ? true : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "ariaChecked", {
        get: function () {
            return this.checked ? true : undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "hostClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "switchOnClass", {
        get: function () {
            return this.checked;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "switchOffClass", {
        get: function () {
            return !this.checked;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "disabledClass", {
        get: function () {
            return this.disabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "focusedClass", {
        get: function () {
            return this.focused;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "onLabelMessage", {
        /**
         * @hidden
         */
        get: function () {
            return this.onLabel || this.localizationService.get('on');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SwitchComponent.prototype, "offLabelMessage", {
        /**
         * @hidden
         */
        get: function () {
            return this.offLabel || this.localizationService.get('off');
        },
        enumerable: true,
        configurable: true
    });
    SwitchComponent.prototype.ngOnInit = function () {
        this.renderer.removeAttribute(this.hostElement, "tabindex");
    };
    /**
     * Focuses the Switch component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="switch.focus()">Focus</button>
     *  <kendo-switch #switch></kendo-switch>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    SwitchComponent.prototype.focus = function () {
        if (!this.wrapper) {
            return;
        }
        this.wrapper.nativeElement.focus();
    };
    /**
     * Blurs the Switch component.
     */
    SwitchComponent.prototype.blur = function () {
        if (!this.wrapper) {
            return;
        }
        this.wrapper.nativeElement.blur();
    };
    /**
     * @hidden
     *
     * Called when the status of the component changes to or from `disabled`.
     * Depending on the value, it enables or disables the appropriate DOM element.
     */
    SwitchComponent.prototype.setDisabledState = function (isDisabled) {
        this.disabled = isDisabled;
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.keyDown = function (event) {
        this.ifEnabled(this.keyDownHandler, event);
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.onResize = function () {
        this.updateState();
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.handleFocus = function () {
        this.focused = true;
        this.onFocus.emit();
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.handleBlur = function () {
        this.focused = false;
        this.ngTouched();
        this.onBlur.emit();
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        Promise.resolve().then(function () { return _this.updateState(); });
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.onHandleDrag = function (event) {
        this.ifEnabled(this.controller.onDrag, event);
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.onHandlePress = function (event) {
        this.ifEnabled(this.controller.onPress, event);
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.onHandleRelease = function (event) {
        this.ifEnabled(this.controller.onRelease, event);
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.writeValue = function (value) {
        this.checked = value === null ? false : value;
        this.updateState();
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.registerOnChange = function (fn) {
        this.ngChange = fn;
    };
    /**
     * @hidden
     */
    SwitchComponent.prototype.registerOnTouched = function (fn) {
        this.ngTouched = fn;
    };
    SwitchComponent.prototype.isDocumentAvailable = function () {
        return typeof document !== 'undefined';
    };
    SwitchComponent.prototype.updateState = function () {
        if (!this.isDocumentAvailable()) {
            return;
        }
        var rect = this.wrapper.nativeElement.getBoundingClientRect();
        var coordsLeft = rect.left;
        var coordsRight = rect.right;
        var handleElement = this.dragHandle.nativeElement;
        var handleMargin = parseInt(getComputedStyle(handleElement)['margin-right'], 10);
        var handleOffset = handleElement.offsetWidth;
        var wrapperOffset = this.wrapper.nativeElement.offsetWidth;
        if (wrapperOffset === 0) {
            return;
        }
        this.controller.updateState({
            animate: false,
            checked: this.checked,
            coords: {
                left: coordsLeft,
                right: coordsRight
            },
            handleMargin: handleMargin,
            handleOffset: handleOffset,
            reverse: this.rtl,
            wrapperOffset: wrapperOffset
        });
    };
    return SwitchComponent;
}());

SwitchComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                exportAs: 'kendoSwitch',
                providers: [
                    __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    { provide: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */], useValue: 'kendo.switch' },
                    { multi: true,
                        provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NG_VALUE_ACCESSOR"],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["forwardRef"])(function () { return SwitchComponent; }) /* tslint:disable-line */
                    }
                ],
                selector: 'kendo-switch',
                template: "\n        <ng-container kendoSwitchLocalizedMessages\n            i18n-on=\"kendo.switch.on|The **On** label of the Switch.\"\n            on=\"ON\"\n            i18n-off=\"kendo.switch.off|The **Off** label of the Switch.\"\n            off=\"OFF\"\n        >\n\n        <span class=\"k-switch-wrapper\">\n            <span class=\"k-switch-background\"></span>\n        </span>\n        <span\n            #wrapper\n            kendoDraggable\n            (kendoDrag)=\"onHandleDrag($event)\"\n            (kendoPress)=\"onHandlePress($event)\"\n            (kendoRelease)=\"onHandleRelease($event)\"\n            class=\"k-switch-container\"\n            [id]=\"id\"\n            [attr.tabindex]=\"(disabled ? undefined : tabIndex)\"\n            (focus)=\"handleFocus()\"\n            (blur)=\"handleBlur()\"\n        >\n            <span #dragHandle class=\"k-switch-handle\">\n                <span class=\"k-switch-label-on\">{{onLabelMessage}}</span>\n                <span class=\"k-switch-label-off\">{{offLabelMessage}}</span>\n            </span>\n        </span>\n        <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n  "
            },] },
];
/** @nocollapse */
SwitchComponent.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["c" /* RTL */],] },] },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
SwitchComponent.propDecorators = {
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'onLabel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'offLabel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'checked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabindex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'tabIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'dragHandle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['dragHandle',] },],
    'wrapper': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['wrapper',] },],
    'direction': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.dir',] },],
    'ariaDisabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-disabled',] },],
    'ariaChecked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.aria-checked',] },],
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-widget',] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-switch',] },],
    'switchOnClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-switch-on',] },],
    'switchOffClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-switch-off',] },],
    'disabledClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-disabled',] },],
    'focusedClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'keyDown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
};


/***/ }),
/* 391 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TextBoxModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__textbox_textbox_directive__ = __webpack_require__(204);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__textbox_textbox_container_component__ = __webpack_require__(392);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_common__ = __webpack_require__(13);




/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the TextBox directive.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the TextBox module
 * import { TextBoxModule } from '@progress/kendo-angular-inputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, TextBoxModule], // import TextBox module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var TextBoxModule = (function () {
    function TextBoxModule() {
    }
    return TextBoxModule;
}());

TextBoxModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [__WEBPACK_IMPORTED_MODULE_1__textbox_textbox_directive__["a" /* TextBoxDirective */], __WEBPACK_IMPORTED_MODULE_2__textbox_textbox_container_component__["a" /* TextBoxContainerComponent */]],
                exports: [__WEBPACK_IMPORTED_MODULE_1__textbox_textbox_directive__["a" /* TextBoxDirective */], __WEBPACK_IMPORTED_MODULE_2__textbox_textbox_container_component__["a" /* TextBoxContainerComponent */]],
                imports: [__WEBPACK_IMPORTED_MODULE_3__angular_common__["CommonModule"]]
            },] },
];
/** @nocollapse */
TextBoxModule.ctorParameters = function () { return []; };


/***/ }),
/* 392 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TextBoxContainerComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__textbox_directive__ = __webpack_require__(204);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_dom_utils__ = __webpack_require__(70);




var isFunction = function (x) { return Object.prototype.toString.call(x) === '[object Function]'; };
/**
 * Represents the Kendo UI TextBoxContainer component for Angular.
 * Provides floating labels to `input` elements.
 *
 * @example
 * ```ng-template
 * <kendo-textbox-container floatingLabel="First name">
 *   <input kendoTextBox />
 * </kendo-textbox-container>
 * ```
 */
var TextBoxContainerComponent = (function () {
    function TextBoxContainerComponent(elementRef, renderer, changeDetectorRef) {
        this.elementRef = elementRef;
        this.renderer = renderer;
        this.changeDetectorRef = changeDetectorRef;
        /**
         * @hidden
         */
        this.focused = false;
        /**
         * @hidden
         */
        this.empty = true;
        /**
         * @hidden
         */
        this.invalid = false;
        this._subscriptions = [];
        this.renderer.removeAttribute(this.elementRef.nativeElement, "id");
    }
    Object.defineProperty(TextBoxContainerComponent.prototype, "hostClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TextBoxContainerComponent.prototype, "focusedClass", {
        get: function () {
            return this.focused;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TextBoxContainerComponent.prototype, "emptyClass", {
        get: function () {
            return this.empty;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TextBoxContainerComponent.prototype, "invalidClass", {
        get: function () {
            return this.invalid;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TextBoxContainerComponent.prototype.ngAfterContentInit = function () {
        var _this = this;
        if (!this.formControl && !this.textbox) {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["isDevMode"])()) {
                throw new Error("The TextBoxContainer requires an element with the kendoTextBox directive" +
                    " or a forms-bound component to function properly.");
            }
            return;
        }
        var control = this.textbox || this.formControl.valueAccessor;
        var setFocus = function (isFocused) { return function () {
            _this.focused = isFocused;
            _this.updateState();
            _this.changeDetectorRef.markForCheck();
        }; };
        if (control.onFocus instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]) {
            var focus_1 = control.onFocus.subscribe(setFocus(true));
            this._subscriptions.push(focus_1);
        }
        if (control.onBlur instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]) {
            var blur_1 = control.onBlur.subscribe(setFocus(false));
            this._subscriptions.push(blur_1);
        }
        var updateState = function () { return _this.updateState(); };
        updateState();
        if (this.formControl) {
            var s = this.formControl.valueChanges.subscribe(updateState);
            this._subscriptions.push(s);
        }
        if (this.textbox) {
            var input = this.textbox;
            if (this.id && input.id) {
                // input wins
                this.id = input.id;
            }
            else if (this.id) {
                input.id = this.id;
            }
            else if (input.id) {
                this.id = input.id;
            }
            else {
                var id = "_" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_dom_utils__["a" /* guid */])();
                input.id = id;
                this.id = id;
            }
        }
    };
    /**
     * @hidden
     */
    TextBoxContainerComponent.prototype.ngOnDestroy = function () {
        this._subscriptions.forEach(function (s) { return s.unsubscribe(); });
        this._subscriptions = [];
    };
    TextBoxContainerComponent.prototype.updateState = function () {
        var formControl = this.formControl;
        var empty = function (value) {
            // zero is not an empty value (e.g. NumericTextBox)
            if (value === 0) {
                return false;
            }
            // empty arrays are an empty value (e.g. MultiSelect)
            if (Array.isArray(value) && !value.length) {
                return true;
            }
            return !value;
        };
        if (formControl) {
            var valueAccessor = formControl.valueAccessor;
            if (isFunction(valueAccessor.isEmpty)) {
                this.empty = valueAccessor.isEmpty();
            }
            else {
                this.empty = empty(formControl.value);
            }
            this.invalid = formControl.invalid && (formControl.touched || formControl.dirty);
        }
        else {
            this.empty = empty(this.textbox.value);
        }
        this.changeDetectorRef.markForCheck();
    };
    return TextBoxContainerComponent;
}());

TextBoxContainerComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-textbox-container',
                template: "\n        <ng-content></ng-content>\n        <label *ngIf=\"floatingLabel\" [for]=\"id\" class=\"k-label\">{{ floatingLabel }}</label>\n    "
            },] },
];
/** @nocollapse */
TextBoxContainerComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
]; };
TextBoxContainerComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-textbox-container',] },],
    'focusedClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-focused',] },],
    'emptyClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-empty',] },],
    'invalidClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-state-invalid',] },],
    'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'floatingLabel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'textbox': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_1__textbox_directive__["a" /* TextBoxDirective */],] },],
    'formControl': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_2__angular_forms__["NgControl"],] },],
};


/***/ }),
/* 393 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CldrIntlService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__intl_members__ = __webpack_require__(126);




/**
 * The Internationalization service implemented by using
 * the CLDR Database via the `@telerik/kendo-intl` package.
 */
var CldrIntlService = (function () {
    /**
     * Creates a new instance of the service with the ID of the specified locale.
     *
     * Note that the parts of the locale ID can be separated by either `_` (underscore)
     * or `-` (dash).
     *
     * @param localeId - The default locale ID.
     */
    function CldrIntlService(localeId) {
        // Angular locales use underscore, e.g. en_US
        // while IETF BCP-47 specifies a dash.
        // https://tools.ietf.org/html/bcp47
        this.localeId = localeId.replace(/_/g, '-');
    }
    /**
     * Formats a string with placeholders such as
     * `Total amount {0:c}`.
     *
     * @param format - The format string.
     * @param values - One or more values to output in the format string placeholders.
     * @return - The formatted string.
     */
    CldrIntlService.prototype.format = function (format) {
        var values = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            values[_i - 1] = arguments[_i];
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["a" /* format */])(format, values, this.localeId);
    };
    /**
     * Converts an object to a string based on the specified format.
     *
     * @param value - The value to format.
     * @param format - The format to use.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return The formatted object.
     */
    CldrIntlService.prototype.toString = function (value, format, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["b" /* toString */])(value, format, localeId || this.localeId);
    };
    /**
     * Converts a `Date` object to a string based on the specified format.
     * If no format is provided, the default short date format is used.
     *
     * @param value - The date to format.
     * @param format - The format string or options.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return The formatted date.
     */
    CldrIntlService.prototype.formatDate = function (value, format, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["c" /* formatDate */])(value, format, localeId || this.localeId);
    };
    /**
     * Converts a string to a `Date` object based on the specified format.
     *
     * @param value - The string to convert.
     * @param format - The format strings or options.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return The parsed date.
     */
    CldrIntlService.prototype.parseDate = function (value, format, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["d" /* parseDate */])(value, format, localeId || this.localeId);
    };
    /**
     * Converts a string to a `Number`.
     *
     * @param value - The string to convert.
     * @param format - The format string or options.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return The parsed number.
     */
    CldrIntlService.prototype.parseNumber = function (value, format, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["e" /* parseNumber */])(value, localeId || this.localeId, format);
    };
    /**
     * Converts a `Number` to a string based on the specified format.
     *
     * @param value - The number to format.
     * @param format - The format string or options.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return The formatted number.
     */
    CldrIntlService.prototype.formatNumber = function (value, format, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["f" /* formatNumber */])(value, format, localeId || this.localeId);
    };
    /**
     * Returns the date names from the current locale based on the option.
     *
     * The available `type` values are:
     * - `era`
     * - `year`
     * - `quarter`
     * - `month`
     * - `week`
     * - `day`
     * - `dayperiod`
     * - `hour`
     * - `minute`
     * - `second`
     * - `zone`
     *
     * The available `nameType` values are:
     * - `wide`
     * - `narrow`
     * - `short`
     *
     * @param options - Detailed configuration for the desired date field name.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return - The day names from the current locale based on the option.
     * @returns The localized date field name from the current locale based on the option.
     *
     * @example
     * ```
     * dateFieldName({ type: 'day' });                      //returns 'day';
     * dateFieldName({ type: 'day', nameType: 'wide' });    //returns 'day';
     * dateFieldName({ type: 'month', nameType: 'short' }); //returns 'mo.';
     * dateFieldName({ type: 'month', nameType: 'wide' });  //returns 'month';
     * ```
     */
    CldrIntlService.prototype.dateFieldName = function (options, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["g" /* dateFieldName */])(options, localeId || this.localeId);
    };
    /**
     * Returns a localized date field name based on specific dateFieldName options.
     *
     * The available type values are:
     * - `day`
     * - `dayperiod`
     * - `months`
     * - `quarters`
     * - `eras`
     *
     * @param options - Detailed configuration for the desired date format.
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return - The day names from the current locale based on the option.
     */
    CldrIntlService.prototype.dateFormatNames = function (options, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["h" /* dateFormatNames */])(localeId || this.localeId, options);
    };
    /**
     * Splits the date format into objects containing information about each part of the pattern.
     *
     * @param format The format string or options.
     * @param localeId The optional locale id. If not specified, the `"en"` locale id is used.
     * @returns The date format parts.
     */
    CldrIntlService.prototype.splitDateFormat = function (format, localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["i" /* splitDateFormat */])(format, localeId || this.localeId);
    };
    /**
     * Returns the number symbols from the current locale based on the option.
     *
     * @param localeId - The locale ID to use in place of the default one. Optional.
     * @return - The number symbols from the current locale.
     */
    CldrIntlService.prototype.numberSymbols = function (localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["j" /* numberSymbols */])(localeId || this.localeId);
    };
    /**
     * Returns the first day index starting from Sunday.
     *
     * @param localeId - The locale ID. Defaults to the current locale ID.
     * @return - The index of the first day of the week (0 == Sunday).
     */
    CldrIntlService.prototype.firstDay = function (localeId) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__intl_members__["k" /* firstDay */])(localeId || this.localeId);
    };
    return CldrIntlService;
}());

CldrIntlService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
CldrIntlService.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["LOCALE_ID"],] },] },
]; };


/***/ }),
/* 394 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DatePipe; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__intl_service__ = __webpack_require__(127);


var isNumeric = function (value) { return !isNaN(value - parseFloat(value)); };
/**
 * Formats a date value to a string based on the requested format.
 * This pipe uses the IntlService.
 * @see IntlService
 *
 * @example
 * ```ng-template-no-run
 * <ul>
 *    <li>{{date | kendoDate }}</li>
 *    <li>{{milliseconds | kendoDate: 'M/dd/yyy' }}</li>
 *    <li>{{stringDate | kendoDate: 'G' }}</li>
 * </ul>
 * ```
 */
var DatePipe = (function () {
    /**
     * @hidden
     */
    function DatePipe(intlService) {
        this.intlService = intlService;
    }
    /**
     * Converts a `Date` object to a string based on the specified format.
     * If no format is provided, the default short date format is used.
     *
     * @param value - The date to format.
     * @param format - The format string or options.
     * @return - The formatted date.
     */
    DatePipe.prototype.transform = function (value, format) {
        if (format === void 0) { format = ""; }
        value = this.normalize(value);
        if (value) {
            return this.intlService.formatDate(value, format);
        }
        return value;
    };
    DatePipe.prototype.normalize = function (value) {
        if (value && typeof value === 'string') {
            value = this.intlService.parseDate(value);
        }
        else if (value && isNumeric(value)) {
            value = new Date(parseFloat(value));
        }
        return value;
    };
    return DatePipe;
}());

DatePipe.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Pipe"], args: [{
                name: 'kendoDate'
            },] },
];
/** @nocollapse */
DatePipe.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__intl_service__["a" /* IntlService */], },
]; };


/***/ }),
/* 395 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumberPipe; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__intl_service__ = __webpack_require__(127);


/**
 * Formats a number value to a string based on the requested format.
 * This pipe uses the `IntlService`.
 * @see IntlService
 *
 * @example
 * ```ng-template-no-run
 *   <ul>
 *     <li>{{decimal | kendoNumber:'c' }}</li>
 *     <li>{{stringNumber | kendoNumber:'p' }}</li>
 *     <li>{{int | kendoNumber:'##.00' }}</li>
 *  </ul>
 * ```
 */
var NumberPipe = (function () {
    /**
     * @hidden
     */
    function NumberPipe(intlService) {
        this.intlService = intlService;
    }
    /**
     * Converts a `Number` object to a string based on the specified format.
     * If no format is provided, the default short date format is used.
     *
     * @param value - The date to format.
     * @param format - The format string or options.
     * @return - The formatted number.
     */
    NumberPipe.prototype.transform = function (value, format) {
        if (typeof value === 'string') {
            value = this.intlService.parseNumber(value);
        }
        if (value !== null && value !== undefined) {
            return this.intlService.formatNumber(value, format);
        }
        return value;
    };
    return NumberPipe;
}());

NumberPipe.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Pipe"], args: [{
                name: 'kendoNumber'
            },] },
];
/** @nocollapse */
NumberPipe.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__intl_service__["a" /* IntlService */], },
]; };


/***/ }),
/* 396 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MessageService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/* tslint:disable:max-line-length */
/**
 * An abstract base class for a service that returns localized messages.
 *
 * For more information, refer to the section on [using the message service]({% slug messages_l10n_kendouiforangular %}#toc-using-the-message-service).
 */
var MessageService = (function () {
    function MessageService() {
    }
    return MessageService;
}());

MessageService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
MessageService.ctorParameters = function () { return []; };


/***/ }),
/* 397 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return compileTemplate; });
/**
 * @hidden
 */
var compileTemplate = function (templateRef) {
    var context = {};
    var embeddedView = templateRef.createEmbeddedView(context);
    var result = function (data) {
        Object.assign(context, data);
        embeddedView.detectChanges();
        var templateWrap = document.createElement('span');
        embeddedView.rootNodes.forEach(function (rootNode) {
            templateWrap.appendChild(rootNode.cloneNode(true));
        });
        return templateWrap;
    };
    result.destroy = function () {
        embeddedView.destroy();
        embeddedView = null;
    };
    return result;
};


/***/ }),
/* 398 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFExportComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_drawing__ = __webpack_require__(740);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_file_saver__ = __webpack_require__(230);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pdf_template_directive__ = __webpack_require__(207);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pdf_margin_component__ = __webpack_require__(206);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__compile_template__ = __webpack_require__(397);






/**
 * Represents the Kendo UI PDF Export component for Angular.
 *
 * @example
 * <kendo-pdf-export fileName="Report.pdf" paperSize="A4" [landscape]="true" avoidLinks >
 *   <kendo-pdf-export-margin top="2cm" left="1cm" right="1cm" bottom="2cm"></kendo-pdf-export-margin>
 *   <ng-template kendoPDFTemplate let-pageNum="pageNum" let-totalPages="totalPages">
 *     <div class="page-template">
 *       <div class="header">
 *         <div style="float: right">Page {{ pageNum }} of {{ totalPages }}</div>
 *         Multi-page export with automatic page breaking
 *       </div>
 *       <div class="footer">
 *         Page {{ pageNum }} of {{ totalPages }}
 *       </div>
 *     </div>
 *   </ng-template>
 * </kendo-pdf-export>
 */
var PDFExportComponent = (function () {
    function PDFExportComponent(element) {
        this.element = element;
        /**
         * The creator of the PDF document.
         * @default "Kendo UI PDF Generator"
         */
        this.creator = 'Kendo UI PDF Generator';
        /**
         * Specifies the file name of the exported PDF file.
         * @default "Export.pdf"
         */
        this.fileName = 'export.pdf';
    }
    Object.defineProperty(PDFExportComponent.prototype, "drawMargin", {
        get: function () {
            var marginComponent = this.marginComponent;
            var margin = this.margin;
            if (marginComponent) {
                margin = Object.assign(margin || {}, marginComponent.options);
            }
            return margin;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Saves the content as a PDF file with the specified name
     * @param fileName The name of the exported file name
     */
    PDFExportComponent.prototype.saveAs = function (fileName) {
        if (fileName === void 0) { fileName = this.fileName; }
        this.save(this.element.nativeElement, fileName);
    };
    /**
     * Exports the content as a Group for further processing
     *
     * @return The root group of the exported scene
     */
    PDFExportComponent.prototype.export = function () {
        return this.exportElement(this.element.nativeElement);
    };
    PDFExportComponent.prototype.save = function (element, fileName) {
        var _this = this;
        this.exportElement(element)
            .then(function (group) { return _this.exportGroup(group, _this.pdfOptions()); })
            .then(function (dataUri) { return _this.saveDataUri(dataUri, fileName, _this.saveOptions()); });
    };
    PDFExportComponent.prototype.exportElement = function (element) {
        var promise = this.drawElement(element, this.drawOptions());
        var cleanup = this.cleanup.bind(this);
        promise.then(cleanup, cleanup);
        return promise;
    };
    PDFExportComponent.prototype.cleanup = function () {
        if (this.pageTemplate) {
            this.pageTemplate.destroy();
            delete this.pageTemplate;
        }
    };
    PDFExportComponent.prototype.drawOptions = function () {
        if (this.pageTemplateDirective) {
            this.pageTemplate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__compile_template__["a" /* compileTemplate */])(this.pageTemplateDirective.templateRef);
        }
        return {
            avoidLinks: this.avoidLinks,
            forcePageBreak: this.forcePageBreak,
            keepTogether: this.keepTogether,
            margin: this.drawMargin,
            paperSize: this.paperSize,
            landscape: this.landscape,
            repeatHeaders: this.repeatHeaders,
            scale: this.scale,
            template: this.pageTemplate
        };
    };
    PDFExportComponent.prototype.pdfOptions = function () {
        return {
            author: this.author,
            creator: this.creator,
            date: this.date,
            imgDPI: this.imageResolution,
            keywords: this.keywords,
            landscape: this.landscape,
            margin: this.drawMargin,
            multiPage: true,
            paperSize: this.paperSize,
            producer: this.producer,
            subject: this.subject,
            title: this.title
        };
    };
    PDFExportComponent.prototype.saveOptions = function () {
        return {
            forceProxy: this.forceProxy,
            proxyData: this.proxyData,
            proxyTarget: this.proxyTarget,
            proxyURL: this.proxyURL
        };
    };
    PDFExportComponent.prototype.drawElement = function (element, options) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_drawing__["a" /* drawDOM */])(element, options);
    };
    PDFExportComponent.prototype.exportGroup = function (group, options) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_drawing__["b" /* exportPDF */])(group, options);
    };
    PDFExportComponent.prototype.saveDataUri = function (dataUri, fileName, options) {
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_file_saver__["a" /* saveAs */])(dataUri, fileName, options);
    };
    return PDFExportComponent;
}());

PDFExportComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-pdf-export',
                template: "<div><ng-content></ng-content></div>"
            },] },
];
/** @nocollapse */
PDFExportComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
]; };
PDFExportComponent.propDecorators = {
    'author': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'avoidLinks': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'forcePageBreak': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'keepTogether': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'creator': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'date': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'imageResolution': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'fileName': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'forceProxy': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'keywords': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'landscape': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'margin': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'paperSize': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'repeatHeaders': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'scale': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'proxyData': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'proxyURL': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'proxyTarget': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'producer': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'subject': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'title': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'pageTemplateDirective': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__pdf_template_directive__["a" /* PDFTemplateDirective */],] },],
    'marginComponent': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_4__pdf_margin_component__["a" /* PDFMarginComponent */],] },],
};


/***/ }),
/* 399 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export POPUP_CONTAINER */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopupService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__popup_component__ = __webpack_require__(208);


/**
 * Used to inject the Popup container. If not provided, the first root component of
 * the application is used.
 *
 * > The POPUP_CONTAINER can be used only with the [PopupService]({% slug service_popup %}) class.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Popup module
 * import { PopupModule, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { ElementRef, NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, PopupModule], // import Popup module
 *     bootstrap:    [AppComponent],
 *     providers: [{
 *       provide: POPUP_CONTAINER,
 *       useFactory: () => {
 *          //return the container ElementRef, where the popup will be injected
 *          return { nativeElement: document.body } as ElementRef;
 *       }
 *     }]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 * ```
 */
var POPUP_CONTAINER = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]('Popup Container');
/**
 * A service for opening Popup components dynamically.
 *
 * For more information on how to use this class, refer to the article on
 * the [Popup service]({% slug service_popup %}).
 *
 * @export
 * @class PopupService
 */
var PopupService = (function () {
    function PopupService(applicationRef, componentFactoryResolver, injector, container) {
        this.applicationRef = applicationRef;
        this.componentFactoryResolver = componentFactoryResolver;
        this.injector = injector;
        this.container = container;
    }
    Object.defineProperty(PopupService.prototype, "rootViewContainer", {
        /**
         * Gets the root view container into which the component will be injected.
         *
         * @returns {ComponentRef<any>}
         */
        get: function () {
            // https://github.com/angular/angular/blob/4.0.x/packages/core/src/application_ref.ts#L571
            var rootComponents = this.applicationRef.components || [];
            if (rootComponents[0]) {
                return rootComponents[0];
            }
            throw new Error("\n            View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n            See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n        ");
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PopupService.prototype, "rootViewContainerNode", {
        /**
         * Sets or gets the HTML element of the root component container.
         *
         * @returns {HTMLElement}
         */
        get: function () {
            return this.container ? this.container.nativeElement : this.getComponentRootNode(this.rootViewContainer);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Opens a Popup component.
     *
     * Created Popups are mounted in the DOM directly in the root application component.
     *
     * @param {PopupSettings} options - The options which define the Popup.
     * @returns {ComponentRef<PopupComponent>} - A reference to the Popup object.
     *
     * @example
     *
     * ```ts-no-run
     * _@Component({
     *   selector: 'my-app',
     *   template: `
     *     <ng-template #template>
     *      Popup content
     *     </ng-template>
     *     <button #anchor kendoButton (click)="toggle(anchor, template)">Toggle</button>
     *   `
     * })
     * export class AppComponent {
     *     public popupRef: PopupRef;
     *
     *     constructor( private popupService: PopupService ) {}
     *
     *     public open(anchor: ElementRef, template: TemplateRef<any>): void {
     *         if (this.popupRef) {
     *              this.popupRef.close();
     *              this.popupRef = null;
     *              return;
     *         }
     *
     *         this.popupRef = this.popupService.open({
     *           anchor: anchor,
     *           content: template
     *         });
     *     }
     * }
     * ```
     */
    PopupService.prototype.open = function (options) {
        if (options === void 0) { options = {}; }
        var _a = this.contentFrom(options.content), component = _a.component, nodes = _a.nodes;
        var popupComponentRef = this.appendPopup(nodes, options.appendTo);
        var popupInstance = popupComponentRef.instance;
        this.projectComponentInputs(popupComponentRef, options);
        popupComponentRef.changeDetectorRef.detectChanges();
        if (component) {
            component.changeDetectorRef.detectChanges();
        }
        return {
            close: function () {
                // XXX: Destroy is required due to this bug:
                // https://github.com/angular/angular/issues/15578
                //
                if (component) {
                    component.destroy();
                }
                else {
                    popupComponentRef.instance.content = null;
                    popupComponentRef.changeDetectorRef.detectChanges();
                }
                popupComponentRef.destroy();
            },
            content: component,
            popup: popupComponentRef,
            popupAnchorViewportLeave: popupInstance.anchorViewportLeave,
            popupClose: popupInstance.close,
            popupElement: this.getComponentRootNode(popupComponentRef),
            popupOpen: popupInstance.open
        };
    };
    PopupService.prototype.appendPopup = function (nodes, container) {
        var popupComponentRef = this.createComponent(__WEBPACK_IMPORTED_MODULE_1__popup_component__["a" /* PopupComponent */], nodes, container);
        if (!container) {
            this.rootViewContainerNode.appendChild(this.getComponentRootNode(popupComponentRef));
        }
        return popupComponentRef;
    };
    /**
     * Gets the HTML element for a component reference.
     *
     * @param {ComponentRef<any>} componentRef
     * @returns {HTMLElement}
     */
    PopupService.prototype.getComponentRootNode = function (componentRef) {
        return componentRef.hostView.rootNodes[0];
    };
    /**
     * Gets the `ComponentFactory` instance by its type.
     *
     * @param {*} componentClass
     * @param {*} nodes
     * @returns {ComponentRef<any>}
     */
    PopupService.prototype.getComponentFactory = function (componentClass) {
        return this.componentFactoryResolver.resolveComponentFactory(componentClass);
    };
    /**
     * Creates a component reference from a `Component` type class.
     *
     * @param {*} componentClass
     * @param {*} nodes
     * @returns {ComponentRef<any>}
     */
    PopupService.prototype.createComponent = function (componentClass, nodes, container) {
        var factory = this.getComponentFactory(componentClass);
        if (container) {
            return container.createComponent(factory, undefined, this.injector, nodes);
        }
        else {
            var component = factory.create(this.injector, nodes);
            this.applicationRef.attachView(component.hostView);
            return component;
        }
    };
    /**
     * Projects the inputs on the component.
     *
     * @param {ComponentRef<any>} component
     * @param {*} options
     * @returns {ComponentRef<any>}
     */
    PopupService.prototype.projectComponentInputs = function (component, options) {
        Object.getOwnPropertyNames(options)
            .filter(function (prop) { return prop !== 'content' || options.content instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"]; })
            .map(function (prop) {
            component.instance[prop] = options[prop];
        });
        return component;
    };
    /**
     * Gets the component and the nodes to append from the `content` option.
     *
     * @param {*} content
     * @returns {any}
     */
    PopupService.prototype.contentFrom = function (content) {
        if (!content || content instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"]) {
            return { component: null, nodes: [[]] };
        }
        var component = this.createComponent(content);
        var nodes = component ? [component.location.nativeElement] : [];
        return {
            component: component,
            nodes: [
                nodes // <ng-content>
            ]
        };
    };
    return PopupService;
}());

PopupService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
PopupService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ApplicationRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ComponentFactoryResolver"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injector"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [POPUP_CONTAINER,] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 400 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResizeSensorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_auditTime__ = __webpack_require__(105);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_auditTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_auditTime__);



/**
 * Emit up to 10 resize events per second by default.
 * Chosen as a compromise between responsiveness and performance.
 */
var DEFAULT_RATE_LIMIT = 10;
var computedProp = function (elem, prop) {
    return getComputedStyle(elem, null).getPropertyValue(prop);
};
var WRAP_STYLE = 'position: absolute; display: block; left: 0; top: 0; right: 0; bottom: 0; z-index: -1;' +
    'overflow: hidden; visibility: hidden;';
var EXPAND_CHILD_STYLE = 'position: absolute; left: 0; top: 0; transition: 0s;';
var SHRINK_CHILD_STYLE = EXPAND_CHILD_STYLE + 'width: 200%; height: 200%;';
/**
 * Resize Sensor Component
 *
 * Triggers a "resize" event whenever the parent DOM element size changes.
 */
var ResizeSensorComponent = (function () {
    function ResizeSensorComponent(element, zone, renderer) {
        this.element = element;
        this.zone = zone;
        this.renderer = renderer;
        /**
         * The maximum number of resize events to emit per second.
         *
         * Defaults to 10.
         */
        this.rateLimit = DEFAULT_RATE_LIMIT;
        /**
         * Fires when the parent DOM element has been resized.
         */
        this.resize = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.source = new __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__["Subject"]();
        this.initialized = false;
        this.acceptedSize = false;
    }
    ResizeSensorComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.zone.runOutsideAngular(function () {
            var scrollHandler = _this.scroll.bind(_this);
            var detachExpand = _this.renderer.listen(_this.expand.nativeElement, 'scroll', scrollHandler);
            var detachShrink = _this.renderer.listen(_this.shrink.nativeElement, 'scroll', scrollHandler);
            _this.detachScrollHandlers = function () {
                detachExpand();
                detachShrink();
            };
        });
    };
    ResizeSensorComponent.prototype.ngAfterViewChecked = function () {
        var _this = this;
        if (typeof document === 'undefined') {
            return;
        }
        if (this.initialized) {
            this.scroll();
            return;
        }
        var throttleTime = 1000 / (this.rateLimit || DEFAULT_RATE_LIMIT);
        this.subscription = this.source.asObservable()
            .auditTime(throttleTime)
            .subscribe(function () {
            if (!_this.acceptedSize) {
                _this.resize.emit();
            }
        });
        this.parentElement = this.element.nativeElement.parentElement;
        if (computedProp(this.parentElement, 'position') === 'static') {
            this.parentElement.style.position = 'relative';
        }
        this.reset();
        this.lastWidth = this.parentElement.offsetWidth;
        this.lastHeight = this.parentElement.offsetHeight;
        this.initialized = true;
    };
    ResizeSensorComponent.prototype.ngOnDestroy = function () {
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
        if (this.detachScrollHandlers) {
            this.detachScrollHandlers();
        }
    };
    /**
     * Sets the passed size or the element size as current.
     */
    ResizeSensorComponent.prototype.acceptSize = function (size) {
        if (size === void 0) { size = this.measure(); }
        this.lastWidth = size.width;
        this.lastHeight = size.height;
        this.acceptedSize = true;
    };
    /**
     * @hidden
     */
    ResizeSensorComponent.prototype.scroll = function (_event) {
        var _this = this;
        if (!this.parentElement) {
            return;
        }
        var _a = this.measure(), width = _a.width, height = _a.height;
        var sameSize = width === this.lastWidth && height === this.lastHeight;
        if (sameSize) {
            return;
        }
        this.lastWidth = width;
        this.lastHeight = height;
        this.acceptedSize = false;
        this.zone.runOutsideAngular(function () {
            _this.source.next();
        });
        this.reset();
    };
    ResizeSensorComponent.prototype.reset = function () {
        var expandChild = this.expandChild.nativeElement;
        expandChild.style.width = 100000 + 'px';
        expandChild.style.height = 100000 + 'px';
        var expand = this.expand.nativeElement;
        expand.scrollLeft = 100000;
        expand.scrollTop = 100000;
        var shrink = this.shrink.nativeElement;
        shrink.scrollLeft = 100000;
        shrink.scrollTop = 100000;
    };
    ResizeSensorComponent.prototype.measure = function () {
        return {
            height: this.parentElement.offsetHeight,
            width: this.parentElement.offsetWidth
        };
    };
    return ResizeSensorComponent;
}());

ResizeSensorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-resize-sensor',
                styles: [':host { ' + WRAP_STYLE + ' }'],
                template: '<div #expand style="' + WRAP_STYLE + '">' +
                    '  <div #expandChild style="' + EXPAND_CHILD_STYLE + '"></div>' +
                    '</div>' +
                    '<div #shrink style="' + WRAP_STYLE + '">' +
                    '  <div style="' + SHRINK_CHILD_STYLE + '"></div>' +
                    '</div>'
            },] },
];
/** @nocollapse */
ResizeSensorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
]; };
ResizeSensorComponent.propDecorators = {
    'rateLimit': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'resize': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'expand': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['expand',] },],
    'expandChild': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['expandChild',] },],
    'shrink': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['shrink',] },],
};


/***/ }),
/* 401 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export wrapIf */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return toUTC; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return quote; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return formatDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return toLower; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return normalizeField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isStringValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isDateValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return serializeFilters; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);

/**
 * @hidden
 * Creates a single arity function which wraps the value based on the provided predicate.
 * @example
 * ```
 * wrapIf(() => ignoreCase) `tolower(${field})`
 * //ignoreCase=true -> tolower(${field})`
 * //ignoreCase=false -> ${field}`
 * ```
 */
var wrapIf = function (predicate) { return function (str) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    return predicate() ? "" + str[0] + args[0] + str[1] : args[0];
}; };
/**
 * @hidden
 */
var toUTC = function (date) {
    return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
};
/**
 * @hidden
 */
var quote = function (_a) {
    var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;
    return ({
        value: "'" + value.replace(/'/g, "''") + "'",
        field: field,
        ignoreCase: ignoreCase,
        operator: operator
    });
};
/**
 * @hidden
 */
var formatDate = function (_a) {
    var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;
    return ({
        value: JSON.stringify(toUTC(value)).replace(/"/g, ""),
        field: field,
        ignoreCase: ignoreCase,
        operator: operator
    });
};
/**
 * @hidden
 */
var toLower = function (_a) {
    var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;
    return ({
        field: (_b = ["tolower(", ")"], _b.raw = ["tolower(", ")"], wrapIf(function () { return ignoreCase; })(_b, field)),
        value: value,
        ignoreCase: ignoreCase,
        operator: operator
    });
    var _b;
};
/**
 * @hidden
 */
var normalizeField = function (_a) {
    var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;
    return ({
        value: value,
        field: field.replace(/\./g, "/"),
        ignoreCase: ignoreCase,
        operator: operator
    });
};
/**
 * @hidden
 */
var isStringValue = function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["d" /* isString */])(x.value); };
/**
 * @hidden
 */
var isDateValue = function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* isDate */])(x.value); };
/**
 * @hidden
 */
var serializeFilters = function (map, join) { return function (filter) {
    var brackets = wrapIf(function () { return filter.filters.length > 1; });
    return (_a = ["(", ")"], _a.raw = ["(",
        ")"], brackets(_a, filter.filters
        .map(map)
        .join(join(filter))));
    var _a;
}; };


/***/ }),
/* 402 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return aggregateBy; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__transducers__ = __webpack_require__(212);

var identity = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["a" /* map */])(function (x) { return x; });
/**
 * Applies the specified [`AggregateDescriptors`]({% slug api_kendo-data-query_aggregatedescriptor %}) to the data.
 * Returns an [`AggregateResult`]({% slug api_kendo-data-query_aggregateresult %}) instance.
 *
 * @example
 * ```ts-no-run
 * const data = [
 *    { unitPrice: 23, unitsInStock: 21 },
 *    { unitPrice: 10, unitsInStock: 12 },
 *    { unitPrice: 20, unitsInStock: 33 }
 * ];
 *
 * const result = aggregateBy(data, [
 *   { aggregate: "sum", field: "unitPrice" },
 *   { aggregate: "sum", field: "unitsInStock" }
 * ]);
 *
 * //output:
 * // {
 * //     "unitPrice": { "sum": 53 },
 * //     "unitsInStock": { "sum": 66 }
 * // }
 * ```
 * @param {T[]} data - The data on which the calculation will be executed.
 * @param {AggregateDescriptor[]} descriptors - The aggregate operations that will be executed.
 * @param {any} transformers - For internal use.
 * @returns {AggregateResult} - The aggregated result.
 * For more information, refer to the [`aggregateresult`]({% slug api_kendo-data-query_aggregateresult %}) configuration.
 */
var aggregateBy = function (data, descriptors, transformers) {
    if (descriptors === void 0) { descriptors = []; }
    if (transformers === void 0) { transformers = identity; }
    var initialValue = {};
    if (!descriptors.length) {
        return initialValue;
    }
    var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["b" /* exec */])(transformers(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["c" /* aggregatesCombinator */])(descriptors)), initialValue, data);
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__transducers__["d" /* expandAggregates */])(result);
};


/***/ }),
/* 403 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return composeSortDescriptors; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__accessor__ = __webpack_require__(73);


var compare = function (a, b) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["f" /* isBlank */])(a)) {
        return a === b ? 0 : -1;
    }
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["f" /* isBlank */])(b)) {
        return 1;
    }
    if (a.localeCompare) {
        return a.localeCompare(b);
    }
    return a > b ? 1 : (a < b ? -1 : 0);
};
var compareDesc = function (a, b) { return compare(b, a); };
var descriptorAsFunc = function (descriptor) {
    var prop = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__accessor__["a" /* getter */])(descriptor.field, true);
    return function (a, b) { return (descriptor.dir === 'asc' ? compare : compareDesc)(prop(a), prop(b)); };
};
var initial = function (_a, _b) { return 0; };
/**
 * Converts the `SortDescriptors` into a [`Comparer`]({% slug api_kendo-data-query_comparer %})
 * function that can be used through `Array.sort`.
 *
 * If multiple descriptors are provided, sorting is applied in a right-to-left order.
 * @param {SortDescriptor[]} descriptors - The descriptors which will be converted.
 * @returns {Comparer} - The produced function.
 *
 * @example
 * ```ts-no-run
 * import { composeSortDescriptors } from '@progress/kendo-data-query';
 *
 * const data = [{ name: "Pork" }, { name: "Pepper" }, { name: "Beef" } ];
 * const comparer = composeSortDescriptors([{ field: "name", dir: "asc" }]);
 * const result = data.sort(comparer);
 * // output: [{ name: "Beef" }, { name: "Pepper" }, { name: "Pork" }];
 * ```
 */
var composeSortDescriptors = function (descriptors) { return (descriptors
    .filter(function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(x.dir); })
    .map(function (descriptor) { return descriptorAsFunc(descriptor); })
    .reduce(function (acc, curr) { return function (a, b) { return acc(a, b) || curr(a, b); }; }, initial)); };


/***/ }),
/* 404 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return firstDecadeOfCentury; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__normalize_year__ = __webpack_require__(131);

/**
 * A function that returns a `Date` object of the first decade in a century.
 *
 * @param date - The start date value.
 * @returns - The first year in a century.
 *
 * @example
 * ```ts-no-run
 * firstDecadeOfCentury(new Date(2017, 0, 1)); // 2000-1-1
 * firstDecadeOfCentury(new Date(2007, 10, 22)); // 2000-11-22
 * firstDecadeOfCentury(new Date(2126, 0, 1)); // 2100-1-1
 * ```
 */
var firstDecadeOfCentury = function (value) { return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__normalize_year__["a" /* normalizeYear */])(value, function (y) { return y - (y % 100); })); };


/***/ }),
/* 405 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return firstYearOfDecade; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__normalize_year__ = __webpack_require__(131);

/**
 * A function that returns a `Date` object of the first year in a decade.
 *
 * @param date - The start date value.
 * @returns - The first year in a decade.
 *
 * @example
 * ```ts-no-run
 * firstYearOfDecade(new Date(2017, 0, 1)); // 2010-1-1
 * firstYearOfDecade(new Date(2007, 10, 22)); // 2000-11-22
 * firstYearOfDecade(new Date(2026, 0, 1)); // 2020-1-1
 * ```
 */
var firstYearOfDecade = function (value) { return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__normalize_year__["a" /* normalizeYear */])(value, function (y) { return y - (y % 10); })); };


/***/ }),
/* 406 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDate; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create_date__ = __webpack_require__(51);

/**
 * A function which returns the passed date with a midnight time portion.
 *
 * @param date - The initial date.
 * @returns - The date with a midnight time portion.
 *
 * @example
 * ```ts-no-run
 * getDate(new Date(2016, 0, 15, 14, 30, 30)); // 2016-01-15 00:00:00
 * ```
 */
var getDate = function (date) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__create_date__["a" /* createDate */])(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
};


/***/ }),
/* 407 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isEqual; });
/**
 * A function that compares two dates.
 * The comparison also includes the time portion.
 *
 * @param candidate - The candidate date.
 * @param expected - The expected date.
 * @returns - A Boolean value indicating whether the values are equal.
 *
 * @example
 * ```ts-no-run
 * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 1)); // true
 * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 2)); // false
 * isEqual(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // false
 * ```
 */
var isEqual = function (candidate, expected) {
    if (!candidate && !expected) {
        return true;
    }
    return candidate && expected && candidate.getTime() === expected.getTime();
};


/***/ }),
/* 408 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MS_PER_DAY; });
/**
 * The duration of the day in milliseconds.
 */
var MS_PER_DAY = 86400000;


/***/ }),
/* 409 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return prevDayOfWeek; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__direction_enum__ = __webpack_require__(129);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__day_of_week__ = __webpack_require__(215);


/**
 * A function which returns a date by a specific week name.
 * For example, `Day.Monday`.
 *
 * @param date - The date to calculate from.
 * @param weekDay - The `Day` enum specifying the desired week day.
 * @returns - A `Date` instance.
 *
 * @example
 * ```ts-no-run
 * prevDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2015-12-30, Wednesday
 * ```
 */
var prevDayOfWeek = function (date, weekDay) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__day_of_week__["a" /* dayOfWeek */])(date, weekDay, __WEBPACK_IMPORTED_MODULE_0__direction_enum__["a" /* Direction */].Backward);
};


/***/ }),
/* 410 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setMonth; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_months__ = __webpack_require__(213);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create_date__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__last_day_of_month__ = __webpack_require__(130);



/**
 * @hidden
 */
var setMonth = function (value, month) {
    var day = value.getDate();
    var candidate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__create_date__["a" /* createDate */])(value.getFullYear(), month, day, value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());
    return candidate.getDate() === day ? candidate : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__last_day_of_month__["a" /* lastDayOfMonth */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__add_months__["a" /* addMonths */])(candidate, -1));
};


/***/ }),
/* 411 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setYear; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_months__ = __webpack_require__(213);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create_date__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__last_day_of_month__ = __webpack_require__(130);



/**
 * @hidden
 */
var setYear = function (value, year) {
    var month = value.getMonth();
    var candidate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__create_date__["a" /* createDate */])(year, month, value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());
    return candidate.getMonth() === month ? candidate : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__last_day_of_month__["a" /* lastDayOfMonth */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__add_months__["a" /* addMonths */])(candidate, -1));
};


/***/ }),
/* 412 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = alignElements;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__translate_to_point__ = __webpack_require__(135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__align_start__ = __webpack_require__(413);



function alignElements(elements, rect, alignment, axis, sizeField) {
    for (var idx = 0; idx < elements.length; idx++) {
        var bbox = elements[idx].clippedBBox();
        if (bbox) {
            var point = bbox.origin.clone();
            point[axis] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__align_start__["a" /* default */])(bbox.size[sizeField], rect, alignment || "start", axis, sizeField);
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__translate_to_point__["a" /* default */])(point, bbox, elements[idx]);
        }
    }
}
//# sourceMappingURL=align-elements.js.map


/***/ }),
/* 413 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = alignStart;

function alignStart(size, rect, align, axis, sizeField) {
    var start;
    if (align === "start") {
        start = rect.origin[axis];
    } else if (align === "end") {
        start = rect.origin[axis] + rect.size[sizeField] - size;
    } else {
        start = rect.origin[axis] + (rect.size[sizeField] - size) / 2;
    }

    return start;
}
//# sourceMappingURL=align-start.js.map


/***/ }),
/* 414 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = createStackElements;
function createStackElements(elements) {
    var stackElements = [];

    for (var idx = 0; idx < elements.length; idx++) {
        var element = elements[idx];
        var bbox = element.clippedBBox();
        if (bbox) {
            stackElements.push({
                element: element,
                bbox: bbox
            });
        }
    }

    return stackElements;
}
//# sourceMappingURL=create-stack-elements.js.map


/***/ }),
/* 415 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = wrapElements;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__translate_to_point__ = __webpack_require__(135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stack_elements__ = __webpack_require__(217);



function getStacks(elements, rect, sizeField) {
    var maxSize = rect.size[sizeField];
    var stacks = [];
    var stack = [];
    var stackSize = 0;
    var element, bbox;

    var addElementToStack = function() {
        stack.push({
            element: element,
            bbox: bbox
        });
    };

    for (var idx = 0; idx < elements.length; idx++) {
        element = elements[idx];

        bbox = element.clippedBBox();
        if (bbox) {
            var size = bbox.size[sizeField];
            if (stackSize + size > maxSize) {
                if (stack.length) {
                    stacks.push(stack);
                    stack = [];
                    addElementToStack();
                    stackSize = size;
                } else {
                    addElementToStack();
                    stacks.push(stack);
                    stack = [];
                    stackSize = 0;
                }
            } else {
                addElementToStack();
                stackSize += size;
            }
        }
    }

    if (stack.length) {
        stacks.push(stack);
    }

    return stacks;
}

function wrapElements(elements, rect, axis, otherAxis, sizeField) {
    var stacks = getStacks(elements, rect, sizeField);
    var origin = rect.origin.clone();
    var result = [];

    for (var idx = 0; idx < stacks.length; idx++) {
        var stack = stacks[idx];
        var startElement = stack[0];
        origin[otherAxis] = startElement.bbox.origin[otherAxis];
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__translate_to_point__["a" /* default */])(origin, startElement.bbox, startElement.element);
        startElement.bbox.origin[axis] = origin[axis];
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__stack_elements__["a" /* default */])(stack, axis, otherAxis, sizeField);
        result.push([]);
        for (var elementIdx = 0; elementIdx < stack.length; elementIdx++) {
            result[idx].push(stack[elementIdx].element);
        }
    }
    return result;
}
//# sourceMappingURL=wrap-elements.js.map


/***/ }),
/* 416 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__easing_functions__ = __webpack_require__(668);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common__ = __webpack_require__(8);




var now = Date.now || function() {
    return new Date().getTime();
};

var Animation = (function (Class) {
    function Animation(element, options) {
        Class.call(this);

        this.options = Object.assign({}, this.options, options);
        this.element = element;
    }

    if ( Class ) Animation.__proto__ = Class;
    Animation.prototype = Object.create( Class && Class.prototype );
    Animation.prototype.constructor = Animation;

    Animation.prototype.setup = function setup () {};
    Animation.prototype.step = function step () {};

    Animation.prototype.play = function play () {
        var this$1 = this;

        var options = this.options;
        var duration = options.duration;
        var delay = options.delay; if ( delay === void 0 ) delay = 0;
        var easing = __WEBPACK_IMPORTED_MODULE_0__easing_functions__[options.easing];
        var start = now() + delay;
        var finish = start + duration;

        if (duration === 0) {
            this.step(1);
            this.abort();
        } else {
            setTimeout(function () {
                var loop = function () {
                    if (this$1._stopped) {
                        return;
                    }

                    var wallTime = now();

                    var time = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["v" /* limitValue */])(wallTime - start, 0, duration);
                    var position = time / duration;
                    var easingPosition = easing(position, time, 0, 1, duration);

                    this$1.step(easingPosition);

                    if (wallTime < finish) {
                        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common__["h" /* animationFrame */])(loop);
                    } else {
                        this$1.abort();
                    }
                };

                loop();
            }, delay);
        }
    };

    Animation.prototype.abort = function abort () {
        this._stopped = true;
    };

    Animation.prototype.destroy = function destroy () {
        this.abort();
    };

    return Animation;
}(__WEBPACK_IMPORTED_MODULE_2__common__["d" /* Class */]));

Animation.prototype.options = {
    duration: 500,
    easing: "swing"
};

/* harmony default export */ __webpack_exports__["a"] = (Animation);
//# sourceMappingURL=animation.js.map


/***/ }),
/* 417 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node__ = __webpack_require__(218);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_traversable__ = __webpack_require__(226);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_map__ = __webpack_require__(38);




var GroupNode = (function (Node) {
    function GroupNode () {
        Node.apply(this, arguments);
    }

    if ( Node ) GroupNode.__proto__ = Node;
    GroupNode.prototype = Object.create( Node && Node.prototype );
    GroupNode.prototype.constructor = GroupNode;

    GroupNode.prototype.renderTo = function renderTo (ctx) {
        if (!this.visible()) {
            return;
        }

        ctx.save();

        this.setTransform(ctx);
        this.setClip(ctx);
        this.setOpacity(ctx);

        var childNodes = this.childNodes;
        for (var i = 0; i < childNodes.length; i++) {
            var child = childNodes[i];
            if (child.visible()) {
                child.renderTo(ctx);
            }
        }

        ctx.restore();
    };

    return GroupNode;
}(__WEBPACK_IMPORTED_MODULE_0__node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__mixins_traversable__["a" /* default */].extend(GroupNode.prototype, "childNodes");

__WEBPACK_IMPORTED_MODULE_2__node_map__["a" /* default */].Group = GroupNode;

/* harmony default export */ __webpack_exports__["a"] = (GroupNode);
//# sourceMappingURL=group-node.js.map


/***/ }),
/* 418 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_node__ = __webpack_require__(417);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_traversable__ = __webpack_require__(226);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common__ = __webpack_require__(8);




var FRAME_DELAY = 1000 / 60;

var RootNode = (function (GroupNode) {
    function RootNode(canvas) {
        GroupNode.call(this);

        this.canvas = canvas;
        this.ctx = canvas.getContext("2d");

        var invalidateHandler = this._invalidate.bind(this);
        this.invalidate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common__["g" /* throttle */])(function () {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common__["h" /* animationFrame */])(invalidateHandler);
        }, FRAME_DELAY);
    }

    if ( GroupNode ) RootNode.__proto__ = GroupNode;
    RootNode.prototype = Object.create( GroupNode && GroupNode.prototype );
    RootNode.prototype.constructor = RootNode;

    RootNode.prototype.destroy = function destroy () {
        GroupNode.prototype.destroy.call(this);
        this.canvas = null;
        this.ctx = null;
    };

    RootNode.prototype.load = function load (elements, pos, cors) {
        this.loadElements(elements, pos, cors);
        this._invalidate();
    };

    RootNode.prototype._invalidate = function _invalidate () {
        if (!this.ctx) {
            return;
        }
        this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
        this.renderTo(this.ctx);
    };

    return RootNode;
}(__WEBPACK_IMPORTED_MODULE_0__group_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__mixins_traversable__["a" /* default */].extend(RootNode.prototype, "childNodes");

/* harmony default export */ __webpack_exports__["a"] = (RootNode);
//# sourceMappingURL=root-node.js.map


/***/ }),
/* 419 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_surface__ = __webpack_require__(220);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__core_surface_factory__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__root_node__ = __webpack_require__(418);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__search_shapes_quad_tree__ = __webpack_require__(437);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__surface_cursor__ = __webpack_require__(676);







var Surface = (function (BaseSurface) {
    function Surface(element, options) {
        BaseSurface.call(this, element, options);

        this.element.innerHTML = this._template(this);

        var canvas = this.element.firstElementChild;
        var size = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["k" /* elementSize */])(element);

        canvas.width = size.width;
        canvas.height = size.height;

        this._rootElement = canvas;

        this._root = new __WEBPACK_IMPORTED_MODULE_3__root_node__["a" /* default */](canvas);

        this._mouseTrackHandler = this._trackMouse.bind(this);

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["l" /* bindEvents */])(this.element, {
            click: this._mouseTrackHandler,
            mousemove: this._mouseTrackHandler
        });
    }

    if ( BaseSurface ) Surface.__proto__ = BaseSurface;
    Surface.prototype = Object.create( BaseSurface && BaseSurface.prototype );
    Surface.prototype.constructor = Surface;

    Surface.prototype.destroy = function destroy () {
        BaseSurface.prototype.destroy.call(this);

        if (this._root) {
            this._root.destroy();
            this._root = null;
        }

        if (this._searchTree) {
            this._searchTree.clear();
            delete this._searchTree;
        }

        if (this._cursor) {
            this._cursor.destroy();
            delete this._cursor;
        }

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["m" /* unbindEvents */])(this.element, {
            click: this._mouseTrackHandler,
            mousemove: this._mouseTrackHandler
        });
    };

    Surface.prototype.draw = function draw (element) {
        BaseSurface.prototype.draw.call(this, element);
        this._root.load([ element ], undefined, this.options.cors);

        if (this._searchTree) {
            this._searchTree.add([ element ]);
        }
    };

    Surface.prototype.clear = function clear () {
        BaseSurface.prototype.clear.call(this);
        this._root.clear();

        if (this._searchTree) {
            this._searchTree.clear();
        }

        if (this._cursor) {
            this._cursor.clear();
        }
    };

    Surface.prototype.eventTarget = function eventTarget (e) {
        if (this._searchTree) {
            var point = this._surfacePoint(e);
            var shape = this._searchTree.pointShape(point);
            return shape;
        }
    };

    Surface.prototype.image = function image () {
        var ref = this;
        var root = ref._root;
        var rootElement = ref._rootElement;
        var loadingStates = [];

        root.traverse(function (childNode) {
            if (childNode.loading) {
                loadingStates.push(childNode.loading);
            }
        });

        var promise = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* createPromise */])();
        var resolveDataURL = function () {
            root._invalidate();

            try {
                var data = rootElement.toDataURL();
                promise.resolve(data);
            } catch (e) {
                promise.reject(e);
            }
        };

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["n" /* promiseAll */])(loadingStates).then(resolveDataURL, resolveDataURL);

        return promise;
    };

    Surface.prototype.suspendTracking = function suspendTracking () {
        BaseSurface.prototype.suspendTracking.call(this);
        if (this._searchTree) {
            this._searchTree.clear();
            delete this._searchTree;
        }
    };

    Surface.prototype.resumeTracking = function resumeTracking () {
        BaseSurface.prototype.resumeTracking.call(this);
        if (!this._searchTree) {
            this._searchTree = new __WEBPACK_IMPORTED_MODULE_4__search_shapes_quad_tree__["a" /* default */]();

            var childNodes = this._root.childNodes;
            var rootElements = [];
            for (var idx = 0; idx < childNodes.length; idx++) {
                rootElements.push(childNodes[idx].srcElement);
            }
            this._searchTree.add(rootElements);
        }
    };

    Surface.prototype._resize = function _resize () {
        this._rootElement.width = this._size.width;
        this._rootElement.height = this._size.height;

        this._root.invalidate();
    };

    Surface.prototype._template = function _template () {
        return "<canvas style='width: 100%; height: 100%;'></canvas>";
    };

    Surface.prototype._enableTracking = function _enableTracking () {
        this._searchTree = new __WEBPACK_IMPORTED_MODULE_4__search_shapes_quad_tree__["a" /* default */]();
        this._cursor = new __WEBPACK_IMPORTED_MODULE_5__surface_cursor__["a" /* default */](this);

        BaseSurface.prototype._enableTracking.call(this);
    };

    Surface.prototype._trackMouse = function _trackMouse (e) {
        if (this._suspendedTracking) {
            return;
        }

        var shape = this.eventTarget(e);

        if (e.type !== "click") {
            var currentShape = this._currentShape;
            if (currentShape && currentShape !== shape) {
                this.trigger("mouseleave", {
                    element: currentShape,
                    originalEvent: e,
                    type: "mouseleave"
                });
            }

            if (shape && currentShape !== shape) {
                this.trigger("mouseenter", {
                    element: shape,
                    originalEvent: e,
                    type: "mouseenter"
                });
            }

            this.trigger("mousemove", {
                element: shape,
                originalEvent: e,
                type: "mousemove"
            });

            this._currentShape = shape;
        } else if (shape) {
            this.trigger("click", {
                element: shape,
                originalEvent: e,
                type: "click"
            });
        }
    };

    return Surface;
}(__WEBPACK_IMPORTED_MODULE_0__core_surface__["a" /* default */]));

Surface.prototype.type = "canvas";

if (typeof document !== "undefined" && document.createElement("canvas").getContext) {
    __WEBPACK_IMPORTED_MODULE_0__core_surface__["a" /* default */].support.canvas = true;
    __WEBPACK_IMPORTED_MODULE_1__core_surface_factory__["a" /* default */].current.register("canvas", Surface, 20);
}

/* harmony default export */ __webpack_exports__["a"] = (Surface);

//# sourceMappingURL=surface.js.map


/***/ }),
/* 420 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var 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"
};

/* harmony default export */ __webpack_exports__["a"] = (namedColors);
//# sourceMappingURL=named-colors.js.map


/***/ }),
/* 421 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return RGB; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Bytes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return HSV; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return HSL; });
/* harmony export (immutable) */ __webpack_exports__["e"] = parseColor;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__class__ = __webpack_require__(137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__support__ = __webpack_require__(422);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__named_colors__ = __webpack_require__(420);




var browser = __WEBPACK_IMPORTED_MODULE_1__support__["a" /* default */].browser;

var matchNamedColor = function (color) {
    var colorNames = Object.keys(__WEBPACK_IMPORTED_MODULE_2__named_colors__["a" /* default */]);
    colorNames.push("transparent");

    var regexp = new RegExp("^(" + colorNames.join("|") + ")(\\W|$)", "i");
    matchNamedColor = function (color) { return regexp.exec(color); };

    return regexp.exec(color);
};

var BaseColor = (function (Class) {
    function BaseColor() { Class.call(this); }

    if ( Class ) BaseColor.__proto__ = Class;
    BaseColor.prototype = Object.create( Class && Class.prototype );
    BaseColor.prototype.constructor = BaseColor;
    BaseColor.prototype.toHSV = function toHSV () { return this; };

    BaseColor.prototype.toRGB = function toRGB () { return this; };

    BaseColor.prototype.toHex = function toHex () { return this.toBytes().toHex(); };

    BaseColor.prototype.toBytes = function toBytes () { return this; };

    BaseColor.prototype.toCss = function toCss () { return "#" + this.toHex(); };

    BaseColor.prototype.toCssRgba = function toCssRgba () {
        var rgb = this.toBytes();
        return ("rgba(" + (rgb.r) + ", " + (rgb.g) + ", " + (rgb.b) + ", " + (parseFloat((Number(this.a)).toFixed(3))) + ")");
    };

    BaseColor.prototype.toDisplay = function toDisplay () {
        if (browser.msie && browser.version < 9) {
            return this.toCss(); // no RGBA support; does it support any opacity in colors?
        }
        return this.toCssRgba();
    };

    BaseColor.prototype.equals = function equals (c) {
        return c === this || c !== null && this.toCssRgba() === parseColor(c).toCssRgba();
    };

    BaseColor.prototype.diff = function diff (other) {
        if (other === null) {
            return NaN;
        }

        var c1 = this.toBytes();
        var c2 = other.toBytes();

        return Math.sqrt(Math.pow((c1.r - c2.r) * 0.30, 2) +
                         Math.pow((c1.g - c2.g) * 0.59, 2) +
                         Math.pow((c1.b - c2.b) * 0.11, 2));
    };

    BaseColor.prototype.clone = function clone () {
        var c = this.toBytes();
        if (c === this) {
            c = new Bytes(c.r, c.g, c.b, c.a);
        }

        return c;
    };

    return BaseColor;
}(__WEBPACK_IMPORTED_MODULE_0__class__["a" /* default */]));

var RGB = (function (BaseColor) {
    function RGB(r, g, b, a) {
        BaseColor.call(this);

        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
    }

    if ( BaseColor ) RGB.__proto__ = BaseColor;
    RGB.prototype = Object.create( BaseColor && BaseColor.prototype );
    RGB.prototype.constructor = RGB;

    RGB.prototype.toHSV = function toHSV () {
        var ref = this;
        var r = ref.r;
        var g = ref.g;
        var b = ref.b;
        var min = Math.min(r, g, b);
        var max = Math.max(r, g, b);
        var delta = max - min;
        var v = max;
        var h, s;

        if (delta === 0) {
            return new HSV(0, 0, v, this.a);
        }

        if (max !== 0) {
            s = delta / max;
            if (r === max) {
                h = (g - b) / delta;
            } else if (g === max) {
                h = 2 + (b - r) / delta;
            } else {
                h = 4 + (r - g) / delta;
            }

            h *= 60;
            if (h < 0) {
                h += 360;
            }
        } else {
            s = 0;
            h = -1;
        }

        return new HSV(h, s, v, this.a);
    };

    RGB.prototype.toHSL = function toHSL () {
        var ref = this;
        var r = ref.r;
        var g = ref.g;
        var b = ref.b;
        var max = Math.max(r, g, b);
        var min = Math.min(r, g, b);
        var h, s, l = (max + min) / 2;

        if (max === min) {
            h = s = 0;
        } else {
            var d = max - min;
            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
            switch (max) {
                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
                case g: h = (b - r) / d + 2; break;
                case b: h = (r - g) / d + 4; break;
                default: break;
            }

            h *= 60;
            s *= 100;
            l *= 100;
        }

        return new HSL(h, s, l, this.a);
    };

    RGB.prototype.toBytes = function toBytes () {
        return new Bytes(this.r * 255, this.g * 255, this.b * 255, this.a);
    };

    return RGB;
}(BaseColor));

var Bytes = (function (RGB) {
    function Bytes(r, g, b, a) {
        RGB.call(this, Math.round(r), Math.round(g), Math.round(b), a);
    }

    if ( RGB ) Bytes.__proto__ = RGB;
    Bytes.prototype = Object.create( RGB && RGB.prototype );
    Bytes.prototype.constructor = Bytes;

    Bytes.prototype.toRGB = function toRGB () {
        return new RGB(this.r / 255, this.g / 255, this.b / 255, this.a);
    };

    Bytes.prototype.toHSV = function toHSV () {
        return this.toRGB().toHSV();
    };

    Bytes.prototype.toHSL = function toHSL () {
        return this.toRGB().toHSL();
    };

    Bytes.prototype.toHex = function toHex () {
        return hex(this.r, 2) + hex(this.g, 2) + hex(this.b, 2);
    };

    Bytes.prototype.toBytes = function toBytes () {
        return this;
    };

    return Bytes;
}(RGB));

function hex(n, width, pad) {
    if ( pad === void 0 ) pad = "0";

    var result = n.toString(16);
    while (width > result.length) {
        result = pad + result;
    }

    return result;
}

var HSV = (function (BaseColor) {
    function HSV(h, s, v, a) {
        BaseColor.call(this);

        this.h = h;
        this.s = s;
        this.v = v;
        this.a = a;
    }

    if ( BaseColor ) HSV.__proto__ = BaseColor;
    HSV.prototype = Object.create( BaseColor && BaseColor.prototype );
    HSV.prototype.constructor = HSV;

    HSV.prototype.toRGB = function toRGB () {
        var ref = this;
        var h = ref.h;
        var s = ref.s;
        var v = ref.v;
        var r, g, b;

        if (s === 0) {
            r = g = b = v;
        } else {
            h /= 60;

            var i = Math.floor(h);
            var f = h - i;
            var p = v * (1 - s);
            var q = v * (1 - s * f);
            var t = v * (1 - s * (1 - f));

            switch (i) {
                case 0: r = v; g = t; b = p; break;
                case 1: r = q; g = v; b = p; break;
                case 2: r = p; g = v; b = t; break;
                case 3: r = p; g = q; b = v; break;
                case 4: r = t; g = p; b = v; break;
                default: r = v; g = p; b = q; break;
            }
        }

        return new RGB(r, g, b, this.a);
    };

    HSV.prototype.toHSL = function toHSL () {
        return this.toRGB().toHSL();
    };

    HSV.prototype.toBytes = function toBytes () {
        return this.toRGB().toBytes();
    };

    return HSV;
}(BaseColor));

var HSL = (function (BaseColor) {
    function HSL(h, s, l, a) {
        BaseColor.call(this);

        this.h = h;
        this.s = s;
        this.l = l;
        this.a = a;
    }

    if ( BaseColor ) HSL.__proto__ = BaseColor;
    HSL.prototype = Object.create( BaseColor && BaseColor.prototype );
    HSL.prototype.constructor = HSL;

    HSL.prototype.toRGB = function toRGB () {
        var ref = this;
        var h = ref.h;
        var s = ref.s;
        var l = ref.l;
        var r, g, b;

        if (s === 0) {
            r = g = b = l; // achromatic
        } else {
            h /= 360;
            s /= 100;
            l /= 100;

            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
            var p = 2 * l - q;
            r = hue2rgb(p, q, h + 1 / 3);
            g = hue2rgb(p, q, h);
            b = hue2rgb(p, q, h - 1 / 3);
        }

        return new RGB(r, g, b, this.a);
    };

    HSL.prototype.toHSV = function toHSV () {
        return this.toRGB().toHSV();
    };

    HSL.prototype.toBytes = function toBytes () {
        return this.toRGB().toBytes();
    };

    return HSL;
}(BaseColor));

function hue2rgb(p, q, s) {
    var t = s;

    if (t < 0) {
        t += 1;
    }

    if (t > 1) {
        t -= 1;
    }

    if (t < 1 / 6) {
        return p + (q - p) * 6 * t;
    }

    if (t < 1 / 2) {
        return q;
    }

    if (t < 2 / 3) {
        return p + (q - p) * (2 / 3 - t) * 6;
    }

    return p;
}



function parseColor(value, safe) {
    var m, ret;

    if (value == null || value === "none") {
        return null;
    }

    if (value instanceof BaseColor) {
        return value;
    }

    var color = value.toLowerCase();
    if ((m = matchNamedColor(color))) {
        if (m[1] === "transparent") {
            color = new RGB(1, 1, 1, 0);
        } else {
            color = parseColor(__WEBPACK_IMPORTED_MODULE_2__named_colors__["a" /* default */][m[1]], safe);
        }
        color.match = [ m[1] ];
        return color;
    }
    if ((m = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(color))) {
        ret = new Bytes(parseInt(m[1], 16),
                        parseInt(m[2], 16),
                        parseInt(m[3], 16), 1);
    } else if ((m = /^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(color))) {
        ret = new Bytes(parseInt(m[1] + m[1], 16),
                        parseInt(m[2] + m[2], 16),
                        parseInt(m[3] + m[3], 16), 1);
    } else if ((m = /^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(color))) {
        ret = new Bytes(parseInt(m[1], 10),
                        parseInt(m[2], 10),
                        parseInt(m[3], 10), 1);
    } else if ((m = /^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(color))) {
        ret = new Bytes(parseInt(m[1], 10),
                        parseInt(m[2], 10),
                        parseInt(m[3], 10), parseFloat(m[4]));
    } else if ((m = /^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(color))) {
        ret = new RGB(parseFloat(m[1]) / 100,
                      parseFloat(m[2]) / 100,
                      parseFloat(m[3]) / 100, 1);
    } else if ((m = /^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(color))) {
        ret = new RGB(parseFloat(m[1]) / 100,
                      parseFloat(m[2]) / 100,
                      parseFloat(m[3]) / 100, parseFloat(m[4]));
    }

    if (ret) {
        ret.match = m;
    } else if (!safe) {
        throw new Error("Cannot parse color: " + color);
    }

    return ret;
}

//# sourceMappingURL=parse-color.js.map


/***/ }),
/* 422 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var support = {};

if (typeof window !== 'undefined') {
    support.browser = (function(userAgent) {
        var browserRxs = {
            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
        };

        var browser;

        for (var agent in browserRxs) {
            if (browserRxs.hasOwnProperty(agent)) {
                var match = userAgent.match(browserRxs[agent]);
                if (match) {
                    browser = {};
                    browser[agent] = true;
                    browser[match[1].toLowerCase().split(" ")[0].split("/")[0]] = true;
                    browser.version = parseInt(document.documentMode || match[2], 10);

                    break;
                }
            }
        }

        return browser;

    })(window.navigator.userAgent);
}

/* harmony default export */ __webpack_exports__["a"] = (support);


//# sourceMappingURL=support.js.map


/***/ }),
/* 423 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DASH_ARRAYS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SOLID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return BUTT; });
var 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 ]
};

var SOLID = "solid";
var BUTT = "butt";


//# sourceMappingURL=constants.js.map


/***/ }),
/* 424 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__ = __webpack_require__(132);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__math_ellipse_extreme_angles__ = __webpack_require__(426);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(5);








var PI_DIV_2 = Math.PI / 2;

var Circle = (function (Class) {
    function Circle(center, radius) {
        if ( center === void 0 ) center = new __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */]();
        if ( radius === void 0 ) radius = 0;

        Class.call(this);

        this.setCenter(center);
        this.setRadius(radius);
    }

    if ( Class ) Circle.__proto__ = Class;
    Circle.prototype = Object.create( Class && Class.prototype );
    Circle.prototype.constructor = Circle;

    Circle.prototype.setCenter = function setCenter (value) {
        this._observerField("center", __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].create(value));
        this.geometryChange();
        return this;
    };

    Circle.prototype.getCenter = function getCenter () {
        return this.center;
    };

    Circle.prototype.equals = function equals (other) {
        return other &&
               other.center.equals(this.center) &&
               other.radius === this.radius;
    };

    Circle.prototype.clone = function clone () {
        return new Circle(this.center.clone(), this.radius);
    };

    Circle.prototype.pointAt = function pointAt (angle) {
        return this._pointAt(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["h" /* rad */])(angle));
    };

    Circle.prototype.bbox = function bbox (matrix) {
        var this$1 = this;

        var extremeAngles = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__math_ellipse_extreme_angles__["a" /* default */])(this.center, this.radius, this.radius, matrix);
        var minPoint = __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].maxPoint();
        var maxPoint = __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].minPoint();

        for (var i = 0; i < 4; i++) {
            var currentPointX = this$1._pointAt(extremeAngles.x + i * PI_DIV_2).transformCopy(matrix);
            var currentPointY = this$1._pointAt(extremeAngles.y + i * PI_DIV_2).transformCopy(matrix);
            var currentPoint = new __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */](currentPointX.x, currentPointY.y);

            minPoint = __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].min(minPoint, currentPoint);
            maxPoint = __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */].max(maxPoint, currentPoint);
        }

        return __WEBPACK_IMPORTED_MODULE_3__rect__["a" /* default */].fromPoints(minPoint, maxPoint);
    };

    Circle.prototype._pointAt = function _pointAt (angle) {
        var ref = this;
        var center = ref.center;
        var radius = ref.radius;

        return new __WEBPACK_IMPORTED_MODULE_2__point__["a" /* default */](
            center.x + radius * Math.cos(angle),
            center.y + radius * Math.sin(angle)
        );
    };

    Circle.prototype.containsPoint = function containsPoint (point) {
        var ref = this;
        var center = ref.center;
        var radius = ref.radius;
        var inCircle = Math.pow(point.x - center.x, 2) +
            Math.pow(point.y - center.y, 2) <= Math.pow(radius, 2);
        return inCircle;
    };

    Circle.prototype._isOnPath = function _isOnPath (point, width) {
        var ref = this;
        var center = ref.center;
        var radius = ref.radius;
        var pointDistance = center.distanceTo(point);

        return radius - width <= pointDistance && pointDistance <= radius + width;
    };

    return Circle;
}(__WEBPACK_IMPORTED_MODULE_5__common__["d" /* Class */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_accessors__["a" /* default */])(Circle.prototype, [ "radius" ]);
__WEBPACK_IMPORTED_MODULE_1__mixins_observers_mixin__["a" /* default */].extend(Circle.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Circle);
//# sourceMappingURL=circle.js.map


/***/ }),
/* 425 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = close;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);




function close(a, b, tolerance) {
    if ( tolerance === void 0 ) tolerance = __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* PRECISION */];

    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["d" /* round */])(Math.abs(a - b), tolerance) === 0;
}
//# sourceMappingURL=close.js.map


/***/ }),
/* 426 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = ellipseExtremeAngles;
function ellipseExtremeAngles(center, rx, ry, matrix) {
    var extremeX = 0;
    var extremeY = 0;

    if (matrix) {
        extremeX = Math.atan2(matrix.c * ry, matrix.a * rx);
        if (matrix.b !== 0) {
            extremeY = Math.atan2(matrix.d * ry, matrix.b * rx);
        }
    }

    return {
        x: extremeX,
        y: extremeY
    };
}
//# sourceMappingURL=ellipse-extreme-angles.js.map


/***/ }),
/* 427 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = lineIntersectionsCount;
function lineIntersectionsCount(a, b, point) {
    var intersects;
    if (a.x !== b.x) {
        var minX = Math.min(a.x, b.x);
        var maxX = Math.max(a.x, b.x);
        var minY = Math.min(a.y, b.y);
        var maxY = Math.max(a.y, b.y);
        var inRange = minX <= point.x && point.x < maxX;

        if (minY === maxY) {
            intersects = point.y <= minY && inRange;
        } else {
            intersects = inRange && (((maxY - minY) * ((a.x - b.x) * (a.y - b.y) > 0 ? point.x - minX : maxX - point.x)) / (maxX - minX) + minY - point.y) >= 0;
        }
    }

    return intersects ? 1 : 0;
}
//# sourceMappingURL=line-intersections-count.js.map


/***/ }),
/* 428 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = solveCubicEquation;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__complex_number__ = __webpack_require__(688);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);




function numberSign(x) {
    return x < 0 ? -1 : 1;
}

function solveQuadraticEquation(a, b, c) {
    var squareRoot = Math.sqrt(Math.pow(b, 2) - 4 * a * c);
    return [
        (-b + squareRoot) / (2 * a),
        (-b - squareRoot) / (2 * a)
    ];
}

//Cardano's formula
function solveCubicEquation(a, b, c, d) {
    if (a === 0) {
        return solveQuadraticEquation(b, c, d);
    }

    var p = (3 * a * c - Math.pow(b, 2)) / (3 * Math.pow(a, 2));
    var q = (2 * Math.pow(b, 3) - 9 * a * b * c + 27 * Math.pow(a, 2) * d) / (27 * Math.pow(a, 3));
    var Q = Math.pow(p / 3, 3) + Math.pow(q / 2, 2);
    var i = new __WEBPACK_IMPORTED_MODULE_0__complex_number__["a" /* default */](0,1);
    var b3a = -b / (3 * a);
    var x1, x2, y1, y2, y3, z1, z2;

    if (Q < 0) {
        x1 = new __WEBPACK_IMPORTED_MODULE_0__complex_number__["a" /* default */](-q / 2, Math.sqrt(-Q)).nthRoot(3);
        x2 = new __WEBPACK_IMPORTED_MODULE_0__complex_number__["a" /* default */](-q / 2, - Math.sqrt(-Q)).nthRoot(3);
    } else {
        x1 = -q / 2 + Math.sqrt(Q);
        x1 = new __WEBPACK_IMPORTED_MODULE_0__complex_number__["a" /* default */](numberSign(x1) * Math.pow(Math.abs(x1), 1 / 3));
        x2 = -q / 2 - Math.sqrt(Q);
        x2 = new __WEBPACK_IMPORTED_MODULE_0__complex_number__["a" /* default */](numberSign(x2) * Math.pow(Math.abs(x2), 1 / 3));
    }

    y1 = x1.add(x2);

    z1 = x1.add(x2).multiplyConstant(-1 / 2);
    z2 = x1.add(x2.negate()).multiplyConstant(Math.sqrt(3) / 2);

    y2 = z1.add(i.multiply(z2));
    y3 = z1.add(i.negate().multiply(z2));

    var result = [];

    if (y1.isReal()) {
        result.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* round */])(y1.real + b3a, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* PRECISION */]));
    }
    if (y2.isReal()) {
        result.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* round */])(y2.real + b3a, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* PRECISION */]));
    }
    if (y3.isReal()) {
        result.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* round */])(y3.real + b3a, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* PRECISION */]));
    }

    return result;
}
//# sourceMappingURL=solve-cubic-equation.js.map


/***/ }),
/* 429 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = toCubicPolynomial;
function toCubicPolynomial(points, field) {
    return [ -points[0][field] + 3 * points[1][field] - 3 * points[2][field] + points[3][field],
        3 * (points[0][field] - 2 * points[1][field] + points[2][field]),
        3 * (-points[0][field] + points[1][field]),
        points[0][field]
    ];
}
//# sourceMappingURL=to-cubic-polynomial.js.map


/***/ }),
/* 430 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__accessors_define_point_accessors__ = __webpack_require__(134);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__transform__ = __webpack_require__(39);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__math_is_out_of_end_point__ = __webpack_require__(691);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__math_calculate_curve_at__ = __webpack_require__(222);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__math_has_roots_in_range__ = __webpack_require__(690);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__math_curve_intersections_count__ = __webpack_require__(689);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__math_line_intersections_count__ = __webpack_require__(427);













var Segment = (function (Class) {
    function Segment(anchor, controlIn, controlOut) {
        Class.call(this);

        this.anchor(anchor || new __WEBPACK_IMPORTED_MODULE_4__point__["a" /* default */]());
        this.controlIn(controlIn);
        this.controlOut(controlOut);
    }

    if ( Class ) Segment.__proto__ = Class;
    Segment.prototype = Object.create( Class && Class.prototype );
    Segment.prototype.constructor = Segment;

    Segment.prototype.bboxTo = function bboxTo (toSegment, matrix) {
        var segmentAnchor = this.anchor().transformCopy(matrix);
        var toSegmentAnchor = toSegment.anchor().transformCopy(matrix);
        var rect;

        if (this.controlOut() && toSegment.controlIn()) {
            rect = this._curveBoundingBox(
                segmentAnchor, this.controlOut().transformCopy(matrix),
                toSegment.controlIn().transformCopy(matrix), toSegmentAnchor
            );
        } else {
            rect = this._lineBoundingBox(segmentAnchor, toSegmentAnchor);
        }

        return rect;
    };

    Segment.prototype._lineBoundingBox = function _lineBoundingBox (p1, p2) {
        return __WEBPACK_IMPORTED_MODULE_3__rect__["a" /* default */].fromPoints(p1, p2);
    };

    Segment.prototype._curveBoundingBox = function _curveBoundingBox (p1, cp1, cp2, p2) {
        var points = [ p1, cp1, cp2, p2 ];
        var extremesX = this._curveExtremesFor(points, "x");
        var extremesY = this._curveExtremesFor(points, "y");
        var xLimits = arrayLimits([ extremesX.min, extremesX.max, p1.x, p2.x ]);
        var yLimits = arrayLimits([ extremesY.min, extremesY.max, p1.y, p2.y ]);

        return __WEBPACK_IMPORTED_MODULE_3__rect__["a" /* default */].fromPoints(new __WEBPACK_IMPORTED_MODULE_4__point__["a" /* default */](xLimits.min, yLimits.min), new __WEBPACK_IMPORTED_MODULE_4__point__["a" /* default */](xLimits.max, yLimits.max));
    };

    Segment.prototype._curveExtremesFor = function _curveExtremesFor (points, field) {
        var extremes = this._curveExtremes(
            points[0][field], points[1][field],
            points[2][field], points[3][field]
        );

        return {
            min: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__math_calculate_curve_at__["a" /* default */])(extremes.min, field, points),
            max: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__math_calculate_curve_at__["a" /* default */])(extremes.max, field, points)
        };
    };

    Segment.prototype._curveExtremes = function _curveExtremes (x1, x2, x3, x4) {
        var a = x1 - 3 * x2 + 3 * x3 - x4;
        var b = - 2 * (x1 - 2 * x2 + x3);
        var c = x1 - x2;
        var sqrt = Math.sqrt(b * b - 4 * a * c);
        var t1 = 0;
        var t2 = 1;

        if (a === 0) {
            if (b !== 0) {
                t1 = t2 = -c / b;
            }
        } else if (!isNaN(sqrt)) {
            t1 = (- b + sqrt) / (2 * a);
            t2 = (- b - sqrt) / (2 * a);
        }

        var min = Math.max(Math.min(t1, t2), 0);
        if (min < 0 || min > 1) {
            min = 0;
        }

        var max = Math.min(Math.max(t1, t2), 1);
        if (max > 1 || max < 0) {
            max = 1;
        }

        return {
            min: min,
            max: max
        };
    };

    Segment.prototype._intersectionsTo = function _intersectionsTo (segment, point) {
        var intersectionsCount;
        if (this.controlOut() && segment.controlIn()) {
            intersectionsCount = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__math_curve_intersections_count__["a" /* default */])([ this.anchor(), this.controlOut(), segment.controlIn(), segment.anchor() ], point, this.bboxTo(segment));
        } else {
            intersectionsCount = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__math_line_intersections_count__["a" /* default */])(this.anchor(), segment.anchor(), point);
        }
        return intersectionsCount;
    };

    Segment.prototype._isOnCurveTo = function _isOnCurveTo (segment, point, width, endSegment) {
        var bbox = this.bboxTo(segment).expand(width, width);
        if (bbox.containsPoint(point)) {
            var p1 = this.anchor();
            var p2 = this.controlOut();
            var p3 = segment.controlIn();
            var p4 = segment.anchor();

            if (endSegment === "start" && p1.distanceTo(point) <= width) {
                return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__math_is_out_of_end_point__["a" /* default */])(p1, p2, point);
            } else if (endSegment === "end" && p4.distanceTo(point) <= width) {
                return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__math_is_out_of_end_point__["a" /* default */])(p4, p3, point);
            }

            //the approach is not entirely correct but is close and the alternatives are solving a 6th degree polynomial or testing the segment points
            var points = [ p1, p2, p3, p4 ];
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__math_has_roots_in_range__["a" /* default */])(points, point, "x", "y", width) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__math_has_roots_in_range__["a" /* default */])(points, point, "y", "x", width)) {
                return true;
            }
            var rotation = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__transform__["a" /* default */])().rotate(45, point);
            var rotatedPoints = [ p1.transformCopy(rotation), p2.transformCopy(rotation), p3.transformCopy(rotation), p4.transformCopy(rotation) ];
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__math_has_roots_in_range__["a" /* default */])(rotatedPoints, point, "x", "y", width) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__math_has_roots_in_range__["a" /* default */])(rotatedPoints, point, "y", "x", width);
        }
    };

    Segment.prototype._isOnLineTo = function _isOnLineTo (segment, point, width) {
        var p1 = this.anchor();
        var p2 = segment.anchor();
        var angle = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["i" /* deg */])(Math.atan2(p2.y - p1.y, p2.x - p1.x));
        var rect = new __WEBPACK_IMPORTED_MODULE_3__rect__["a" /* default */]([ p1.x, p1.y - width / 2 ], [ p1.distanceTo(p2), width ]);
        return rect.containsPoint(point.transformCopy(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__transform__["a" /* default */])().rotate(-angle, p1)));
    };

    Segment.prototype._isOnPathTo = function _isOnPathTo (segment, point, width, endSegment) {
        var isOnPath;
        if (this.controlOut() && segment.controlIn()) {
            isOnPath = this._isOnCurveTo(segment, point, width / 2, endSegment);
        } else {
            isOnPath = this._isOnLineTo(segment, point, width);
        }
        return isOnPath;
    };

    return Segment;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__accessors_define_point_accessors__["a" /* default */])(Segment.prototype, [ "anchor", "controlIn", "controlOut" ]);
__WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__["a" /* default */].extend(Segment.prototype);

function arrayLimits(arr) {
    var length = arr.length;
    var min = __WEBPACK_IMPORTED_MODULE_6__util__["f" /* MAX_NUM */];
    var max = __WEBPACK_IMPORTED_MODULE_6__util__["g" /* MIN_NUM */];

    for (var i = 0; i < length; i ++) {
        max = Math.max(max, arr[i]);
        min = Math.min(min, arr[i]);
    }

    return {
        min: min,
        max: max
    };
}

/* harmony default export */ __webpack_exports__["a"] = (Segment);
//# sourceMappingURL=segment.js.map


/***/ }),
/* 431 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__to_matrix__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matrix__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__point__ = __webpack_require__(19);






var Transformation = (function (Class) {
    function Transformation(matrix) {
        if ( matrix === void 0 ) matrix = __WEBPACK_IMPORTED_MODULE_3__matrix__["a" /* default */].unit();

        Class.call(this);

        this._matrix = matrix;
    }

    if ( Class ) Transformation.__proto__ = Class;
    Transformation.prototype = Object.create( Class && Class.prototype );
    Transformation.prototype.constructor = Transformation;

    Transformation.prototype.clone = function clone () {
        return new Transformation(
            this._matrix.clone()
        );
    };

    Transformation.prototype.equals = function equals (other) {
        return other &&
               other._matrix.equals(this._matrix);
    };

    Transformation.prototype.translate = function translate (x, y) {
        this._matrix = this._matrix.multiplyCopy(__WEBPACK_IMPORTED_MODULE_3__matrix__["a" /* default */].translate(x, y));

        this._optionsChange();
        return this;
    };

    Transformation.prototype.scale = function scale (scaleX, scaleY, origin) {
        if ( scaleY === void 0 ) scaleY = scaleX;
        if ( origin === void 0 ) origin = null;

        var originPoint = origin;

        if (originPoint) {
            originPoint = __WEBPACK_IMPORTED_MODULE_4__point__["a" /* default */].create(originPoint);
            this._matrix = this._matrix.multiplyCopy(__WEBPACK_IMPORTED_MODULE_3__matrix__["a" /* default */].translate(originPoint.x, originPoint.y));
        }

        this._matrix = this._matrix.multiplyCopy(__WEBPACK_IMPORTED_MODULE_3__matrix__["a" /* default */].scale(scaleX, scaleY));

        if (originPoint) {
            this._matrix = this._matrix.multiplyCopy(__WEBPACK_IMPORTED_MODULE_3__matrix__["a" /* default */].translate(-originPoint.x, -originPoint.y));
        }

        this._optionsChange();
        return this;
    };

    Transformation.prototype.rotate = function rotate (angle, origin) {
        var originPoint = __WEBPACK_IMPORTED_MODULE_4__point__["a" /* default */].create(origin) || __WEBPACK_IMPORTED_MODULE_4__point__["a" /* default */].ZERO;

        this._matrix = this._matrix.multiplyCopy(__WEBPACK_IMPORTED_MODULE_3__matrix__["a" /* default */].rotate(angle, originPoint.x, originPoint.y));

        this._optionsChange();
        return this;
    };

    Transformation.prototype.multiply = function multiply (transformation) {
        var matrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__to_matrix__["a" /* default */])(transformation);

        this._matrix = this._matrix.multiplyCopy(matrix);

        this._optionsChange();
        return this;
    };

    Transformation.prototype.matrix = function matrix (value) {
        if (value) {
            this._matrix = value;
            this._optionsChange();
            return this;
        }

        return this._matrix;
    };

    Transformation.prototype._optionsChange = function _optionsChange () {
        this.optionsChange({
            field: "transform",
            value: this
        });
    };

    return Transformation;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

__WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__["a" /* default */].extend(Transformation.prototype);

/* harmony default export */ __webpack_exports__["a"] = (Transformation);

//# sourceMappingURL=transformation.js.map


/***/ }),
/* 432 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_options_accessors__ = __webpack_require__(656);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__core_options_store__ = __webpack_require__(219);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(5);






var GradientStop = (function (Class) {
    function GradientStop(offset, color, opacity) {
        Class.call(this);

        this.options = new __WEBPACK_IMPORTED_MODULE_1__core_options_store__["a" /* default */]({
            offset: offset,
            color: color,
            opacity: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["e" /* defined */])(opacity) ? opacity : 1
        });
        this.options.addObserver(this);
    }

    if ( Class ) GradientStop.__proto__ = Class;
    GradientStop.prototype = Object.create( Class && Class.prototype );
    GradientStop.prototype.constructor = GradientStop;

    GradientStop.create = function create (arg) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["e" /* defined */])(arg)) {
            var stop;
            if (arg instanceof GradientStop) {
                stop = arg;
            } else if (arg.length > 1) {
                stop = new GradientStop(arg[0], arg[1], arg[2]);
            } else {
                stop = new GradientStop(arg.offset, arg.color, arg.opacity);
            }

            return stop;
        }
    };

    return GradientStop;
}(__WEBPACK_IMPORTED_MODULE_3__common__["d" /* Class */]));

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_options_accessors__["a" /* default */])(GradientStop.prototype, [ "offset", "color", "opacity" ]);
__WEBPACK_IMPORTED_MODULE_2__mixins_observers_mixin__["a" /* default */].extend(GradientStop.prototype);

/* harmony default export */ __webpack_exports__["a"] = (GradientStop);

//# sourceMappingURL=gradient-stop.js.map


/***/ }),
/* 433 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return PDFDocument; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return defineFont; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return parseFontDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getFontURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return loadFonts; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return loadImages; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getPaperOptions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return clearImageCache; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TEXT_RENDERING_MODE; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(434);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ttf__ = __webpack_require__(702);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deflate__ = __webpack_require__(700);
/* unused harmony reexport BinaryStream */
/* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */
/* eslint-disable space-infix-ops, space-before-function-paren, array-bracket-spacing, object-curly-spacing */
/* eslint-disable no-nested-ternary, max-params, default-case, no-else-return, no-empty */
/* eslint-disable no-param-reassign, no-var, block-scoped-var */






var browser = __WEBPACK_IMPORTED_MODULE_1__common__["a" /* support */].browser;
// XXX: remove this junk (assume `true`) when we no longer have to support IE < 10
var HAS_TYPED_ARRAYS = typeof Uint8Array !== 'undefined';

var NL = "\n";

var RESOURCE_COUNTER = 0;

var PAPER_SIZE = {
    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.40  , 209.76  ],
    a9        : [ 104.88  , 147.40  ],
    a10       : [ 73.70   , 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.90  , 708.66  ],
    b6        : [ 354.33  , 498.90  ],
    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.00  ],
    folio     : [ 612.00  , 936.00  ],
    legal     : [ 612.00  , 1008.00 ],
    letter    : [ 612.00  , 792.00  ],
    tabloid   : [ 792.00  , 1224.00 ]
};

function makeOutput() {
    var indentLevel = 0, output = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
    function out() {
        var arguments$1 = arguments;

        for (var i = 0; i < arguments.length; ++i) {
            var x = arguments$1[i];
            if (x === undefined) {
                throw new Error("Cannot output undefined to PDF");
            }
            else if (x instanceof PDFValue) {
                x.beforeRender(out);
                x.render(out);
            }
            else if (isArray(x)) {
                renderArray(x, out);
            }
            else if (isDate(x)) {
                renderDate(x, out);
            }
            else if (typeof x == "number") {
                if (isNaN(x)) {
                    throw new Error("Cannot output NaN to PDF");
                }
                // make sure it doesn't end up in exponent notation
                var num = x.toFixed(7);
                if (num.indexOf(".") >= 0) {
                    num = num.replace(/\.?0+$/, "");
                }
                if (num == "-0") {
                    num = "0";
                }
                output.writeString(num);
            }
            else if (/string|boolean/.test(typeof x)) {
                output.writeString(String(x));
            }
            else if (typeof x.get == "function") {
                output.write(x.get());
            }
            else if (typeof x == "object") {
                if (!x) {
                    output.writeString("null");
                } else {
                    out(new PDFDictionary(x));
                }
            }
        }
    }
    out.writeData = function(data) {
        output.write(data);
    };
    out.withIndent = function(f) {
        ++indentLevel;
        f(out);
        --indentLevel;
    };
    out.indent = function() {
        out(NL, pad("", indentLevel * 2, "  "));
        out.apply(null, arguments);
    };
    out.offset = function() {
        return output.offset();
    };
    out.toString = function() {
        throw new Error("FIX CALLER");
    };
    out.get = function() {
        return output.get();
    };
    out.stream = function() {
        return output;
    };
    return out;
}

function wrapObject(value, id) {
    var beforeRender = value.beforeRender;
    var renderValue = value.render;

    value.beforeRender = function(){};

    value.render = function(out) {
        out(id, " 0 R");
    };

    value.renderFull = function(out) {
        value._offset = out.offset();
        out(id, " 0 obj ");
        beforeRender.call(value, out);
        renderValue.call(value, out);
        out(" endobj");
    };
}

function getPaperOptions(getOption) {
    if (typeof getOption != "function") {
        var options = getOption;
        getOption = function(key, def) {
            return key in options ? options[key] : def;
        };
    }
    var paperSize = getOption("paperSize", PAPER_SIZE.a4);
    if (!paperSize) {
        return {};
    }
    if (typeof paperSize == "string") {
        paperSize = PAPER_SIZE[paperSize.toLowerCase()];
        if (paperSize == null) {
            throw new Error("Unknown paper size");
        }
    }

    paperSize[0] = unitsToPoints(paperSize[0]);
    paperSize[1] = unitsToPoints(paperSize[1]);

    if (getOption("landscape", false)) {
        paperSize = [
            Math.max(paperSize[0], paperSize[1]),
            Math.min(paperSize[0], paperSize[1])
        ];
    }

    var margin = getOption("margin");
    if (margin) {
        if (typeof margin == "string" || typeof margin == "number") {
            margin = unitsToPoints(margin, 0);
            margin = { left: margin, top: margin, right: margin, bottom: margin };
        } else {
            margin = {
                left   : unitsToPoints(margin.left, 0),
                top    : unitsToPoints(margin.top, 0),
                right  : unitsToPoints(margin.right, 0),
                bottom : unitsToPoints(margin.bottom, 0)
            };
        }
        if (getOption("addMargin")) {
            paperSize[0] += margin.left + margin.right;
            paperSize[1] += margin.top + margin.bottom;
        }
    }
    return { paperSize: paperSize, margin: margin };
}

function PDFDocument(options) {
    var self = this;
    var out = makeOutput();
    var objcount = 0;
    var objects = [];

    function getOption(name, defval) {
        return (options && options[name] != null) ? options[name] : defval;
    }

    self.getOption = getOption;

    self.attach = function(value) {
        if (objects.indexOf(value) < 0) {
            wrapObject(value, ++objcount);
            objects.push(value);
        }
        return value;
    };

    self.pages = [];

    self.FONTS = {};
    self.IMAGES = {};
    self.GRAD_COL_FUNCTIONS = {}; // cache for color gradient functions
    self.GRAD_OPC_FUNCTIONS = {}; // cache for opacity gradient functions
    self.GRAD_COL = {};     // cache for whole color gradient objects
    self.GRAD_OPC = {};     // cache for whole opacity gradient objects

    var catalog = self.attach(new PDFCatalog());
    var pageTree = self.attach(new PDFPageTree());
    catalog.setPages(pageTree);

    var info = self.attach(new PDFDictionary({
        Producer     : new PDFString(getOption("producer", "Kendo UI PDF Generator")), // XXX: kendo.version?
        Title        : new PDFString(getOption("title", "")),
        Author       : new PDFString(getOption("author", "")),
        Subject      : new PDFString(getOption("subject", "")),
        Keywords     : new PDFString(getOption("keywords", "")),
        Creator      : new PDFString(getOption("creator", "Kendo UI PDF Generator")),
        CreationDate : getOption("date", new Date())
    }));

    self.addPage = function(options) {
        var paperOptions  = getPaperOptions(function(name, defval){
            return (options && options[name] != null) ? options[name] : defval;
        });
        var paperSize     = paperOptions.paperSize;
        var margin        = paperOptions.margin;
        var contentWidth  = paperSize[0];
        var contentHeight = paperSize[1];
        if (margin) {
            contentWidth -= margin.left + margin.right;
            contentHeight -= margin.top + margin.bottom;
        }
        var content = new PDFStream(makeOutput(), null, true);
        var props = {
            Contents : self.attach(content),
            Parent   : pageTree,
            MediaBox : [ 0, 0, paperSize[0], paperSize[1] ]
        };
        var page = new PDFPage(self, props);
        page._content = content;
        pageTree.addPage(self.attach(page));

        // canvas-like coord. system.  (0,0) is upper-left.
        // text must be vertically mirorred before drawing.
        page.transform(1, 0, 0, -1, 0, paperSize[1]);

        if (margin) {
            page.translate(margin.left, margin.top);
            // XXX: clip to right/bottom margin.  Make this optional?
            page.rect(0, 0, contentWidth, contentHeight);
            page.clip();
        }

        self.pages.push(page);
        return page;
    };

    self.render = function() {
        var i;
        /// file header
        out("%PDF-1.4", NL, "%\xc2\xc1\xda\xcf\xce", NL, NL);

        /// file body
        for (i = 0; i < objects.length; ++i) {
            objects[i].renderFull(out);
            out(NL, NL);
        }

        /// cross-reference table
        var xrefOffset = out.offset();
        out("xref", NL, 0, " ", objects.length + 1, NL);
        out("0000000000 65535 f ", NL);
        for (i = 0; i < objects.length; ++i) {
            out(zeropad(objects[i]._offset, 10), " 00000 n ", NL);
        }
        out(NL);

        /// trailer
        out("trailer", NL);
        out(new PDFDictionary({
            Size: objects.length + 1,
            Root: catalog,
            Info: info
        }), NL, NL);

        /// end
        out("startxref", NL, xrefOffset, NL);
        out("%%EOF", NL);

        return out.stream().offset(0);
    };
}

var FONT_CACHE = {
    "Times-Roman"           : true,
    "Times-Bold"            : true,
    "Times-Italic"          : true,
    "Times-BoldItalic"      : true,
    "Helvetica"             : true,
    "Helvetica-Bold"        : true,
    "Helvetica-Oblique"     : true,
    "Helvetica-BoldOblique" : true,
    "Courier"               : true,
    "Courier-Bold"          : true,
    "Courier-Oblique"       : true,
    "Courier-BoldOblique"   : true,
    "Symbol"                : true,
    "ZapfDingbats"          : true
};

function loadBinary(url, cont) {
    function error() {
        if (window.console) {
            if (window.console.error) {
                window.console.error("Cannot load URL: %s", url);
            } else {
                window.console.log("Cannot load URL: %s", url);
            }
        }
        cont(null);
    }
    var req = new XMLHttpRequest();
    req.open('GET', url, true);
    if (HAS_TYPED_ARRAYS) {
        req.responseType = "arraybuffer";
    }
    req.onload = function() {
        if (req.status == 200 || req.status == 304) {
            if (HAS_TYPED_ARRAYS) {
                cont(new Uint8Array(req.response));
            } else {
                cont(new window.VBArray(req.responseBody).toArray()); // IE9 only
            }
        } else {
            error();
        }
    };
    req.onerror = error;
    req.send(null);
}

function loadFont(url, cont) {
    var font = FONT_CACHE[url];
    if (font) {
        cont(font);
    } else {
        loadBinary(url, function(data){
            if (data == null) {
                throw new Error("Cannot load font from " + url);
            } else {
                var font = new __WEBPACK_IMPORTED_MODULE_2__ttf__["a" /* TTFFont */](data);
                FONT_CACHE[url] = font;
                cont(font);
            }
        });
    }
}

var IMAGE_CACHE = {};

function clearImageCache() {
    IMAGE_CACHE = {};
}

function loadImage(url, size, cont) {
    var img = IMAGE_CACHE[url], bloburl, blob;
    if (img) {
        cont(img);
    } else {
        img = new Image();
        if (!(/^data:/i.test(url))) {
            img.crossOrigin = "Anonymous";
        }
        if (HAS_TYPED_ARRAYS && !(/^data:/i.test(url))) {
            // IE10 fails to load images from another domain even when the server sends the
            // proper CORS headers.  a XHR, however, will be able to load the data.
            // http://stackoverflow.com/a/19734516/154985
            //
            // On the other hand, it's worth doing it this way for all browsers which support
            // responseType = "blob" (HAS_TYPED_ARRAYS will be true), because we can inspect the
            // mime type and if it's a JPEG (very common case) we can save a lot of time in
            // _load below.
            var xhr = new XMLHttpRequest();
            xhr.onload = function() {
                blob = xhr.response;
                bloburl = URL.createObjectURL(blob);
                _load(bloburl);
            };
            xhr.onerror = _onerror;
            xhr.open("GET", url, true);
            xhr.responseType = "blob";
            xhr.send();
        } else {
            _load(url);
        }
    }

    function _load(url) {
        img.src = url;
        if (img.complete && !browser.msie) {
            // IE, bless it's little heart, says img.complete == true even though the image is
            // not loaded (width=0), therefore we must go the onload route (ticket 929635).
            _onload();
        } else {
            img.onload = _onload;
            img.onerror = _onerror;
        }
    }

    function _onerror() {
        cont(IMAGE_CACHE[url] = "TAINTED");
    }

    function _onload() {
        if (size) {
            // but if requested size is bigger than the image, just use the original image.
            if (size.width >= img.width || size.height >= img.height) {
                size = null;
            }
        }
        if (!size && blob && /^image\/jpe?g$/i.test(blob.type)) {
            // If we know we got a JPEG, we can skip the process of rendering it to a
            // canvas, getting the pixel data, searching for transparency we know we won't
            // find, getting back a data URI and then decoding the BASE64 to finally get the
            // binary we already have.  Also, we avoid downgrading the image quality, with
            // the possible drawback of making a bigger PDF; still, seems legit.
            //
            // Besides saving a lot of work, this also reuses the buffer memory
            // (BinaryStream does not create a copy), potentially saving some GC cycles.
            var reader = new FileReader();
            reader.onload = function() {
                var img = new PDFJpegImage(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(new Uint8Array(this.result)));
                URL.revokeObjectURL(bloburl);
                cont(IMAGE_CACHE[url] = img);
            };
            reader.readAsArrayBuffer(blob);
            return;
        }

        if (!size) {
            size = { width: img.width, height: img.height };
        }

        var canvas = document.createElement("canvas");
        canvas.width = size.width;
        canvas.height = size.height;

        var ctx = canvas.getContext("2d");
        ctx.drawImage(img, 0, 0, size.width, size.height);

        var imgdata;
        try {
            imgdata = ctx.getImageData(0, 0, size.width, size.height);
        } catch (ex) {
            // it tainted the canvas -- can't draw it.
            _onerror();
            return;
        } finally {
            if (bloburl) {
                URL.revokeObjectURL(bloburl);
            }
        }

        // in case it contains transparency, we must separate rgb data from the alpha
        // channel and create a PDFRawImage image with opacity.  otherwise we can use a
        // PDFJpegImage.
        //
        // to do this in one step, we create the rgb and alpha streams anyway, even if
        // we might end up not using them if hasAlpha remains false.

        var hasAlpha = false, rgb = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(), alpha = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        var rawbytes = imgdata.data;
        var i = 0;
        while (i < rawbytes.length) {
            rgb.writeByte(rawbytes[i++]);
            rgb.writeByte(rawbytes[i++]);
            rgb.writeByte(rawbytes[i++]);
            var a = rawbytes[i++];
            if (a < 255) {
                hasAlpha = true;
            }
            alpha.writeByte(a);
        }

        if (hasAlpha) {
            img = new PDFRawImage(size.width, size.height, rgb, alpha);
        } else {
            // no transparency, encode as JPEG.
            var data = canvas.toDataURL("image/jpeg");
            data = data.substr(data.indexOf(";base64,") + 8);

            var stream = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
            stream.writeBase64(data);
            img = new PDFJpegImage(stream);
        }

        cont(IMAGE_CACHE[url] = img);
    }
}

function manyLoader(loadOne) {
    return function(urls, callback) {
        var n = urls.length, i = n;
        if (n === 0) {
            return callback();
        }
        function next() {
            if (--n === 0) {
                callback();
            }
        }
        while (i-- > 0) {
            loadOne(urls[i], next);
        }
    };
}

var loadFonts = manyLoader(loadFont);
var loadImages = function(images, callback) {
    var urls = Object.keys(images), n = urls.length;
    if (n === 0) {
        return callback();
    }
    function next() {
        if (--n === 0) {
            callback();
        }
    }
    urls.forEach(function(url){
        loadImage(url, images[url], next);
    });
};

PDFDocument.prototype = {
    loadFonts: loadFonts,
    loadImages: loadImages,

    getFont: function(url) {
        var font = this.FONTS[url];
        if (!font) {
            font = FONT_CACHE[url];
            if (!font) {
                throw new Error("Font " + url + " has not been loaded");
            }
            if (font === true) {
                font = this.attach(new PDFStandardFont(url));
            } else {
                font = this.attach(new PDFFont(this, font));
            }
            this.FONTS[url] = font;
        }
        return font;
    },

    getImage: function(url) {
        var img = this.IMAGES[url];
        if (!img) {
            img = IMAGE_CACHE[url];
            if (!img) {
                throw new Error("Image " + url + " has not been loaded");
            }
            if (img === "TAINTED") {
                return null;
            }
            img = this.IMAGES[url] = this.attach(img.asStream(this));
        }
        return img;
    },

    getOpacityGS: function(opacity, forStroke) {
        var id = parseFloat(opacity).toFixed(3);
        opacity = parseFloat(id);
        id += forStroke ? "S" : "F";
        var cache = this._opacityGSCache || (this._opacityGSCache = {});
        var gs = cache[id];
        if (!gs) {
            var props = {
                Type: _("ExtGState")
            };
            if (forStroke) {
                props.CA = opacity;
            } else {
                props.ca = opacity;
            }
            gs = this.attach(new PDFDictionary(props));
            gs._resourceName = _("GS" + (++RESOURCE_COUNTER));
            cache[id] = gs;
        }
        return gs;
    },

    dict: function(props) {
        return new PDFDictionary(props);
    },

    name: function(str) {
        return _(str);
    },

    stream: function(props, content) {
        return new PDFStream(content, props);
    }
};

/* -----[ utils ]----- */

function pad(str, len, ch) {
    while (str.length < len) {
        str = ch + str;
    }
    return str;
}

function zeropad(n, len) {
    return pad(String(n), len, "0");
}

function hasOwnProperty(obj, key) {
    return Object.prototype.hasOwnProperty.call(obj, key);
}

var isArray = Array.isArray || function(obj) {
    return obj instanceof Array;
};

function isDate(obj) {
    return obj instanceof Date;
}

function renderArray(a, out) {
    out("[");
    if (a.length > 0) {
        out.withIndent(function(){
            for (var i = 0; i < a.length; ++i) {
                if (i > 0 && i % 8 === 0) {
                    out.indent(a[i]);
                } else {
                    out(" ", a[i]);
                }
            }
        });
        //out.indent();
    }
    out(" ]");
}

function renderDate(date, out) {
    out("(D:",
        zeropad(date.getUTCFullYear(), 4),
        zeropad(date.getUTCMonth() + 1, 2),
        zeropad(date.getUTCDate(), 2),
        zeropad(date.getUTCHours(), 2),
        zeropad(date.getUTCMinutes(), 2),
        zeropad(date.getUTCSeconds(), 2),
        "Z)");
}

function mm2pt(mm) {
    return mm * (72/25.4);
}

function cm2pt(cm) {
    return mm2pt(cm * 10);
}

function in2pt(inch)  {
    return inch * 72;
}


function unitsToPoints(x, def) {
    if (typeof x == "number") {
        return x;
    }
    if (typeof x == "string") {
        var m;
        m = /^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(x);
        if (m) {
            var num = parseFloat(m[1]);
            if (!isNaN(num)) {
                if (m[2] == "pt") {
                    return num;
                }
                return {
                    "mm": mm2pt,
                    "cm": cm2pt,
                    "in": in2pt
                }[m[2]](num);
            }
        }
    }
    if (def != null) {
        return def;
    }
    throw new Error("Can't parse unit: " + x);
}

/* -----[ PDF basic objects ]----- */

function PDFValue(){}

PDFValue.prototype.beforeRender = function(){};

function defclass(Ctor, proto, Base) {
    if (!Base) {
        Base = PDFValue;
    }
    Ctor.prototype = new Base();
    for (var i in proto) {
        if (hasOwnProperty(proto, i)) {
            Ctor.prototype[i] = proto[i];
        }
    }
    return Ctor;
}

/// strings

var PDFString = defclass(function PDFString(value){
    this.value = value;
}, {
    render: function(out) {
        var txt = "", val = this.value;
        for (var i = 0; i < val.length; ++i) {
            txt += String.fromCharCode(val.charCodeAt(i) & 0xFF);
        }
        out("(", txt.replace(/([\(\)\\])/g, "\\$1"), ")");
    },
    toString: function() {
        return this.value;
    }
});

var PDFHexString = defclass(function PDFHexString(value){
    this.value = value;
}, {
    render: function(out) {
        var this$1 = this;

        out("<");
        for (var i = 0; i < this.value.length; ++i) {
            out(zeropad(this$1.value.charCodeAt(i).toString(16), 4));
        }
        out(">");
    }
}, PDFString);

/// names

var PDFName = defclass(function PDFName(name) {
    this.name = name;
}, {
    render: function(out) {
        out("/" + this.escape());
    },
    escape: function() {
        return this.name.replace(/[^\x21-\x7E]/g, function(c){
            return "#" + zeropad(c.charCodeAt(0).toString(16), 2);
        });
    },
    toString: function() {
        return this.name;
    }
});

var PDFName_cache = {};
PDFName.get = _;

function _(name) {
    if (hasOwnProperty(PDFName_cache, name)) {
        return PDFName_cache[name];
    }
    return (PDFName_cache[name] = new PDFName(name));
}

/// dictionary

var PDFDictionary = defclass(function PDFDictionary(props) {
    this.props = props;
}, {
    render: function(out) {
        var props = this.props, empty = true;
        out("<<");
        out.withIndent(function(){
            for (var i in props) {
                if (hasOwnProperty(props, i) && !/^_/.test(i)) {
                    empty = false;
                    out.indent(_(i), " ", props[i]);
                }
            }
        });
        if (!empty) {
            out.indent();
        }
        out(">>");
    }
});

/// streams

var PDFStream = defclass(function PDFStream(data, props, compress) {
    if (typeof data == "string") {
        var tmp = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        tmp.write(data);
        data = tmp;
    }
    this.data = data;
    this.props = props || {};
    this.compress = compress;
}, {
    render: function(out) {
        var data = this.data.get(), props = this.props;
        if (this.compress && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__deflate__["a" /* supportsDeflate */])()) {
            if (!props.Filter) {
                props.Filter = [];
            } else if (!(props.Filter instanceof Array)) {
                props.Filter = [ props.Filter ];
            }
            props.Filter.unshift(_("FlateDecode"));
            data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__deflate__["b" /* deflate */])(data);
        }
        props.Length = data.length;
        out(new PDFDictionary(props), " stream", NL);
        out.writeData(data);
        out(NL, "endstream");
    }
});

/// catalog

var PDFCatalog = defclass(function PDFCatalog(props){
    props = this.props = props || {};
    props.Type = _("Catalog");
}, {
    setPages: function(pagesObj) {
        this.props.Pages = pagesObj;
    }
}, PDFDictionary);

/// page tree

var PDFPageTree = defclass(function PDFPageTree(){
    this.props = {
        Type  : _("Pages"),
        Kids  : [],
        Count : 0
    };
}, {
    addPage: function(pageObj) {
        this.props.Kids.push(pageObj);
        this.props.Count++;
    }
}, PDFDictionary);

/// images

// JPEG

var SOF_CODES = [0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf];

function PDFJpegImage(data) {
    // we must determine the correct color space.  we'll parse a bit
    // of the JPEG stream for this, it's still better than going
    // through the canvas.
    // https://github.com/telerik/kendo-ui-core/issues/2845
    data.offset(0);
    var width, height, colorSpace, bitsPerComponent;
    var soi = data.readShort();
    if (soi != 0xFFD8) {
        // XXX: do we have some better options here?
        throw new Error("Invalid JPEG image");
    }
    while (!data.eof()) {
        var ff = data.readByte();
        if (ff != 0xFF) {
            throw new Error("Invalid JPEG image");
        }
        var marker = data.readByte();
        var length = data.readShort();
        if (SOF_CODES.indexOf(marker) >= 0) {
            // "start of frame" marker
            bitsPerComponent = data.readByte();
            height = data.readShort();
            width = data.readShort();
            colorSpace = data.readByte();
            break;
        }
        data.skip(length - 2);
    }

    if (colorSpace == null) {
        throw new Error("Invalid JPEG image");
    }

    var props = {
        Type             : _("XObject"),
        Subtype          : _("Image"),
        Width            : width,
        Height           : height,
        BitsPerComponent : bitsPerComponent,
        Filter           : _("DCTDecode")
    };

    switch (colorSpace) {
      case 1:
        props.ColorSpace = _("DeviceGray");
        break;
      case 3:
        props.ColorSpace = _("DeviceRGB");
        break;
      case 4:
        props.ColorSpace = _("DeviceCMYK");
        props.Decode = [ 1, 0, 1, 0, 1, 0, 1, 0 ]; // invert colors
        break;
    }

    this.asStream = function() {
        data.offset(0);
        var stream = new PDFStream(data, props);
        stream._resourceName = _("I" + (++RESOURCE_COUNTER));
        return stream;
    };
}

// PDFRawImage will be used for images with transparency (PNG)

function PDFRawImage(width, height, rgb, alpha) {
    this.asStream = function(pdf) {
        var mask = new PDFStream(alpha, {
            Type             : _("XObject"),
            Subtype          : _("Image"),
            Width            : width,
            Height           : height,
            BitsPerComponent : 8,
            ColorSpace       : _("DeviceGray")
        }, true);
        var stream = new PDFStream(rgb, {
            Type             : _("XObject"),
            Subtype          : _("Image"),
            Width            : width,
            Height           : height,
            BitsPerComponent : 8,
            ColorSpace       : _("DeviceRGB"),
            SMask            : pdf.attach(mask)
        }, true);
        stream._resourceName = _("I" + (++RESOURCE_COUNTER));
        return stream;
    };
}

/// standard fonts

var PDFStandardFont = defclass(function PDFStandardFont(name){
    this.props = {
        Type     : _("Font"),
        Subtype  : _("Type1"),
        BaseFont : _(name)
    };
    this._resourceName = _("F" + (++RESOURCE_COUNTER));
}, {
    encodeText: function(str) {
        return new PDFString(String(str));
    }
}, PDFDictionary);

/// TTF fonts

var PDFFont = defclass(function PDFFont(pdf, font, props){
    props = this.props = props || {};
    props.Type = _("Font");
    props.Subtype = _("Type0");
    props.Encoding = _("Identity-H");

    this._pdf = pdf;
    this._font = font;
    this._sub = font.makeSubset();
    this._resourceName = _("F" + (++RESOURCE_COUNTER));

    var head = font.head;

    this.name = font.psName;
    var scale = this.scale = font.scale;
    this.bbox = [
        head.xMin * scale,
        head.yMin * scale,
        head.xMax * scale,
        head.yMax * scale
    ];

    this.italicAngle = font.post.italicAngle;
    this.ascent = font.ascent * scale;
    this.descent = font.descent * scale;
    this.lineGap = font.lineGap * scale;
    this.capHeight = font.os2.capHeight || this.ascent;
    this.xHeight = font.os2.xHeight || 0;
    this.stemV = 0;

    this.familyClass = (font.os2.familyClass || 0) >> 8;
    this.isSerif = this.familyClass >= 1 && this.familyClass <= 7;
    this.isScript = this.familyClass == 10;

    this.flags = ((font.post.isFixedPitch ? 1 : 0) |
                  (this.isSerif ? 1 << 1 : 0) |
                  (this.isScript ? 1 << 3 : 0) |
                  (this.italicAngle !== 0 ? 1 << 6 : 0) |
                  (1 << 5));
}, {
    encodeText: function(text) {
        return new PDFHexString(this._sub.encodeText(String(text)));
    },
    getTextWidth: function(fontSize, text) {
        var this$1 = this;

        var width = 0, codeMap = this._font.cmap.codeMap;
        for (var i = 0; i < text.length; ++i) {
            var glyphId = codeMap[text.charCodeAt(i)];
            width += this$1._font.widthOfGlyph(glyphId || 0);
        }
        return width * fontSize / 1000;
    },
    beforeRender: function() {
        var self = this;
        var sub = self._sub;

        // write the TTF data
        var data = sub.render();
        var fontStream = new PDFStream(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(data), {
            Length1: data.length
        }, true);

        var descriptor = self._pdf.attach(new PDFDictionary({
            Type         : _("FontDescriptor"),
            FontName     : _(self._sub.psName),
            FontBBox     : self.bbox,
            Flags        : self.flags,
            StemV        : self.stemV,
            ItalicAngle  : self.italicAngle,
            Ascent       : self.ascent,
            Descent      : self.descent,
            CapHeight    : self.capHeight,
            XHeight      : self.xHeight,
            FontFile2    : self._pdf.attach(fontStream)
        }));

        var cmap = sub.ncid2ogid;
        var firstChar = sub.firstChar;
        var lastChar = sub.lastChar;
        var charWidths = [];
        (function loop(i, chunk){
            if (i <= lastChar) {
                var gid = cmap[i];
                if (gid == null) {
                    loop(i + 1);
                } else {
                    if (!chunk) {
                        charWidths.push(i, chunk = []);
                    }
                    chunk.push(self._font.widthOfGlyph(gid));
                    loop(i + 1, chunk);
                }
            }
        })(firstChar);

        // As if two dictionaries weren't enough, we need another
        // one, the "descendant font".  Only that one can be of
        // Subtype CIDFontType2.  PDF is the X11 of document
        // formats: portable but full of legacy that nobody cares
        // about anymore.

        var descendant = new PDFDictionary({
            Type: _("Font"),
            Subtype: _("CIDFontType2"),
            BaseFont: _(self._sub.psName),
            CIDSystemInfo: new PDFDictionary({
                Registry   : new PDFString("Adobe"),
                Ordering   : new PDFString("Identity"),
                Supplement : 0
            }),
            FontDescriptor: descriptor,
            FirstChar: firstChar,
            LastChar: lastChar,
            DW: Math.round(self._font.widthOfGlyph(0)),
            W: charWidths,
            CIDToGIDMap: self._pdf.attach(self._makeCidToGidMap())
        });

        var dict = self.props;
        dict.BaseFont = _(self._sub.psName);
        dict.DescendantFonts = [ self._pdf.attach(descendant) ];

        // Compute the ToUnicode map so that apps can extract
        // meaningful text from the PDF.
        var unimap = new PDFToUnicodeCmap(firstChar, lastChar, sub.subset);
        var unimapStream = new PDFStream(makeOutput(), null, true);
        unimapStream.data(unimap);
        dict.ToUnicode = self._pdf.attach(unimapStream);
    },
    _makeCidToGidMap: function() {
        return new PDFStream(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(this._sub.cidToGidMap()), null, true);
    }
}, PDFDictionary);

var PDFToUnicodeCmap = defclass(function PDFUnicodeCMap(firstChar, lastChar, map){
    this.firstChar = firstChar;
    this.lastChar = lastChar;
    this.map = map;
}, {
    render: function(out) {
        out.indent("/CIDInit /ProcSet findresource begin");
        out.indent("12 dict begin");
        out.indent("begincmap");
        out.indent("/CIDSystemInfo <<");
        out.indent("  /Registry (Adobe)");
        out.indent("  /Ordering (UCS)");
        out.indent("  /Supplement 0");
        out.indent(">> def");
        out.indent("/CMapName /Adobe-Identity-UCS def");
        out.indent("/CMapType 2 def");
        out.indent("1 begincodespacerange");
        out.indent("  <0000><ffff>");
        out.indent("endcodespacerange");

        var self = this;
        out.indent(self.lastChar - self.firstChar + 1, " beginbfchar");
        out.withIndent(function(){
            for (var code = self.firstChar; code <= self.lastChar; ++code) {
                var unicode = self.map[code];
                var str = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* ucs2encode */])([ unicode ]);
                out.indent("<", zeropad(code.toString(16), 4), ">", "<");
                for (var i = 0; i < str.length; ++i) {
                    out(zeropad(str.charCodeAt(i).toString(16), 4));
                }
                out(">");
            }
        });
        out.indent("endbfchar");

        out.indent("endcmap");
        out.indent("CMapName currentdict /CMap defineresource pop");
        out.indent("end");
        out.indent("end");
    }
});

/// gradients

function makeHash(a) {
    return a.map(function(x){
        return isArray(x) ? makeHash(x)
            : typeof x == "number" ? (Math.round(x * 1000) / 1000).toFixed(3)
            : x;
    }).join(" ");
}

function cacheColorGradientFunction(pdf, r1, g1, b1, r2, g2, b2) {
    var hash = makeHash([ r1, g1, b1, r2, g2, b2 ]);
    var func = pdf.GRAD_COL_FUNCTIONS[hash];
    if (!func) {
        func = pdf.GRAD_COL_FUNCTIONS[hash] = pdf.attach(new PDFDictionary({
            FunctionType: 2,
            Domain: [ 0, 1 ],
            Range: [ 0, 1, 0, 1, 0, 1 ],
            N: 1,
            C0: [ r1 , g1 , b1 ],
            C1: [ r2 , g2 , b2 ]
        }));
    }
    return func;
}

function cacheOpacityGradientFunction(pdf, a1, a2) {
    var hash = makeHash([ a1, a2 ]);
    var func = pdf.GRAD_OPC_FUNCTIONS[hash];
    if (!func) {
        func = pdf.GRAD_OPC_FUNCTIONS[hash] = pdf.attach(new PDFDictionary({
            FunctionType: 2,
            Domain: [ 0, 1 ],
            Range: [ 0, 1 ],
            N: 1,
            C0: [ a1 ],
            C1: [ a2 ]
        }));
    }
    return func;
}

function makeGradientFunctions(pdf, stops) {
    var hasAlpha = false;
    var opacities = [];
    var colors = [];
    var offsets = [];
    var encode = [];
    var i, prev, cur, prevColor, curColor;
    for (i = 1; i < stops.length; ++i) {
        prev = stops[i - 1];
        cur = stops[i];
        prevColor = prev.color;
        curColor = cur.color;
        colors.push(cacheColorGradientFunction(
            pdf,
            prevColor.r, prevColor.g, prevColor.b,
            curColor.r,  curColor.g,  curColor.b
        ));
        if (prevColor.a < 1 || curColor.a < 1) {
            hasAlpha = true;
        }
        offsets.push(cur.offset);
        encode.push(0, 1);
    }
    if (hasAlpha) {
        for (i = 1; i < stops.length; ++i) {
            prev = stops[i - 1];
            cur = stops[i];
            prevColor = prev.color;
            curColor = cur.color;
            opacities.push(cacheOpacityGradientFunction(
                pdf, prevColor.a, curColor.a
            ));
        }
    }
    offsets.pop();
    return {
        hasAlpha  : hasAlpha,
        colors    : assemble(colors),
        opacities : hasAlpha ? assemble(opacities) : null
    };
    function assemble(funcs) {
        if (funcs.length == 1) {
            return funcs[0];
        }
        return {
            FunctionType: 3,
            Functions: funcs,
            Domain: [ 0, 1 ],
            Bounds: offsets,
            Encode: encode
        };
    }
}

function cacheColorGradient(pdf, isRadial, stops, coords, funcs, box) {
    var shading, hash;
    // if box is given then we have user-space coordinates, which
    // means the gradient is designed for a certain position/size
    // on page.  caching won't do any good.
    if (!box) {
        var a = [ isRadial ].concat(coords);
        stops.forEach(function(x){
            a.push(x.offset, x.color.r, x.color.g, x.color.b);
        });
        hash = makeHash(a);
        shading = pdf.GRAD_COL[hash];
    }
    if (!shading) {
        shading = new PDFDictionary({
            Type: _("Shading"),
            ShadingType: isRadial ? 3 : 2,
            ColorSpace: _("DeviceRGB"),
            Coords: coords,
            Domain: [ 0, 1 ],
            Function: funcs,
            Extend: [ true, true ]
        });
        pdf.attach(shading);
        shading._resourceName = "S" + (++RESOURCE_COUNTER);
        if (hash) {
            pdf.GRAD_COL[hash] = shading;
        }
    }
    return shading;
}

function cacheOpacityGradient(pdf, isRadial, stops, coords, funcs, box) {
    var opacity, hash;
    // if box is given then we have user-space coordinates, which
    // means the gradient is designed for a certain position/size
    // on page.  caching won't do any good.
    if (!box) {
        var a = [ isRadial ].concat(coords);
        stops.forEach(function(x){
            a.push(x.offset, x.color.a);
        });
        hash = makeHash(a);
        opacity = pdf.GRAD_OPC[hash];
    }
    if (!opacity) {
        opacity = new PDFDictionary({
            Type: _("ExtGState"),
            AIS: false,
            CA: 1,
            ca: 1,
            SMask: {
                Type: _("Mask"),
                S: _("Luminosity"),
                G: pdf.attach(new PDFStream("/a0 gs /s0 sh", {
                    Type: _("XObject"),
                    Subtype: _("Form"),
                    FormType: 1,
                    BBox: (box ? [
                        box.left, box.top + box.height, box.left + box.width, box.top
                    ] : [ 0, 1, 1, 0 ]),
                    Group: {
                        Type: _("Group"),
                        S: _("Transparency"),
                        CS: _("DeviceGray"),
                        I: true
                    },
                    Resources: {
                        ExtGState: {
                            a0: { CA: 1, ca: 1 }
                        },
                        Shading: {
                            s0: {
                                ColorSpace: _("DeviceGray"),
                                Coords: coords,
                                Domain: [ 0, 1 ],
                                ShadingType: isRadial ? 3 : 2,
                                Function: funcs,
                                Extend: [ true, true ]
                            }
                        }
                    }
                }))
            }
        });
        pdf.attach(opacity);
        opacity._resourceName = "O" + (++RESOURCE_COUNTER);
        if (hash) {
            pdf.GRAD_OPC[hash] = opacity;
        }
    }
    return opacity;
}

function cacheGradient(pdf, gradient, box) {
    var isRadial = gradient.type == "radial";
    var funcs = makeGradientFunctions(pdf, gradient.stops);
    var coords = isRadial ? [
        gradient.start.x , gradient.start.y , gradient.start.r,
        gradient.end.x   , gradient.end.y   , gradient.end.r
    ] : [
        gradient.start.x , gradient.start.y,
        gradient.end.x   , gradient.end.y
    ];
    var shading = cacheColorGradient(
        pdf, isRadial, gradient.stops, coords, funcs.colors, gradient.userSpace && box
    );
    var opacity = funcs.hasAlpha ? cacheOpacityGradient(
        pdf, isRadial, gradient.stops, coords, funcs.opacities, gradient.userSpace && box
    ) : null;
    return {
        hasAlpha: funcs.hasAlpha,
        shading: shading,
        opacity: opacity
    };
}

/// page object

var PDFPage = defclass(function PDFPage(pdf, props){
    this._pdf = pdf;
    this._rcount = 0;
    this._textMode = false;
    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 = [];

    props = this.props = props || {};
    props.Type = _("Page");
    props.ProcSet = [
        _("PDF"),
        _("Text"),
        _("ImageB"),
        _("ImageC"),
        _("ImageI")
    ];
    props.Resources = new PDFDictionary({
        Font      : new PDFDictionary(this._fontResources),
        ExtGState : new PDFDictionary(this._gsResources),
        XObject   : new PDFDictionary(this._xResources),
        Pattern   : new PDFDictionary(this._patResources),
        Shading   : new PDFDictionary(this._shResources)
    });
    props.Annots = this._annotations;
}, {
    _out: function() {
        this._content.data.apply(null, arguments);
    },
    transform: function(a, b, c, d, e, f) {
        if (!isIdentityMatrix(arguments)) {
            this._matrix = mmul(arguments, this._matrix);
            this._out(a, " ", b, " ", c, " ", d, " ", e, " ", f, " cm");
            // XXX: debug
            // this._out(" % current matrix: ", this._matrix);
            this._out(NL);
        }
    },
    translate: function(dx, dy) {
        this.transform(1, 0, 0, 1, dx, dy);
    },
    scale: function(sx, sy) {
        this.transform(sx, 0, 0, sy, 0, 0);
    },
    rotate: function(angle) {
        var cos = Math.cos(angle), sin = Math.sin(angle);
        this.transform(cos, sin, -sin, cos, 0, 0);
    },
    beginText: function() {
        this._textMode = true;
        this._out("BT", NL);
    },
    endText: function() {
        this._textMode = false;
        this._out("ET", NL);
    },
    _requireTextMode: function() {
        if (!this._textMode) {
            throw new Error("Text mode required; call page.beginText() first");
        }
    },
    _requireFont: function() {
        if (!this._font) {
            throw new Error("No font selected; call page.setFont() first");
        }
    },
    setFont: function(font, size) {
        this._requireTextMode();
        if (font == null) {
            font = this._font;
        } else if (!(font instanceof PDFFont)) {
            font = this._pdf.getFont(font);
        }
        if (size == null) {
            size = this._fontSize;
        }
        this._fontResources[font._resourceName] = font;
        this._font = font;
        this._fontSize = size;
        this._out(font._resourceName, " ", size, " Tf", NL);
    },
    setTextLeading: function(size) {
        this._requireTextMode();
        this._out(size, " TL", NL);
    },
    setTextRenderingMode: function(mode) {
        this._requireTextMode();
        this._out(mode, " Tr", NL);
    },
    showText: function(text, requestedWidth) {
        this._requireFont();
        if (text.length > 1 && requestedWidth && this._font instanceof PDFFont) {
            var outputWidth = this._font.getTextWidth(this._fontSize, text);
            var scale = requestedWidth / outputWidth * 100;
            this._out(scale, " Tz ");
        }
        this._out(this._font.encodeText(text), " Tj", NL);
    },
    showTextNL: function(text) {
        this._requireFont();
        this._out(this._font.encodeText(text), " '", NL);
    },
    addLink: function(uri, box) {
        var ll = this._toPage({ x: box.left, y: box.bottom });
        var ur = this._toPage({ x: box.right, y: box.top });
        this._annotations.push(new PDFDictionary({
            Type    : _("Annot"),
            Subtype : _("Link"),
            Rect    : [ ll.x, ll.y, ur.x, ur.y ],
            Border  : [ 0, 0, 0 ],
            A       : new PDFDictionary({
                Type : _("Action"),
                S    : _("URI"),
                URI  : new PDFString(uri)
            })
        }));
    },
    setStrokeColor: function(r, g, b) {
        this._out(r, " ", g, " ", b, " RG", NL);
    },
    setOpacity: function(opacity) {
        this.setFillOpacity(opacity);
        this.setStrokeOpacity(opacity);
        this._opacity *= opacity;
    },
    setStrokeOpacity: function(opacity) {
        if (opacity < 1) {
            var gs = this._pdf.getOpacityGS(this._opacity * opacity, true);
            this._gsResources[gs._resourceName] = gs;
            this._out(gs._resourceName, " gs", NL);
        }
    },
    setFillColor: function(r, g, b) {
        this._out(r, " ", g, " ", b, " rg", NL);
    },
    setFillOpacity: function(opacity) {
        if (opacity < 1) {
            var gs = this._pdf.getOpacityGS(this._opacity * opacity, false);
            this._gsResources[gs._resourceName] = gs;
            this._out(gs._resourceName, " gs", NL);
        }
    },
    gradient: function(gradient, box) {
        this.save();
        this.rect(box.left, box.top, box.width, box.height);
        this.clip();
        if (!gradient.userSpace) {
            this.transform(box.width, 0, 0, box.height, box.left, box.top);
        }
        var g = cacheGradient(this._pdf, gradient, box);
        var sname = g.shading._resourceName, oname;
        this._shResources[sname] = g.shading;
        if (g.hasAlpha) {
            oname = g.opacity._resourceName;
            this._gsResources[oname] = g.opacity;
            this._out("/" + oname + " gs ");
        }
        this._out("/" + sname + " sh", NL);
        this.restore();
    },
    setDashPattern: function(dashArray, dashPhase) {
        this._out(dashArray, " ", dashPhase, " d", NL);
    },
    setLineWidth: function(width) {
        this._out(width, " w", NL);
    },
    setLineCap: function(lineCap) {
        this._out(lineCap, " J", NL);
    },
    setLineJoin: function(lineJoin) {
        this._out(lineJoin, " j", NL);
    },
    setMitterLimit: function(mitterLimit) {
        this._out(mitterLimit, " M", NL);
    },
    save: function() {
        this._contextStack.push(this._context());
        this._out("q", NL);
    },
    restore: function() {
        this._out("Q", NL);
        this._context(this._contextStack.pop());
    },

    // paths
    moveTo: function(x, y) {
        this._out(x, " ", y, " m", NL);
    },
    lineTo: function(x, y) {
        this._out(x, " ", y, " l", NL);
    },
    bezier: function(x1, y1, x2, y2, x3, y3) {
        this._out(x1, " ", y1, " ", x2, " ", y2, " ", x3, " ", y3, " c", NL);
    },
    bezier1: function(x1, y1, x3, y3) {
        this._out(x1, " ", y1, " ", x3, " ", y3, " y", NL);
    },
    bezier2: function(x2, y2, x3, y3) {
        this._out(x2, " ", y2, " ", x3, " ", y3, " v", NL);
    },
    close: function() {
        this._out("h", NL);
    },
    rect: function(x, y, w, h) {
        this._out(x, " ", y, " ", w, " ", h, " re", NL);
    },
    ellipse: function(x, y, rx, ry) {
        function _X(v) { return x + v; }
        function _Y(v) { return y + v; }

        // how to get to the "magic number" is explained here:
        // http://www.whizkidtech.redprince.net/bezier/circle/kappa/
        var k = 0.5522847498307936;

        this.moveTo(_X(0), _Y(ry));
        this.bezier(
            _X(rx * k) , _Y(ry),
            _X(rx)     , _Y(ry * k),
            _X(rx)     , _Y(0)
        );
        this.bezier(
            _X(rx)     , _Y(-ry * k),
            _X(rx * k) , _Y(-ry),
            _X(0)      , _Y(-ry)
        );
        this.bezier(
            _X(-rx * k) , _Y(-ry),
            _X(-rx)     , _Y(-ry * k),
            _X(-rx)     , _Y(0)
        );
        this.bezier(
            _X(-rx)     , _Y(ry * k),
            _X(-rx * k) , _Y(ry),
            _X(0)       , _Y(ry)
        );
    },
    circle: function(x, y, r) {
        this.ellipse(x, y, r, r);
    },
    stroke: function() {
        this._out("S", NL);
    },
    nop: function() {
        this._out("n", NL);
    },
    clip: function() {
        this._out("W n", NL);
    },
    clipStroke: function() {
        this._out("W S", NL);
    },
    closeStroke: function() {
        this._out("s", NL);
    },
    fill: function() {
        this._out("f", NL);
    },
    fillStroke: function() {
        this._out("B", NL);
    },
    drawImage: function(url) {
        var img = this._pdf.getImage(url);
        if (img) { // the result can be null for a cross-domain image
            this._xResources[img._resourceName] = img;
            this._out(img._resourceName, " Do", NL);
        }
    },
    comment: function(txt) {
        var self = this;
        txt.split(/\r?\n/g).forEach(function(line){
            self._out("% ", line, NL);
        });
    },

    // internal
    _context: function(val) {
        if (val != null) {
            this._opacity = val.opacity;
            this._matrix = val.matrix;
        } else {
            return {
                opacity: this._opacity,
                matrix: this._matrix
            };
        }
    },

    _toPage: function(p) {
        var m = this._matrix;
        var a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5];
        return {
            x: a*p.x + c*p.y + e,
            y: b*p.x + d*p.y + f
        };
    }
}, PDFDictionary);

function unquote(str) {
    return str.replace(/^\s*(['"])(.*)\1\s*$/, "$2");
}

function parseFontDef(fontdef) {
    // XXX: this is very crude for now and buggy.  Proper parsing is quite involved.
    var rx = /^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i;
    var m = rx.exec(fontdef);
    if (!m) {
        return { fontSize: 12, fontFamily: "sans-serif" };
    }
    var fontSize = m[8] ? parseInt(m[8], 10) : 12;
    return {
        italic     : m[2] && m[2].toLowerCase() == "italic",
        variant    : m[4],
        bold       : m[6] && /bold|700/i.test(m[6]),
        fontSize   : fontSize,
        lineHeight : m[12] ? m[12] == "normal" ? fontSize : parseInt(m[12], 10) : null,
        fontFamily : m[14].split(/\s*,\s*/g).map(unquote)
    };
}

function getFontURL(style) {
    function mkFamily(name) {
        if (style.bold) {
            name += "|bold";
        }
        if (style.italic) {
            name += "|italic";
        }
        return name.toLowerCase();
    }
    var fontFamily = style.fontFamily;
    var name, url;
    if (fontFamily instanceof Array) {
        for (var i = 0; i < fontFamily.length; ++i) {
            name = mkFamily(fontFamily[i]);
            url = FONT_MAPPINGS[name];
            if (url) {
                break;
            }
        }
    } else {
        url = FONT_MAPPINGS[fontFamily.toLowerCase()];
    }
    while (typeof url == "function") {
        url = url();
    }
    if (!url) {
        url = "Times-Roman";
    }
    return url;
}

var FONT_MAPPINGS = {
    "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"
};

function fontAlias(alias, name) {
    alias = alias.toLowerCase();
    FONT_MAPPINGS[alias] = function() {
        return FONT_MAPPINGS[name];
    };
    FONT_MAPPINGS[alias + "|bold"] = function() {
        return FONT_MAPPINGS[name + "|bold"];
    };
    FONT_MAPPINGS[alias + "|italic"] = function() {
        return FONT_MAPPINGS[name + "|italic"];
    };
    FONT_MAPPINGS[alias + "|bold|italic"] = function() {
        return FONT_MAPPINGS[name + "|bold|italic"];
    };
}

// Let's define some common names to an appropriate replacement.
// These are overridable via pdf.defineFont, should the user want to
// include the proper versions.

fontAlias("Times New Roman" , "serif");
fontAlias("Courier New"     , "monospace");
fontAlias("Arial"           , "sans-serif");
fontAlias("Helvetica"       , "sans-serif");
fontAlias("Verdana"         , "sans-serif");
fontAlias("Tahoma"          , "sans-serif");
fontAlias("Georgia"         , "sans-serif");
fontAlias("Monaco"          , "monospace");
fontAlias("Andale Mono"     , "monospace");

function defineFont(name, url) {
    if (arguments.length == 1) {
        for (var i in name) {
            if (hasOwnProperty(name, i)) {
                defineFont(i, name[i]);
            }
        }
    } else {
        name = name.toLowerCase();
        FONT_MAPPINGS[name] = url;

        // special handling for DejaVu fonts: if they get defined,
        // let them also replace the default families, for good
        // Unicode support out of the box.
        switch (name) {
          case "dejavu sans"               : FONT_MAPPINGS["sans-serif"]              = url; break;
          case "dejavu sans|bold"          : FONT_MAPPINGS["sans-serif|bold"]         = url; break;
          case "dejavu sans|italic"        : FONT_MAPPINGS["sans-serif|italic"]       = url; break;
          case "dejavu sans|bold|italic"   : FONT_MAPPINGS["sans-serif|bold|italic"]  = url; break;
          case "dejavu serif"              : FONT_MAPPINGS["serif"]                   = url; break;
          case "dejavu serif|bold"         : FONT_MAPPINGS["serif|bold"]              = url; break;
          case "dejavu serif|italic"       : FONT_MAPPINGS["serif|italic"]            = url; break;
          case "dejavu serif|bold|italic"  : FONT_MAPPINGS["serif|bold|italic"]       = url; break;
          case "dejavu mono"               : FONT_MAPPINGS["monospace"]               = url; break;
          case "dejavu mono|bold"          : FONT_MAPPINGS["monospace|bold"]          = url; break;
          case "dejavu mono|italic"        : FONT_MAPPINGS["monospace|italic"]        = url; break;
          case "dejavu mono|bold|italic"   : FONT_MAPPINGS["monospace|bold|italic"]   = url; break;
        }
    }
}

function mmul(a, b) {
    var a1 = a[0], b1 = a[1], c1 = a[2], d1 = a[3], e1 = a[4], f1 = a[5];
    var a2 = b[0], b2 = b[1], c2 = b[2], d2 = b[3], e2 = b[4], f2 = b[5];
    return [
        a1*a2 + b1*c2,          a1*b2 + b1*d2,
        c1*a2 + d1*c2,          c1*b2 + d1*d2,
        e1*a2 + f1*c2 + e2,     e1*b2 + f1*d2 + f2
    ];
}

function isIdentityMatrix(m) {
    return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1 && m[4] === 0 && m[5] === 0;
}

var TEXT_RENDERING_MODE = {
    fill           : 0,
    stroke         : 1,
    fillAndStroke  : 2,
    invisible      : 3,
    fillAndClip    : 4,
    strokeAndClip  : 5,
    fillStrokeClip : 6,
    clip           : 7
};



//# sourceMappingURL=core.js.map


/***/ }),
/* 434 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export BASE64 */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BinaryStream; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ucs2decode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ucs2encode; });
/* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */
/* eslint-disable space-infix-ops, space-before-function-paren, array-bracket-spacing, object-curly-spacing */
/* eslint-disable no-nested-ternary, max-params, default-case, no-else-return, no-empty */
/* eslint-disable no-param-reassign, no-var, block-scoped-var */

// XXX: remove this junk (assume `true`) when we no longer have to support IE < 10
var HAS_TYPED_ARRAYS = typeof Uint8Array !== 'undefined';

var BASE64 = (function(){
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    return {
        decode: function(str) {
            var input = str.replace(/[^A-Za-z0-9\+\/\=]/g, ""), i = 0, n = input.length, output = [];

            while (i < n) {
                var enc1 = keyStr.indexOf(input.charAt(i++));
                var enc2 = keyStr.indexOf(input.charAt(i++));
                var enc3 = keyStr.indexOf(input.charAt(i++));
                var enc4 = keyStr.indexOf(input.charAt(i++));

                var chr1 = (enc1 << 2) | (enc2 >>> 4);
                var chr2 = ((enc2 & 15) << 4) | (enc3 >>> 2);
                var chr3 = ((enc3 & 3) << 6) | enc4;

                output.push(chr1);
                if (enc3 != 64) {
                    output.push(chr2);
                }
                if (enc4 != 64) {
                    output.push(chr3);
                }
            }

            return output;
        },
        encode: function(bytes) {
            var i = 0, n = bytes.length;
            var output = "";

            while (i < n) {
                var chr1 = bytes[i++];
                var chr2 = bytes[i++];
                var chr3 = bytes[i++];

                var enc1 = chr1 >>> 2;
                var enc2 = ((chr1 & 3) << 4) | (chr2 >>> 4);
                var enc3 = ((chr2 & 15) << 2) | (chr3 >>> 6);
                var enc4 = chr3 & 63;

                if (i - n == 2) {
                    enc3 = enc4 = 64;
                } else if (i - n == 1) {
                    enc4 = 64;
                }

                output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
            }
            return output;
        }
    };
}());

function BinaryStream(data) {
    var offset = 0, length = 0;
    if (data == null) {
        data = HAS_TYPED_ARRAYS ? new Uint8Array(256) : [];
    } else {
        length = data.length;
    }

    var ensure = HAS_TYPED_ARRAYS ? function(len) {
        if (len >= data.length) {
            var tmp = new Uint8Array(Math.max(len + 256, data.length * 2));
            tmp.set(data, 0);
            data = tmp;
        }
    } : function() {};

    var get = HAS_TYPED_ARRAYS ? function() {
        return new Uint8Array(data.buffer, 0, length);
    } : function() {
        return data;
    };

    var write = HAS_TYPED_ARRAYS ? function(bytes) {
        if (typeof bytes == "string") {
            return writeString(bytes);
        }
        var len = bytes.length;
        ensure(offset + len);
        data.set(bytes, offset);
        offset += len;
        if (offset > length) {
            length = offset;
        }
    } : function(bytes) {
        if (typeof bytes == "string") {
            return writeString(bytes);
        }
        for (var i = 0; i < bytes.length; ++i) {
            writeByte(bytes[i]);
        }
    };

    var slice = HAS_TYPED_ARRAYS ? function(start, length) {
        if (data.buffer.slice) {
            return new Uint8Array(data.buffer.slice(start, start + length));
        } else {
            // IE10
            var x = new Uint8Array(length);
            x.set(new Uint8Array(data.buffer, start, length));
            return x;
        }
    } : function(start, length) {
        return data.slice(start, start + length);
    };

    function eof() {
        return offset >= length;
    }
    function readByte() {
        return offset < length ? data[offset++] : 0;
    }
    function writeByte(b) {
        ensure(offset);
        data[offset++] = b & 0xFF;
        if (offset > length) {
            length = offset;
        }
    }
    function readShort() {
        return (readByte() << 8) | readByte();
    }
    function writeShort(w) {
        writeByte(w >> 8);
        writeByte(w);
    }
    function readShort_() {
        var w = readShort();
        return w >= 0x8000 ? w - 0x10000 : w;
    }
    function writeShort_(w) {
        writeShort(w < 0 ? w + 0x10000 : w);
    }
    function readLong() {
        return (readShort() * 0x10000) + readShort();
    }
    function writeLong(w) {
        writeShort((w >>> 16) & 0xFFFF);
        writeShort(w & 0xFFFF);
    }
    function readLong_() {
        var w = readLong();
        return w >= 0x80000000 ? w - 0x100000000 : w;
    }
    function writeLong_(w) {
        writeLong(w < 0 ? w + 0x100000000 : w);
    }
    function readFixed() {
        return readLong() / 0x10000;
    }
    function writeFixed(f) {
        writeLong(Math.round(f * 0x10000));
    }
    function readFixed_() {
        return readLong_() / 0x10000;
    }
    function writeFixed_(f) {
        writeLong_(Math.round(f * 0x10000));
    }
    function read(len) {
        return times(len, readByte);
    }
    function readString(len) {
        return String.fromCharCode.apply(String, read(len));
    }
    function writeString(str) {
        for (var i = 0; i < str.length; ++i) {
            writeByte(str.charCodeAt(i));
        }
    }
    function times(n, reader) {
        for (var ret = new Array(n), i = 0; i < n; ++i) {
            ret[i] = reader();
        }
        return ret;
    }

    var stream = {
        eof         : eof,
        readByte    : readByte,
        writeByte   : writeByte,
        readShort   : readShort,
        writeShort  : writeShort,
        readLong    : readLong,
        writeLong   : writeLong,
        readFixed   : readFixed,
        writeFixed  : writeFixed,

        // signed numbers.
        readShort_  : readShort_,
        writeShort_ : writeShort_,
        readLong_   : readLong_,
        writeLong_  : writeLong_,
        readFixed_  : readFixed_,
        writeFixed_ : writeFixed_,

        read        : read,
        write       : write,
        readString  : readString,
        writeString : writeString,

        times       : times,
        get         : get,
        slice       : slice,

        offset: function(pos) {
            if (pos != null) {
                offset = pos;
                return stream;
            }
            return offset;
        },

        skip: function(nbytes) {
            offset += nbytes;
        },

        toString: function() {
            throw new Error("FIX CALLER.  BinaryStream is no longer convertible to string!");
        },

        length: function() { return length; },

        saveExcursion: function(f) {
            var pos = offset;
            try {
                return f();
            } finally {
                offset = pos;
            }
        },

        writeBase64: function(base64) {
            if (window.atob) {
                writeString(window.atob(base64));
            } else {
                write(BASE64.decode(base64));
            }
        },
        base64: function() {
            return BASE64.encode(get());
        }
    };

    return stream;
}

function ucs2decode(string) {
    var output = [],
        counter = 0,
        length = string.length,
        value,
        extra;
    while (counter < length) {
        value = string.charCodeAt(counter++);
        if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
            // high surrogate, and there is a next character
            extra = string.charCodeAt(counter++);
            if ((extra & 0xFC00) == 0xDC00) { // low surrogate
                output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
            } else {
                // unmatched surrogate; only append this code unit, in case the next
                // code unit is the high surrogate of a surrogate pair
                output.push(value);
                counter--;
            }
        } else {
            output.push(value);
        }
    }
    return output;
}

function ucs2encode(array) {
    return array.map(function(value){
        var output = "";
        if (value > 0xFFFF) {
            value -= 0x10000;
            output += String.fromCharCode(value >>> 10 & 0x3FF | 0xD800);
            value = 0xDC00 | value & 0x3FF;
        }
        output += String.fromCharCode(value);
        return output;
    }).join("");
}



//# sourceMappingURL=utils.js.map


/***/ }),
/* 435 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__quad_root__ = __webpack_require__(436);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);




var QuadNode = (function (QuadRoot) {
    function QuadNode(rect) {
        QuadRoot.call(this);
        this.children = [];
        this.rect = rect;
    }

    if ( QuadRoot ) QuadNode.__proto__ = QuadRoot;
    QuadNode.prototype = Object.create( QuadRoot && QuadRoot.prototype );
    QuadNode.prototype.constructor = QuadNode;

    QuadNode.prototype.inBounds = function inBounds (rect) {
        var nodeRect = this.rect;
        var nodeBottomRight = nodeRect.bottomRight();
        var bottomRight = rect.bottomRight();
        var inBounds = nodeRect.origin.x <= rect.origin.x && nodeRect.origin.y <= rect.origin.y && bottomRight.x <= nodeBottomRight.x &&
            bottomRight.y <= nodeBottomRight.y;
        return inBounds;
    };

    QuadNode.prototype.pointShapes = function pointShapes (point) {
        var children = this.children;
        var length = children.length;
        var result = QuadRoot.prototype.pointShapes.call(this, point);
        for (var idx = 0; idx < length; idx++) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["b" /* append */])(result, children[idx].pointShapes(point));
        }
        return result;
    };

    QuadNode.prototype.insert = function insert (shape, bbox) {
        var children = this.children;
        var inserted = false;

        if (this.inBounds(bbox)) {
            if (this.shapes.length < 4) {
                this._add(shape, bbox);
            } else {
                if (!children.length) {
                    this._initChildren();
                }

                for (var idx = 0; idx < children.length; idx++) {
                    if (children[idx].insert(shape, bbox)) {
                        inserted = true;
                        break;
                    }
                }

                if (!inserted) {
                    this._add(shape, bbox);
                }
            }
            inserted = true;
        }

        return inserted;
    };

    QuadNode.prototype._initChildren = function _initChildren () {
        var ref = this;
        var rect = ref.rect;
        var children = ref.children;
        var center = rect.center();
        var halfWidth = rect.width() / 2;
        var halfHeight = rect.height() / 2;

        children.push(
            new QuadNode(new __WEBPACK_IMPORTED_MODULE_1__geometry__["b" /* Rect */]([ rect.origin.x, rect.origin.y ], [ halfWidth, halfHeight ])),
            new QuadNode(new __WEBPACK_IMPORTED_MODULE_1__geometry__["b" /* Rect */]([ center.x, rect.origin.y ], [ halfWidth, halfHeight ])),
            new QuadNode(new __WEBPACK_IMPORTED_MODULE_1__geometry__["b" /* Rect */]([ rect.origin.x, center.y ], [ halfWidth, halfHeight ])),
            new QuadNode(new __WEBPACK_IMPORTED_MODULE_1__geometry__["b" /* Rect */]([ center.x, center.y ], [ halfWidth, halfHeight ]))
        );
    };

    return QuadNode;
}(__WEBPACK_IMPORTED_MODULE_0__quad_root__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (QuadNode);
//# sourceMappingURL=quad-node.js.map


/***/ }),
/* 436 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common__ = __webpack_require__(8);


var QuadRoot = (function (Class) {
    function QuadRoot() {
        Class.call(this);

        this.shapes = [];
    }

    if ( Class ) QuadRoot.__proto__ = Class;
    QuadRoot.prototype = Object.create( Class && Class.prototype );
    QuadRoot.prototype.constructor = QuadRoot;

    QuadRoot.prototype._add = function _add (shape, bbox) {
        this.shapes.push({
            bbox: bbox,
            shape: shape
        });
        shape._quadNode = this;
    };

    QuadRoot.prototype.pointShapes = function pointShapes (point) {
        var shapes = this.shapes;
        var length = shapes.length;
        var result = [];
        for (var idx = 0; idx < length; idx++) {
            if (shapes[idx].bbox.containsPoint(point)) {
                result.push(shapes[idx].shape);
            }
        }
        return result;
    };

    QuadRoot.prototype.insert = function insert (shape, bbox) {
        this._add(shape, bbox);
    };

    QuadRoot.prototype.remove = function remove (shape) {
        var shapes = this.shapes;
        var length = shapes.length;

        for (var idx = 0; idx < length; idx++) {
            if (shapes[idx].shape === shape) {
                shapes.splice(idx, 1);
                break;
            }
        }
    };

    return QuadRoot;
}(__WEBPACK_IMPORTED_MODULE_0__common__["d" /* Class */]));

/* harmony default export */ __webpack_exports__["a"] = (QuadRoot);
//# sourceMappingURL=quad-root.js.map


/***/ }),
/* 437 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__quad_root__ = __webpack_require__(436);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__quad_node__ = __webpack_require__(435);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(5);






var ROOT_SIZE = 3000;
var LEVEL_STEP = 10000;
var MAX_LEVEL = 75;

var ShapesQuadTree = (function (Class) {
    function ShapesQuadTree() {
        Class.call(this);

        this.initRoots();
    }

    if ( Class ) ShapesQuadTree.__proto__ = Class;
    ShapesQuadTree.prototype = Object.create( Class && Class.prototype );
    ShapesQuadTree.prototype.constructor = ShapesQuadTree;

    ShapesQuadTree.prototype.initRoots = function initRoots () {
        this.rootMap = {};
        this.root = new __WEBPACK_IMPORTED_MODULE_0__quad_root__["a" /* default */]();
        this.rootElements = [];
    };

    ShapesQuadTree.prototype.clear = function clear () {
        var this$1 = this;

        var rootElements = this.rootElements;
        for (var idx = 0; idx < rootElements.length; idx++) {
            this$1.remove(rootElements[idx]);
        }
        this.initRoots();
    };

    ShapesQuadTree.prototype.pointShape = function pointShape (point) {
        var sectorRoot = ( this.rootMap[ Math.floor( point.x / ROOT_SIZE ) ] || {} )[ Math.floor( point.y / ROOT_SIZE ) ];
        var result = this.root.pointShapes(point);

        if (sectorRoot) {
            result = result.concat(sectorRoot.pointShapes(point));
        }

        this.assignZindex(result);

        result.sort(zIndexComparer);
        for (var idx = 0; idx < result.length; idx++) {
            if (result[idx].containsPoint(point)) {
                return result[idx];
            }
        }
    };

    ShapesQuadTree.prototype.assignZindex = function assignZindex (elements) {
        var this$1 = this;

        for (var idx = 0; idx < elements.length; idx++) {
            var element = elements[idx];
            var zIndex = 0;
            var levelWeight = Math.pow(LEVEL_STEP, MAX_LEVEL);
            var parents = [];

            while (element) {
                parents.push(element);
                element = element.parent;
            }

            while (parents.length) {
                element = parents.pop();
                zIndex += ((element.parent ? element.parent.children : this$1.rootElements).indexOf(element) + 1) * levelWeight;
                levelWeight /= LEVEL_STEP;
            }

            elements[idx]._zIndex = zIndex;
        }
    };

    ShapesQuadTree.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "transform" || e.field === "stroke.width") {
            this.bboxChange(e.element);
        }
    };

    ShapesQuadTree.prototype.geometryChange = function geometryChange (e) {
        this.bboxChange(e.element);
    };

    ShapesQuadTree.prototype.bboxChange = function bboxChange (element) {
        var this$1 = this;

        if (element.nodeType === "Group") {
            for (var idx = 0; idx < element.children.length; idx++) {
                this$1.bboxChange(element.children[idx]);
            }
        } else {
            if (element._quadNode) {
                element._quadNode.remove(element);
            }
            this._insertShape(element);
        }
    };

    ShapesQuadTree.prototype.add = function add (elements) {
        var elementsArray = Array.isArray(elements) ? elements.slice(0) : [ elements ];

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* append */])(this.rootElements, elementsArray);
        this._insert(elementsArray);
    };

    ShapesQuadTree.prototype.childrenChange = function childrenChange (e) {
        var this$1 = this;

        if (e.action === "remove") {
            for (var idx = 0; idx < e.items.length; idx++) {
                this$1.remove(e.items[idx]);
            }
        } else {
            this._insert(Array.prototype.slice.call(e.items, 0));
        }
    };

    ShapesQuadTree.prototype._insert = function _insert (elements) {
        var this$1 = this;

        var element;

        while (elements.length > 0) {
            element = elements.pop();
            element.addObserver(this$1);
            if (element.nodeType === "Group") {
                __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* append */])(elements, element.children);
            } else {
                this$1._insertShape(element);
            }
        }
    };

    ShapesQuadTree.prototype._insertShape = function _insertShape (shape) {
        var bbox = shape.bbox();
        if (bbox) {
            var sectors = this.getSectors(bbox);
            var x = sectors[0][0];
            var y = sectors[1][0];

            if (this.inRoot(sectors)) {
                this.root.insert(shape, bbox);
            } else {
                var rootMap = this.rootMap;
                if (!rootMap[x]) {
                    rootMap[x] = {};
                }

                if (!rootMap[x][y]) {
                    rootMap[x][y] = new __WEBPACK_IMPORTED_MODULE_1__quad_node__["a" /* default */](
                        new __WEBPACK_IMPORTED_MODULE_2__geometry__["b" /* Rect */]([ x * ROOT_SIZE, y * ROOT_SIZE ], [ ROOT_SIZE, ROOT_SIZE ])
                    );
                }

                rootMap[x][y].insert(shape, bbox);
            }
        }
    };

    ShapesQuadTree.prototype.remove = function remove (element) {
        var this$1 = this;

        element.removeObserver(this);

        if (element.nodeType === "Group") {
            var children = element.children;
            for (var idx = 0; idx < children.length; idx++) {
                this$1.remove(children[idx]);
            }
        } else if (element._quadNode) {
            element._quadNode.remove(element);
            delete element._quadNode;
        }
    };

    ShapesQuadTree.prototype.inRoot = function inRoot (sectors) {
        return sectors[0].length > 1 || sectors[1].length > 1;
    };

    ShapesQuadTree.prototype.getSectors = function getSectors (rect) {
        var bottomRight = rect.bottomRight();
        var bottomX = Math.floor(bottomRight.x / ROOT_SIZE);
        var bottomY = Math.floor(bottomRight.y / ROOT_SIZE);
        var sectors = [ [], [] ];
        for (var x = Math.floor(rect.origin.x / ROOT_SIZE); x <= bottomX; x++) {
            sectors[0].push(x);
        }
        for (var y = Math.floor(rect.origin.y / ROOT_SIZE); y <= bottomY; y++) {
            sectors[1].push(y);
        }
        return sectors;
    };

    return ShapesQuadTree;
}(__WEBPACK_IMPORTED_MODULE_3__common__["d" /* Class */]));

function zIndexComparer(x1, x2) {
    if (x1._zIndex < x2._zIndex) {
        return 1;
    }
    if (x1._zIndex > x2._zIndex) {
        return -1;
    }

    return 0;
}

/* harmony default export */ __webpack_exports__["a"] = (ShapesQuadTree);
//# sourceMappingURL=shapes-quad-tree.js.map


/***/ }),
/* 438 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shapes_element__ = __webpack_require__(40);
/* unused harmony reexport Element */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shapes_circle__ = __webpack_require__(704);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__shapes_circle__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shapes_arc__ = __webpack_require__(703);
/* unused harmony reexport Arc */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__shapes_path__ = __webpack_require__(141);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_3__shapes_path__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shapes_multi_path__ = __webpack_require__(441);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_4__shapes_multi_path__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__shapes_text__ = __webpack_require__(708);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_5__shapes_text__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__shapes_image__ = __webpack_require__(705);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_6__shapes_image__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__shapes_group__ = __webpack_require__(98);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_7__shapes_group__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__shapes_layout__ = __webpack_require__(706);
/* unused harmony reexport Layout */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__shapes_rect__ = __webpack_require__(707);
/* unused harmony reexport Rect */










//# sourceMappingURL=shapes.js.map


/***/ }),
/* 439 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__ = __webpack_require__(25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);



var push = [].push;
var pop = [].pop;
var splice = [].splice;
var shift = [].shift;
var slice = [].slice;
var unshift = [].unshift;

var ElementsArray = (function (Class) {
    function ElementsArray(array) {
        if ( array === void 0 ) array = [];

        Class.call(this);

        this.length = 0;
        this._splice(0, array.length, array);
    }

    if ( Class ) ElementsArray.__proto__ = Class;
    ElementsArray.prototype = Object.create( Class && Class.prototype );
    ElementsArray.prototype.constructor = ElementsArray;

    ElementsArray.prototype.elements = function elements (value) {
        if (value) {
            this._splice(0, this.length, value);

            this._change();
            return this;
        }

        return this.slice(0);
    };

    ElementsArray.prototype.push = function push$1 () {
        var elements = arguments;
        var result = push.apply(this, elements);

        this._add(elements);

        return result;
    };

    ElementsArray.prototype.slice = function slice$1 () {
        return slice.call(this);
    };

    ElementsArray.prototype.pop = function pop$1 () {
        var length = this.length;
        var result = pop.apply(this);

        if (length) {
            this._remove([ result ]);
        }

        return result;
    };

    ElementsArray.prototype.splice = function splice$1 (index, howMany) {
        var elements = slice.call(arguments, 2);
        var result = this._splice(index, howMany, elements);

        this._change();

        return result;
    };

    ElementsArray.prototype.shift = function shift$1 () {
        var length = this.length;
        var result = shift.apply(this);

        if (length) {
            this._remove([ result ]);
        }

        return result;
    };

    ElementsArray.prototype.unshift = function unshift$1 () {
        var elements = arguments;
        var result = unshift.apply(this, elements);

        this._add(elements);

        return result;
    };

    ElementsArray.prototype.indexOf = function indexOf (element) {
        var this$1 = this;

        var length = this.length;

        for (var idx = 0; idx < length; idx++) {
            if (this$1[idx] === element) {
                return idx;
            }
        }
        return -1;
    };

    ElementsArray.prototype._splice = function _splice (index, howMany, elements) {
        var result = splice.apply(this, [ index, howMany ].concat(elements));

        this._clearObserver(result);
        this._setObserver(elements);

        return result;
    };

    ElementsArray.prototype._add = function _add (elements) {
        this._setObserver(elements);
        this._change();
    };

    ElementsArray.prototype._remove = function _remove (elements) {
        this._clearObserver(elements);
        this._change();
    };

    ElementsArray.prototype._setObserver = function _setObserver (elements) {
        var this$1 = this;

        for (var idx = 0; idx < elements.length; idx++) {
            elements[idx].addObserver(this$1);
        }
    };

    ElementsArray.prototype._clearObserver = function _clearObserver (elements) {
        var this$1 = this;

        for (var idx = 0; idx < elements.length; idx++) {
            elements[idx].removeObserver(this$1);
        }
    };

    ElementsArray.prototype._change = function _change () {};

    return ElementsArray;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

__WEBPACK_IMPORTED_MODULE_0__mixins_observers_mixin__["a" /* default */].extend(ElementsArray.prototype);

/* harmony default export */ __webpack_exports__["a"] = (ElementsArray);

//# sourceMappingURL=elements-array.js.map


/***/ }),
/* 440 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__elements_array__ = __webpack_require__(439);


var GeometryElementsArray = (function (ElementsArray) {
    function GeometryElementsArray () {
        ElementsArray.apply(this, arguments);
    }

    if ( ElementsArray ) GeometryElementsArray.__proto__ = ElementsArray;
    GeometryElementsArray.prototype = Object.create( ElementsArray && ElementsArray.prototype );
    GeometryElementsArray.prototype.constructor = GeometryElementsArray;

    GeometryElementsArray.prototype._change = function _change () {
        this.geometryChange();
    };

    return GeometryElementsArray;
}(__WEBPACK_IMPORTED_MODULE_0__elements_array__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (GeometryElementsArray);
//# sourceMappingURL=geometry-elements-array.js.map


/***/ }),
/* 441 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_elements_array__ = __webpack_require__(440);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__path__ = __webpack_require__(141);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_paintable__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_measurable__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_elements_bounding_box__ = __webpack_require__(442);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_elements_clippend_bounding_box__ = __webpack_require__(443);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(5);









var MultiPath = (function (Element) {
    function MultiPath(options) {
        Element.call(this, options);
        this.paths = new __WEBPACK_IMPORTED_MODULE_0__geometry_elements_array__["a" /* default */]();
        this.paths.addObserver(this);

        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["e" /* defined */])(this.options.stroke)) {
            this.stroke("#000");
        }
    }

    if ( Element ) MultiPath.__proto__ = Element;
    MultiPath.prototype = Object.create( Element && Element.prototype );
    MultiPath.prototype.constructor = MultiPath;

    MultiPath.prototype.moveTo = function moveTo (x, y) {
        var path = new __WEBPACK_IMPORTED_MODULE_2__path__["a" /* default */]();
        path.moveTo(x, y);

        this.paths.push(path);

        return this;
    };

    MultiPath.prototype.lineTo = function lineTo (x, y) {
        if (this.paths.length > 0) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["u" /* last */])(this.paths).lineTo(x, y);
        }

        return this;
    };

    MultiPath.prototype.curveTo = function curveTo (controlOut, controlIn, point) {
        if (this.paths.length > 0) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["u" /* last */])(this.paths).curveTo(controlOut, controlIn, point);
        }

        return this;
    };

    MultiPath.prototype.arc = function arc (startAngle, endAngle, radiusX, radiusY, anticlockwise) {
        if (this.paths.length > 0) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["u" /* last */])(this.paths).arc(startAngle, endAngle, radiusX, radiusY, anticlockwise);
        }

        return this;
    };

    MultiPath.prototype.arcTo = function arcTo (end, rx, ry, largeArc, swipe, rotation) {
        if (this.paths.length > 0) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["u" /* last */])(this.paths).arcTo(end, rx, ry, largeArc, swipe, rotation);
        }

        return this;
    };

    MultiPath.prototype.close = function close () {
        if (this.paths.length > 0) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["u" /* last */])(this.paths).close();
        }

        return this;
    };

    MultiPath.prototype._bbox = function _bbox (matrix) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_elements_bounding_box__["a" /* default */])(this.paths, true, matrix);
    };

    MultiPath.prototype.rawBBox = function rawBBox () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_elements_bounding_box__["a" /* default */])(this.paths, false);
    };

    MultiPath.prototype._containsPoint = function _containsPoint (point) {
        var paths = this.paths;

        for (var idx = 0; idx < paths.length; idx++) {
            if (paths[idx]._containsPoint(point)) {
                return true;
            }
        }
        return false;
    };

    MultiPath.prototype._isOnPath = function _isOnPath (point) {
        var paths = this.paths;
        var width = this.options.stroke.width;

        for (var idx = 0; idx < paths.length; idx++) {
            if (paths[idx]._isOnPath(point, width)) {
                return true;
            }
        }
        return false;
    };

    MultiPath.prototype._clippedBBox = function _clippedBBox (transformation) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__utils_elements_clippend_bounding_box__["a" /* default */])(this.paths, this.currentTransform(transformation));
    };

    return MultiPath;
}(__WEBPACK_IMPORTED_MODULE_1__element__["a" /* default */]));

MultiPath.prototype.nodeType = "MultiPath";

__WEBPACK_IMPORTED_MODULE_3__mixins_paintable__["a" /* default */].extend(MultiPath.prototype);
__WEBPACK_IMPORTED_MODULE_4__mixins_measurable__["a" /* default */].extend(MultiPath.prototype);

/* harmony default export */ __webpack_exports__["a"] = (MultiPath);
//# sourceMappingURL=multi-path.js.map


/***/ }),
/* 442 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = elementsBoundingBox;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_rect__ = __webpack_require__(29);


function elementsBoundingBox(elements, applyTransform, transformation) {
    var boundingBox;

    for (var i = 0; i < elements.length; i++) {
        var element = elements[i];
        if (element.visible()) {
            var elementBoundingBox = applyTransform ? element.bbox(transformation) : element.rawBBox();
            if (elementBoundingBox) {
                if (boundingBox) {
                    boundingBox = __WEBPACK_IMPORTED_MODULE_0__geometry_rect__["a" /* default */].union(boundingBox, elementBoundingBox);
                } else {
                    boundingBox = elementBoundingBox;
                }
            }
        }
    }

    return boundingBox;
}


//# sourceMappingURL=elements-bounding-box.js.map


/***/ }),
/* 443 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = elementsClippedBoundingBox;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_rect__ = __webpack_require__(29);


function elementsClippedBoundingBox(elements, transformation) {
    var boundingBox;

    for (var i = 0; i < elements.length; i++) {
        var element = elements[i];
        if (element.visible()) {
            var elementBoundingBox = element.clippedBBox(transformation);
            if (elementBoundingBox) {
                if (boundingBox) {
                    boundingBox = __WEBPACK_IMPORTED_MODULE_0__geometry_rect__["a" /* default */].union(boundingBox, elementBoundingBox);
                } else {
                    boundingBox = elementBoundingBox;
                }
            }
        }
    }

    return boundingBox;
}
//# sourceMappingURL=elements-clippend-bounding-box.js.map


/***/ }),
/* 444 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node__ = __webpack_require__(45);


var ClipNode = (function (Node) {
    function ClipNode(srcElement) {
        Node.call(this);

        this.srcElement = srcElement;
        this.id = srcElement.id;

        this.load([ srcElement ]);
    }

    if ( Node ) ClipNode.__proto__ = Node;
    ClipNode.prototype = Object.create( Node && Node.prototype );
    ClipNode.prototype.constructor = ClipNode;

    ClipNode.prototype.template = function template () {
        return ("<clipPath id='" + (this.id) + "'>" + (this.renderChildren()) + "</clipPath>");
    };

    return ClipNode;
}(__WEBPACK_IMPORTED_MODULE_0__node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (ClipNode);
//# sourceMappingURL=clip-node.js.map


/***/ }),
/* 445 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gradients_linear_gradient__ = __webpack_require__(224);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gradients_radial_gradient__ = __webpack_require__(225);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__linear_gradient_node__ = __webpack_require__(449);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__radial_gradient_node__ = __webpack_require__(450);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__node__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__clip_node__ = __webpack_require__(444);







var DefinitionNode = (function (Node) {
    function DefinitionNode() {
        Node.call(this);
        this.definitionMap = {};
    }

    if ( Node ) DefinitionNode.__proto__ = Node;
    DefinitionNode.prototype = Object.create( Node && Node.prototype );
    DefinitionNode.prototype.constructor = DefinitionNode;

    DefinitionNode.prototype.attachTo = function attachTo (domElement) {
        this.element = domElement;
    };

    DefinitionNode.prototype.template = function template () {
        return ("<defs>" + (this.renderChildren()) + "</defs>");
    };

    DefinitionNode.prototype.definitionChange = function definitionChange (e) {
        var definitions = e.definitions;
        var action = e.action;

        if (action === "add") {
            this.addDefinitions(definitions);
        } else if (action === "remove") {
            this.removeDefinitions(definitions);
        }
    };

    DefinitionNode.prototype.createDefinition = function createDefinition (type, item) {
        var nodeType;
        if (type === "clip") {
            nodeType = __WEBPACK_IMPORTED_MODULE_5__clip_node__["a" /* default */];
        } else if (type === "fill") {
            if (item instanceof __WEBPACK_IMPORTED_MODULE_0__gradients_linear_gradient__["a" /* default */]) {
                nodeType = __WEBPACK_IMPORTED_MODULE_2__linear_gradient_node__["a" /* default */];
            } else if (item instanceof __WEBPACK_IMPORTED_MODULE_1__gradients_radial_gradient__["a" /* default */]) {
                nodeType = __WEBPACK_IMPORTED_MODULE_3__radial_gradient_node__["a" /* default */];
            }
        }
        return new nodeType(item);
    };

    DefinitionNode.prototype.addDefinitions = function addDefinitions (definitions) {
        var this$1 = this;

        for (var field in definitions) {
            this$1.addDefinition(field, definitions[field]);
        }
    };

    DefinitionNode.prototype.addDefinition = function addDefinition (type, srcElement) {
        var ref = this;
        var element = ref.element;
        var definitionMap = ref.definitionMap;
        var id = srcElement.id;
        var mapItem = definitionMap[id];
        if (!mapItem) {
            var node = this.createDefinition(type, srcElement);
            definitionMap[id] = {
                element: node,
                count: 1
            };
            this.append(node);
            if (element) {
                node.attachTo(this.element);
            }
        } else {
            mapItem.count++;
        }
    };

    DefinitionNode.prototype.removeDefinitions = function removeDefinitions (definitions) {
        var this$1 = this;

        for (var field in definitions) {
            this$1.removeDefinition(definitions[field]);
        }
    };

    DefinitionNode.prototype.removeDefinition = function removeDefinition (srcElement) {
        var definitionMap = this.definitionMap;
        var id = srcElement.id;
        var mapItem = definitionMap[id];

        if (mapItem) {
            mapItem.count--;
            if (mapItem.count === 0) {
                this.remove(this.childNodes.indexOf(mapItem.element), 1);
                delete definitionMap[id];
            }
        }
    };

    return DefinitionNode;
}(__WEBPACK_IMPORTED_MODULE_4__node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (DefinitionNode);
//# sourceMappingURL=definition-node.js.map


/***/ }),
/* 446 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = exportGroup;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_node__ = __webpack_require__(228);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shapes__ = __webpack_require__(438);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(99);





function exportGroup(group) {
    var root = new __WEBPACK_IMPORTED_MODULE_0__root_node__["a" /* default */]({
        skipBaseHref: true
    });
    var bbox = group.clippedBBox();
    var rootGroup = group;

    if (bbox) {
        var origin = bbox.getOrigin();
        var exportRoot = new __WEBPACK_IMPORTED_MODULE_1__shapes__["a" /* Group */]();
        exportRoot.transform(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__geometry__["c" /* transform */])().translate(-origin.x, -origin.y));
        exportRoot.children.push(group);
        rootGroup = exportRoot;
    }

    root.load([ rootGroup ]);

    var svg = "<?xml version='1.0' ?><svg xmlns='" + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* SVG_NS */] + "' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>" + (root.render()) + "</svg>";

    root.destroy();

    return svg;
}
//# sourceMappingURL=export-group.js.map


/***/ }),
/* 447 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gradient_stop_node__ = __webpack_require__(448);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__core_base_node__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_render_all_attributes__ = __webpack_require__(142);





var GradientNode = (function (Node) {
    function GradientNode(srcElement) {
        Node.call(this, srcElement);

        this.id = srcElement.id;

        this.loadStops();
    }

    if ( Node ) GradientNode.__proto__ = Node;
    GradientNode.prototype = Object.create( Node && Node.prototype );
    GradientNode.prototype.constructor = GradientNode;

    GradientNode.prototype.loadStops = function loadStops () {
        var this$1 = this;

        var stops = this.srcElement.stops;
        var element = this.element;

        for (var idx = 0; idx < stops.length; idx++) {
            var stopNode = new __WEBPACK_IMPORTED_MODULE_0__gradient_stop_node__["a" /* default */](stops[idx]);
            this$1.append(stopNode);
            if (element) {
                stopNode.attachTo(element);
            }
        }
    };

    GradientNode.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "gradient.stops") {
            __WEBPACK_IMPORTED_MODULE_1__core_base_node__["a" /* default */].prototype.clear.call(this);
            this.loadStops();
        } else if (e.field === "gradient") {
            this.allAttr(this.mapCoordinates());
        }
    };

    GradientNode.prototype.renderCoordinates = function renderCoordinates () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_render_all_attributes__["a" /* default */])(this.mapCoordinates());
    };

    GradientNode.prototype.mapSpace = function mapSpace () {
        return [ "gradientUnits", this.srcElement.userSpace() ? "userSpaceOnUse" : "objectBoundingBox" ];
    };

    return GradientNode;
}(__WEBPACK_IMPORTED_MODULE_2__node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (GradientNode);
//# sourceMappingURL=gradient-node.js.map


/***/ }),
/* 448 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_render_attribute__ = __webpack_require__(100);



var GradientStopNode = (function (Node) {
    function GradientStopNode () {
        Node.apply(this, arguments);
    }

    if ( Node ) GradientStopNode.__proto__ = Node;
    GradientStopNode.prototype = Object.create( Node && Node.prototype );
    GradientStopNode.prototype.constructor = GradientStopNode;

    GradientStopNode.prototype.template = function template () {
        return ("<stop " + (this.renderOffset()) + " " + (this.renderStyle()) + " />");
    };

    GradientStopNode.prototype.renderOffset = function renderOffset () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_render_attribute__["a" /* default */])("offset", this.srcElement.offset());
    };

    GradientStopNode.prototype.mapStyle = function mapStyle () {
        var srcElement = this.srcElement;
        return [
            [ "stop-color", srcElement.color() ],
            [ "stop-opacity", srcElement.opacity() ]
        ];
    };

    GradientStopNode.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "offset") {
            this.attr(e.field, e.value);
        } else if (e.field === "color" || e.field === "opacity") {
            this.css("stop-" + e.field, e.value);
        }
    };

    return GradientStopNode;
}(__WEBPACK_IMPORTED_MODULE_0__node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (GradientStopNode);
//# sourceMappingURL=gradient-stop-node.js.map


/***/ }),
/* 449 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gradient_node__ = __webpack_require__(447);


var LinearGradientNode = (function (GradientNode) {
    function LinearGradientNode () {
        GradientNode.apply(this, arguments);
    }

    if ( GradientNode ) LinearGradientNode.__proto__ = GradientNode;
    LinearGradientNode.prototype = Object.create( GradientNode && GradientNode.prototype );
    LinearGradientNode.prototype.constructor = LinearGradientNode;

    LinearGradientNode.prototype.template = function template () {
        return ("<linearGradient id='" + (this.id) + "' " + (this.renderCoordinates()) + ">" + (this.renderChildren()) + "</linearGradient>");
    };

    LinearGradientNode.prototype.mapCoordinates = function mapCoordinates () {
        var srcElement = this.srcElement;
        var start = srcElement.start();
        var end = srcElement.end();
        var attrs = [
            [ "x1", start.x ],
            [ "y1", start.y ],
            [ "x2", end.x ],
            [ "y2", end.y ],
            this.mapSpace()
        ];

        return attrs;
    };

    return LinearGradientNode;
}(__WEBPACK_IMPORTED_MODULE_0__gradient_node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (LinearGradientNode);
//# sourceMappingURL=linear-gradient-node.js.map


/***/ }),
/* 450 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gradient_node__ = __webpack_require__(447);


var RadialGradientNode = (function (GradientNode) {
    function RadialGradientNode () {
        GradientNode.apply(this, arguments);
    }

    if ( GradientNode ) RadialGradientNode.__proto__ = GradientNode;
    RadialGradientNode.prototype = Object.create( GradientNode && GradientNode.prototype );
    RadialGradientNode.prototype.constructor = RadialGradientNode;

    RadialGradientNode.prototype.template = function template () {
        return ("<radialGradient id='" + (this.id) + "' " + (this.renderCoordinates()) + ">" + (this.renderChildren()) + "</radialGradient>");
    };

    RadialGradientNode.prototype.mapCoordinates = function mapCoordinates () {
        var srcElement = this.srcElement;
        var center = srcElement.center();
        var radius = srcElement.radius();
        var attrs = [
            [ "cx", center.x ],
            [ "cy", center.y ],
            [ "r", radius ],
            this.mapSpace()
        ];
        return attrs;
    };

    return RadialGradientNode;
}(__WEBPACK_IMPORTED_MODULE_0__gradient_node__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (RadialGradientNode);
//# sourceMappingURL=radial-gradient-node.js.map


/***/ }),
/* 451 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = renderStyle;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);


function renderStyle(attrs) {
    var output = "";
    for (var i = 0; i < attrs.length; i++) {
        var value = attrs[i][1];
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(value)) {
            output += attrs[i][0] + ":" + value + ";";
        }
    }

    if (output !== "") {
        return output;
    }
}
//# sourceMappingURL=render-style.js.map


/***/ }),
/* 452 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(99);


var renderSVG = function(container, svg) {
    container.innerHTML = svg;
};

if (typeof document !== "undefined") {
    var testFragment = "<svg xmlns='" + __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* SVG_NS */] + "'></svg>";
    var testContainer = document.createElement("div");
    var hasParser = typeof DOMParser !== "undefined";

    testContainer.innerHTML = testFragment;

    if (hasParser && testContainer.firstChild.namespaceURI !== __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* SVG_NS */]) {
        renderSVG = function(container, svg) {
            var parser = new DOMParser();
            var chartDoc = parser.parseFromString(svg, "text/xml");
            var importedDoc = document.adoptNode(chartDoc.documentElement);

            container.innerHTML = "";
            container.appendChild(importedDoc);
        };
    }
}

/* harmony default export */ __webpack_exports__["a"] = (renderSVG);
//# sourceMappingURL=render-svg.js.map


/***/ }),
/* 453 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__text_metrics_lru_cache__ = __webpack_require__(454);
/* unused harmony reexport LRUCache */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__text_metrics_text_metrics__ = __webpack_require__(455);
/* unused harmony reexport TextMetrics */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__text_metrics_measure_text__ = __webpack_require__(719);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__text_metrics_measure_text__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__text_metrics_util__ = __webpack_require__(456);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__text_metrics_util__["c"]; });





//# sourceMappingURL=text-metrics.js.map


/***/ }),
/* 454 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common__ = __webpack_require__(8);


var LRUCache = (function (Class) {
    function LRUCache(size) {
        Class.call(this);

        this._size = size;
        this._length = 0;
        this._map = {};
    }

    if ( Class ) LRUCache.__proto__ = Class;
    LRUCache.prototype = Object.create( Class && Class.prototype );
    LRUCache.prototype.constructor = LRUCache;

    LRUCache.prototype.put = function put (key, value) {
        var map = this._map;
        var entry = { key: key, value: value };

        map[key] = entry;

        if (!this._head) {
            this._head = this._tail = entry;
        } else {
            this._tail.newer = entry;
            entry.older = this._tail;
            this._tail = entry;
        }

        if (this._length >= this._size) {
            map[this._head.key] = null;
            this._head = this._head.newer;
            this._head.older = null;
        } else {
            this._length++;
        }
    };

    LRUCache.prototype.get = function get (key) {
        var entry = this._map[key];

        if (entry) {
            if (entry === this._head && entry !== this._tail) {
                this._head = entry.newer;
                this._head.older = null;
            }

            if (entry !== this._tail) {
                if (entry.older) {
                    entry.older.newer = entry.newer;
                    entry.newer.older = entry.older;
                }

                entry.older = this._tail;
                entry.newer = null;

                this._tail.newer = entry;
                this._tail = entry;
            }

            return entry.value;
        }
    };

    return LRUCache;
}(__WEBPACK_IMPORTED_MODULE_0__common__["d" /* Class */]));

/* harmony default export */ __webpack_exports__["a"] = (LRUCache);
//# sourceMappingURL=lru-cache.js.map


/***/ }),
/* 455 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lru_cache__ = __webpack_require__(454);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(456);




function zeroSize() {
    return { width: 0, height: 0, baseline: 0 };
}

var DEFAULT_OPTIONS = {
    baselineMarkerSize: 1
};

var defaultMeasureBox;

if (typeof document !== "undefined") {
    defaultMeasureBox = document.createElement("div");
    defaultMeasureBox.style.cssText = "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: pre!important;";
}

var TextMetrics = (function (Class) {
    function TextMetrics(options) {
        Class.call(this);

        this._cache = new __WEBPACK_IMPORTED_MODULE_0__lru_cache__["a" /* default */](1000);
        this.options = Object.assign({}, DEFAULT_OPTIONS, options);
    }

    if ( Class ) TextMetrics.__proto__ = Class;
    TextMetrics.prototype = Object.create( Class && Class.prototype );
    TextMetrics.prototype.constructor = TextMetrics;

    TextMetrics.prototype.measure = function measure (text, style, options) {
        if ( options === void 0 ) options = {};

        if (!text) {
            return zeroSize();
        }

        var styleKey = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* objectKey */])(style);
        var cacheKey = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["b" /* hashKey */])(text + styleKey);
        var cachedResult = this._cache.get(cacheKey);

        if (cachedResult) {
            return cachedResult;
        }

        var size = zeroSize();
        var measureBox = options.box || defaultMeasureBox;
        var baselineMarker = this._baselineMarker().cloneNode(false);

        for (var key in style) {
            var value = style[key];
            if (typeof value !== "undefined") {
                measureBox.style[key] = value;
            }
        }

        var textStr = options.normalizeText !== false ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["c" /* normalizeText */])(text) : String(text);

        measureBox.textContent = textStr;
        measureBox.appendChild(baselineMarker);
        document.body.appendChild(measureBox);

        if (textStr.length) {
            size.width = measureBox.offsetWidth - this.options.baselineMarkerSize;
            size.height = measureBox.offsetHeight;
            size.baseline = baselineMarker.offsetTop + this.options.baselineMarkerSize;
        }

        if (size.width > 0 && size.height > 0) {
            this._cache.put(cacheKey, size);
        }

        measureBox.parentNode.removeChild(measureBox);

        return size;
    };

    TextMetrics.prototype._baselineMarker = function _baselineMarker () {
        var marker = document.createElement("div");
        marker.style.cssText = "display: inline-block; vertical-align: baseline;width: " +
            this.options.baselineMarkerSize + "px; height: " + this.options.baselineMarkerSize + "px;overflow: hidden;";

        return marker;
    };

    return TextMetrics;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

TextMetrics.current = new TextMetrics();

/* harmony default export */ __webpack_exports__["a"] = (TextMetrics);
//# sourceMappingURL=text-metrics.js.map


/***/ }),
/* 456 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return objectKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hashKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return normalizeText; });
var REPLACE_REGEX = /\r?\n|\r|\t/g;
var SPACE = ' ';

function normalizeText(text) {
    return String(text).replace(REPLACE_REGEX, SPACE);
}

function objectKey(object) {
    var parts = [];
    for (var key in object) {
        parts.push(key + object[key]);
    }

    return parts.sort().join("");
}

// Computes FNV-1 hash
// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
function hashKey(str) {
    // 32-bit FNV-1 offset basis
    // See http://isthe.com/chongo/tech/comp/fnv/#FNV-param
    var hash = 0x811C9DC5;

    for (var i = 0; i < str.length; ++i) {
        hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);
        hash ^= str.charCodeAt(i);
    }

    return hash >>> 0;
}


//# sourceMappingURL=util.js.map


/***/ }),
/* 457 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = elementStyles;
function elementStyles(element, styles) {
    var result = {};
    var style = window.getComputedStyle(element);
    var stylesArray = Array.isArray(styles) ? styles : [ styles ];

    for (var idx = 0; idx < stylesArray.length; idx++) {
        var field = stylesArray[idx];
        result[field] = style[field];
    }

    return result;
}
//# sourceMappingURL=element-styles.js.map


/***/ }),
/* 458 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__excel_exporter__ = __webpack_require__(743);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__excel_exporter__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services__ = __webpack_require__(745);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ooxml__ = __webpack_require__(744);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__ooxml__["a"]; });



//# sourceMappingURL=main.js.map


/***/ }),
/* 459 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var current = {
    toString: function (value) { return value; }
};

var IntlService = function IntlService () {};

IntlService.register = function register (userImplementation) {
    current = userImplementation;
};

IntlService.toString = function toString (value, format) {
    return current.toString(value, format);
};

/* harmony default export */ __webpack_exports__["a"] = (IntlService);
//# sourceMappingURL=intl-service.js.map


/***/ }),
/* 460 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var current = {
    compile: function(template) {
        return template;
    }
};

var TemplateService = function TemplateService () {};

TemplateService.register = function register (userImplementation) {
    current = userImplementation;
};

TemplateService.compile = function compile (template) {
    return current.compile(template);
};

/* harmony default export */ __webpack_exports__["a"] = (TemplateService);
//# sourceMappingURL=template-service.js.map


/***/ }),
/* 461 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = map;
function map(array, func) {
    return array.reduce(function (result, el, i) {
        var val = func(el, i);
        if (val != null) {
            result.push(val);
        }
        return result;
    }, []);
}
//# sourceMappingURL=map.js.map


/***/ }),
/* 462 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
    "fit": "fit",
    "flip": "flip"
});

//# sourceMappingURL=collision.js.map


/***/ }),
/* 463 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scroll_position__ = __webpack_require__(469);


/* harmony default export */ __webpack_exports__["a"] = (function (element) {
    if (element === (element.ownerDocument || {}).body) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scroll_position__["a" /* default */])(element);
    }

    return {
        x: element.scrollLeft,
        y: element.scrollTop
    };
});;

//# sourceMappingURL=element-scroll-position.js.map


/***/ }),
/* 464 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__align__ = __webpack_require__(749);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__align__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__add_scroll__ = __webpack_require__(748);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__add_scroll__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__apply_location_offset__ = __webpack_require__(750);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2__apply_location_offset__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__bounding_offset__ = __webpack_require__(751);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_3__bounding_offset__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__is_body_offset__ = __webpack_require__(752);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_4__is_body_offset__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__offset_parent__ = __webpack_require__(102);
/* unused harmony reexport offsetParent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__offset__ = __webpack_require__(465);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_6__offset__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__parents__ = __webpack_require__(467);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_7__parents__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__parent_scroll_position__ = __webpack_require__(466);
/* unused harmony reexport parentScrollPosition */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__position__ = __webpack_require__(468);
/* unused harmony reexport position */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__position_with_scroll__ = __webpack_require__(754);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_10__position_with_scroll__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__remove_scroll__ = __webpack_require__(755);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_11__remove_scroll__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__restrict_to_view__ = __webpack_require__(756);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_12__restrict_to_view__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__scroll_position__ = __webpack_require__(469);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_13__scroll_position__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__sibling_container__ = __webpack_require__(757);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_14__sibling_container__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__siblings__ = __webpack_require__(470);
/* unused harmony reexport siblings */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__document__ = __webpack_require__(232);
/* unused harmony reexport getDocumentElement */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__window__ = __webpack_require__(143);
/* unused harmony reexport getWindow */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__window_viewport__ = __webpack_require__(758);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_18__window_viewport__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__align_point__ = __webpack_require__(231);
/* unused harmony reexport AlignPoint */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__collision__ = __webpack_require__(462);
/* unused harmony reexport Collision */
























//# sourceMappingURL=main.js.map


/***/ }),
/* 465 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var rectOfHiddenElement = function (element) {
    var ref = element.style;
    var display = ref.display;
    var left = ref.left;
    var position = ref.position;

    element.style.display = '';
    element.style.left = '-10000px';
    element.style.position = 'absolute';

    var rect = element.getBoundingClientRect();

    element.style.display = display;
    element.style.left = left;
    element.style.position = position;

    return rect;
};

var offset = function (element) {
    var rect = element.getBoundingClientRect();
    var left = rect.left;
    var top = rect.top;

    if (!rect.height && !rect.width) {
        rect = rectOfHiddenElement(element);
    }

    return {
        top: top,
        left: left,
        height: rect.height,
        width: rect.width
    };
};

/* harmony default export */ __webpack_exports__["a"] = (offset);

//# sourceMappingURL=offset.js.map


/***/ }),
/* 466 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = parentScrollPosition;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__offset_parent__ = __webpack_require__(102);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__element_scroll_position__ = __webpack_require__(463);



function parentScrollPosition(element) {
    var parent = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__offset_parent__["a" /* default */])(element);

    return parent ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__element_scroll_position__["a" /* default */])(parent) : { x: 0, y: 0 };
}

//# sourceMappingURL=parent-scroll-position.js.map


/***/ }),
/* 467 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function (element, until) {
    var result = [];
    var next = element.parentNode;

    while (next) {
        result.push(next);

        if (next === until) { break; }

        next = next.parentNode;
    }

    return result;
});;

//# sourceMappingURL=parents.js.map


/***/ }),
/* 468 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__offset_parent__ = __webpack_require__(102);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__offset__ = __webpack_require__(465);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__window__ = __webpack_require__(143);




var position = function (element, parent) {
    var win = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__window__["a" /* default */])(element);
    var elementStyles = win.getComputedStyle(element);
    var offset = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__offset__["a" /* default */])(element);
    var parentElement = parent || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__offset_parent__["a" /* default */])(element);

    var ownerDocument = element.ownerDocument;
    var useRelative = parentElement !== ownerDocument.body && parentElement !== ownerDocument.documentElement;

    var parentOffset = { top: 0, left: 0 };

    if (elementStyles.position !== "fixed" && useRelative) {
        var parentStyles = win.getComputedStyle(parentElement);

        parentOffset = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__offset__["a" /* default */])(parentElement);
        parentOffset.top += parseInt(parentStyles.borderTopWidth, 10);
        parentOffset.left += parseInt(parentStyles.borderLeftWidth, 10);
    }

    return {
        top: offset.top - parentOffset.top - parseInt(elementStyles.marginTop, 10),
        left: offset.left - parentOffset.left - parseInt(elementStyles.marginLeft, 10),
        height: offset.height,
        width: offset.width
    };
};

/* harmony default export */ __webpack_exports__["a"] = (position);

//# sourceMappingURL=position.js.map


/***/ }),
/* 469 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = scrollPosition;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__document__ = __webpack_require__(232);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__window__ = __webpack_require__(143);



function scrollPosition(element) {
    var documentElement = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__document__["a" /* default */])(element);
    var win = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__window__["a" /* default */])(element);

    return {
        x: win.pageXOffset || documentElement.scrollLeft || 0,
        y: win.pageYOffset || documentElement.scrollTop || 0
    };
}

//# sourceMappingURL=scroll-position.js.map


/***/ }),
/* 470 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony default export */ __webpack_exports__["a"] = (function (element) {
    var result = [];

    var sibling = element.parentNode.firstElementChild;

    while (sibling) {
        if (sibling !== element) {
            result.push(sibling);
        }

        sibling = sibling.nextElementSibling;
    }
    return result;
});;

//# sourceMappingURL=siblings.js.map


/***/ }),
/* 471 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export Draggable */
var proxy = function (a, b) { return function (e) { return b(a(e)); }; };

var bind = function (el, event, callback) { return el.addEventListener && el.addEventListener(event, callback); };

var unbind = function (el, event, callback) { return el.removeEventListener && el.removeEventListener(event, callback); };

var noop = function () { /* empty */ };

var touchRegExp = /touch/;

// 300ms is the usual mouse interval;
// // However, an underpowered mobile device under a heavy load may queue mouse events for a longer period.
var IGNORE_MOUSE_TIMEOUT = 2000;

function normalizeEvent(e) {
    if (e.type.match(touchRegExp)) {
        return {
            pageX: e.changedTouches[0].pageX,
            pageY: e.changedTouches[0].pageY,
            type: e.type,
            originalEvent: e
        };
    }

    return {
        pageX: e.pageX,
        pageY: e.pageY,
        offsetX: e.offsetX,
        offsetY: e.offsetY,
        type: e.type,
        ctrlKey: e.ctrlKey,
        shiftKey: e.shiftKey,
        altKey: e.altKey,
        originalEvent: e
    };
}

var Draggable = function Draggable(ref) {
    var this$1 = this;
    var press = ref.press; if ( press === void 0 ) press = noop;
    var drag = ref.drag; if ( drag === void 0 ) drag = noop;
    var release = ref.release; if ( release === void 0 ) release = noop;

    this._pressHandler = proxy(normalizeEvent, press);
    this._dragHandler = proxy(normalizeEvent, drag);
    this._releaseHandler = proxy(normalizeEvent, release);
    this._ignoreMouse = false;
    this._touchAction;

    this._touchstart = function (e) {
        if (e.touches.length === 1) {
            this$1._pressHandler(e);
        }
    };

    this._touchmove = function (e) {
        if (e.touches.length === 1) {
            this$1._dragHandler(e);
        }
    };

    this._touchend = function (e) {
        // the last finger has been lifted, and the user is not doing gesture.
        // there might be a better way to handle this.
        if (e.touches.length === 0 && e.changedTouches.length === 1) {
            this$1._releaseHandler(e);
            this$1._ignoreMouse = true;
            setTimeout(this$1._restoreMouse, IGNORE_MOUSE_TIMEOUT);
        }
    };

    this._restoreMouse = function () {
        this$1._ignoreMouse = false;
    };

    this._mousedown = function (e) {
        var which = e.which;

        if ((which && which > 1) || this$1._ignoreMouse) {
            return;
        }

        bind(document, "mousemove", this$1._mousemove);
        bind(document, "mouseup", this$1._mouseup);
        this$1._pressHandler(e);
    };

    this._mousemove = function (e) {
        this$1._dragHandler(e);
    };

    this._mouseup = function (e) {
        unbind(document, "mousemove", this$1._mousemove);
        unbind(document, "mouseup", this$1._mouseup);
        this$1._releaseHandler(e);
    };

    this._pointerdown = function (e) {
        if (e.isPrimary) {
            bind(this$1._element, "pointermove", this$1._pointermove);
            this$1._touchAction = e.target.style.touchAction;
            e.target.style.touchAction = "none";
            e.target.setPointerCapture(e.pointerId);
            this$1._pressHandler(e);
        }
    };

    this._pointermove = function (e) {
        if (e.isPrimary) {
            this$1._dragHandler(e);
        }
    };

    this._pointerup = function (e) {
        if (e.isPrimary) {
            unbind(this$1._element, "pointermove", this$1._pointermove);
            e.target.style.touchAction = this$1._touchAction;
            this$1._releaseHandler(e);
        }
    };
};

Draggable.supportPointerEvent = function supportPointerEvent () {
    return window.PointerEvent;
};

Draggable.prototype.bindTo = function bindTo (element) {
    if (element === this._element) {
        return;
    }

    if (this._element) {
        this._unbindFromCurrent();
    }

    this._element = element;

    if (Draggable.supportPointerEvent()) {
        bind(element, "pointerdown", this._pointerdown);
        bind(element, "pointerup", this._pointerup);
    } else {
        bind(element, "mousedown", this._mousedown);
        bind(element, "touchstart", this._touchstart);
        bind(element, "touchmove", this._touchmove);
        bind(element, "touchend", this._touchend);
    }
};

Draggable.prototype._unbindFromCurrent = function _unbindFromCurrent () {
    if (Draggable.supportPointerEvent()) {
        unbind(this._element, "pointerdown", this._pointerdown);
        unbind(this._element, "pointermove", this._pointermove);
        unbind(this._element, "pointerup", this._pointerup);
    } else {
        unbind(this._element, "mousedown", this._mousedown);
        unbind(this._element, "touchstart", this._touchstart);
        unbind(this._element, "touchmove", this._touchmove);
        unbind(this._element, "touchend", this._touchend);
    }
};

Draggable.prototype.destroy = function destroy () {
    this._unbindFromCurrent();
    this._element = null;
};

// Rollup won't output exports['default'] otherwise
/* harmony default export */ __webpack_exports__["a"] = (Draggable);


//# sourceMappingURL=main.js.map


/***/ }),
/* 472 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var calculateFixedTrackSize = function (ref) {
        var max = ref.max;
        var min = ref.min;
        var smallStep = ref.smallStep;
        var fixedTickWidth = ref.fixedTickWidth;

        return ((max - min) / smallStep) * fixedTickWidth;
};

var calculateTrackSize = function (wrapperWidth, offset, showButtons) {
    if ( showButtons === void 0 ) showButtons = true;

    var BUTTONS_COUNT = 2;
    var trackOffset = showButtons ? parseFloat(offset, 10) * BUTTONS_COUNT : 0;
    var trackWidth = wrapperWidth - trackOffset;

    return trackWidth;
};

var calculateTicksCount = function (max, min, smallStep) {
        if ( max === void 0 ) max = 0;
        if ( min === void 0 ) min = 0;
        if ( smallStep === void 0 ) smallStep = 1;

        return calculateAreasCount(max, min, smallStep) + 1;
};

var calculateAreasCount = function (max, min, smallStep) {
    if ( max === void 0 ) max = 0;
    if ( min === void 0 ) min = 0;
    if ( smallStep === void 0 ) smallStep = 1;

    if (smallStep <= 0 ) {
        throw new Error("Invalid argument: smallStep must be a positive number");
    }

    return Math.floor(Math.abs(min - max) / smallStep);
};

var calculateValueFromTick = function (index, ref) {
    var max = ref.max;
    var min = ref.min;
    var smallStep = ref.smallStep;
    var reverse = ref.reverse;
    var vertical = ref.vertical;

    var value = min + (index * smallStep);

    return vertical || reverse ? Math.abs(value - max) : value;
};

var calculateValueFromTrack = function (clientRect, pageOffset, props) {
    var length, wrapperOffset;

    if (props.vertical) {
        var top = clientRect.top;
        var bottom = clientRect.bottom;
        length = top - bottom;
        wrapperOffset = pageOffset.pageY - bottom;
    } else {
        var left = clientRect.left;
        var right = clientRect.right;
        length = right - left;
        wrapperOffset = pageOffset.pageX - left;
    }

    return valueFromTrack(props, wrapperOffset, length);
};

var valueFromTrack = function (props, wrapperOffset, length) {
    var max = props.max;
    var min = props.min;
    var reverse = props.reverse;
    var smallStep = props.smallStep;
    var distance = max - min;
    var clickOffset = wrapperOffset / length;
    var maxTickValue = distance - (distance % smallStep);
    var maxOffset = (100 / distance) * maxTickValue / 100;
    var absValue = (wrapperOffset / length) * distance;
    var value = max;

    if (clickOffset < maxOffset) {
        value = reverse ? max - absValue : absValue + min;
    }

    return snapValue(extendProps(props, { value: value }));
};

var calculateTickSizes = function (trackSize, min, max, step) {
    var elementCount = Math.floor((max - min) / step) + 1;
    var distStep = trackSize / (max - min);
    var result = [];
    var usedSpace = 0;
    var endPoint = 0;

    for (var i = 0; i < elementCount; i++) {
        if (i === 0 || i === elementCount - 1) {
            endPoint += (step / 2) * distStep;
        } else {
            endPoint += step * distStep;
        }

        var size = Math.round(endPoint - usedSpace);

        result.push(size);

        usedSpace += size;
    }

    return result;
};

var calculateHandlePosition = function (ref) {
    var handleWidth = ref.handleWidth;
    var trackWidth = ref.trackWidth;
    var min = ref.min;
    var max = ref.max;
    var reverse = ref.reverse;
    var value = ref.value;

    var halfHandleWidth = Math.floor(handleWidth / 2);
    var step = trackWidth / Math.abs(max - min);
    var pos = step * (value - min);
    if (reverse) {
        pos = trackWidth - pos;
    }

    return Math.floor(pos - halfHandleWidth);
};

var decreaseValueToStep = function (ref) {
    var max = ref.max;
    var min = ref.min;
    var smallStep = ref.smallStep;
    var value = ref.value;

    var result;
    if (value % smallStep === 0) {
        result = value - smallStep;
    } else {
        result = value - (value % smallStep);
    }
    return trimValue(max, min, result);
};

var increaseValueToStep = function (ref) {
    var max = ref.max;
    var min = ref.min;
    var smallStep = ref.smallStep;
    var value = ref.value;

    var result = value - (value % smallStep) + smallStep;

    return trimValue(max, min, result);
};

var snapValue = function (props) {
    var smallStep = props.smallStep;
    var value = props.value;
    var left = decreaseValueToStep(props);
    var right = increaseValueToStep(props);

    if (value % smallStep === 0) {
        return value;
    }

    if (right - value <= smallStep / 2) {
        return right;
    }

    return left;
};

var trimValue = function (max, min, value) {
    if (value > max) {
        return max;
    }

    if (value < min) {
        return min;
    }

    return value;
};

var identity = function (value) { return value; };

var extendProps = function (target) {
    var sources = [], len = arguments.length - 1;
    while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ];

    return Object.assign.apply(Object, [ {}, target ].concat( sources ));
};

/* harmony default export */ __webpack_exports__["a"] = ({
    calculateFixedTrackSize: calculateFixedTrackSize,
    calculateValueFromTick: calculateValueFromTick,
    calculateValueFromTrack: calculateValueFromTrack,
    calculateTrackSize: calculateTrackSize,
    calculateTicksCount: calculateTicksCount,
    calculateTickSizes: calculateTickSizes,
    calculateHandlePosition: calculateHandlePosition,
    decreaseValueToStep: decreaseValueToStep,
    identity: identity,
    increaseValueToStep: increaseValueToStep,
    trimValue: trimValue,
    snapValue: snapValue,
    valueFromTrack: valueFromTrack
});

//# sourceMappingURL=SliderUtil.js.map


/***/ }),
/* 473 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = dateFormatNames;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_constants__ = __webpack_require__(22);



function lowerArray(arr) {
    var result = [];
    for (var idx = 0; idx < arr.length; idx++) {
        result.push(arr[idx].toLowerCase());
    }
    return result;
}

function lowerObject(obj) {
    var result = {};
    for (var field in obj) {
        result[field] = obj[field].toLowerCase();
    }
    return result;
}

function cloneLower(obj) {
    var result = Array.isArray(obj) ? lowerArray(obj) : lowerObject(obj);
    return result;
}

function dateFormatNames(locale, options) {
    var type = options.type;
    var nameType = options.nameType;
    var standAlone = options.standAlone;
    var lower = options.lower;
    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__info__["a" /* getLocaleInfo */])(locale);
    var formatType = standAlone ? "stand-alone" : "format";
    var lowerNameType = (lower ? "lower-" : __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]) + nameType;
    var formatNames = info.calendar[type][formatType];
    var result = formatNames[lowerNameType];
    if (!result && lower) {
        result = formatNames[lowerNameType] = cloneLower(formatNames[nameType]);
    }
    return result;
}
//# sourceMappingURL=date-format-names.js.map


/***/ }),
/* 474 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatString;
var formatRegExp = /\{(\d+)}/g;

function formatString(format) {
    var values = arguments;

    return format.replace(formatRegExp, function (match, index) {
        var value = values[parseInt(index, 10) + 1];

        return value;
    });
}
//# sourceMappingURL=format-string.js.map


/***/ }),
/* 475 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = pad;
function pad(number, digits, right) {
    if ( digits === void 0 ) digits = 2;
    if ( right === void 0 ) right = false;

    var count = digits - String(number).length;
    var result = number;

    if (count > 0) {
        var padString = new Array(count + 1).join("0");
        result = right ? number + padString : padString + number;
    }

    return result;
}
//# sourceMappingURL=pad.js.map


/***/ }),
/* 476 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dates_format_date__ = __webpack_require__(772);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__dates_format_date__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dates_parse_date__ = __webpack_require__(773);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__dates_parse_date__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dates_split_date_format__ = __webpack_require__(774);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__dates_split_date_format__["a"]; });




//# sourceMappingURL=dates.js.map


/***/ }),
/* 477 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dateFormatRegExp; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DATE_FIELD_MAP; });
var MONTH = 'month';
var HOUR = 'hour';
var ZONE = 'zone';
var WEEKDAY = 'weekday';
var QUARTER = 'quarter';

var DATE_FIELD_MAP = {
    'G': 'era',
    'y': 'year',
    'q': QUARTER,
    'Q': QUARTER,
    'M': MONTH,
    'L': MONTH,
    'd': 'day',
    'E': WEEKDAY,
    'c': WEEKDAY,
    'e': WEEKDAY,
    'h': HOUR,
    'H': HOUR,
    'k': HOUR,
    'K': HOUR,
    'm': 'minute',
    's': 'second',
    'a': 'dayperiod',
    'x': ZONE,
    'X': ZONE,
    'z': ZONE,
    'Z': ZONE
};

var dateFormatRegExp = /d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|"[^"]*"|'[^']*'/g;


//# sourceMappingURL=constants.js.map


/***/ }),
/* 478 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = dateNameType;
function dateNameType(formatLength) {
    var nameType;
    if (formatLength <= 3) {
        nameType = "abbreviated";
    } else if (formatLength === 4) {
        nameType = "wide";
    } else if (formatLength === 5) {
        nameType = "narrow";
    } else if (formatLength === 6) {
        nameType = "short";
    }

    return nameType;
}
//# sourceMappingURL=date-name-type.js.map


/***/ }),
/* 479 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatNames;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cldr_date_format_names__ = __webpack_require__(473);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__date_name_type__ = __webpack_require__(478);



function formatNames(locale, type, formatLength, standAlone, lower) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr_date_format_names__["a" /* default */])(locale, {
        type: type,
        nameType: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__date_name_type__["a" /* default */])(formatLength),
        standAlone: standAlone,
        lower: lower
    });
}
//# sourceMappingURL=format-names.js.map


/***/ }),
/* 480 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__numbers_format_number__ = __webpack_require__(780);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__numbers_format_number__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__numbers_parse_number__ = __webpack_require__(781);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__numbers_parse_number__["a"]; });


//# sourceMappingURL=numbers.js.map


/***/ }),
/* 481 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatCurrencySymbol;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cldr__ = __webpack_require__(46);


function formatCurrencySymbol(info, options) {
    if ( options === void 0 ) options = {};

    if (!options.currency) {
        options.currency = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["h" /* localeCurrency */])(info, true);
    }

    var display = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["j" /* currencyDisplay */])(info, options);

    return display;
}

//# sourceMappingURL=format-currency-symbol.js.map


/***/ }),
/* 482 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatOptions;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_is_string__ = __webpack_require__(237);



var standardFormatRegExp = /^(n|c|p|e|a)(\d*)$/i;

function standardFormatOptions(format) {
    var formatAndPrecision = standardFormatRegExp.exec(format);

    if (formatAndPrecision) {
        var options = {
            style: __WEBPACK_IMPORTED_MODULE_0__common_constants__["i" /* DECIMAL */]
        };

        var style = formatAndPrecision[1].toLowerCase();

        if (style === "c") {
            options.style = __WEBPACK_IMPORTED_MODULE_0__common_constants__["h" /* CURRENCY */];
        } else if (style === "a") {
            options.style = __WEBPACK_IMPORTED_MODULE_0__common_constants__["j" /* ACCOUNTING */];
        } else if (style === "p") {
            options.style = __WEBPACK_IMPORTED_MODULE_0__common_constants__["k" /* PERCENT */];
        } else if (style === "e") {
            options.style = __WEBPACK_IMPORTED_MODULE_0__common_constants__["l" /* SCIENTIFIC */];
        }

        if (formatAndPrecision[2]) {
            options.minimumFractionDigits = options.maximumFractionDigits = parseInt(formatAndPrecision[2], 10);
        }

        return options;
    }
}

function formatOptions(format) {
    var options;
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_is_string__["a" /* default */])(format)) {
        options = standardFormatOptions(format);
    } else {
        options = format;
    }

    return options;
}
//# sourceMappingURL=format-options.js.map


/***/ }),
/* 483 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = groupInteger;
function groupInteger(number, start, end, options, info) {
    var symbols = info.numbers.symbols;
    var decimalIndex = number.indexOf(symbols.decimal);
    var groupSizes = options.groupSize.slice();
    var groupSize = groupSizes.shift();

    var integerEnd = decimalIndex !== -1 ? decimalIndex : end + 1;

    var integer = number.substring(start, integerEnd);
    var result = number;
    var integerLength = integer.length;

    if (integerLength >= groupSize) {
        var idx = integerLength;
        var parts = [];

        while (idx > -1) {
            var value = integer.substring(idx - groupSize, idx);
            if (value) {
                parts.push(value);
            }
            idx -= groupSize;
            var newGroupSize = groupSizes.shift();
            groupSize = newGroupSize !== undefined ? newGroupSize : groupSize;

            if (groupSize === 0) {
                value = integer.substring(0, idx);
                if (value) {
                    parts.push(value);
                }
                break;
            }
        }

        integer = parts.reverse().join(symbols.group);
        result = number.substring(0, start) + integer + number.substring(integerEnd);
    }

    return result;
}
//# sourceMappingURL=group-integer.js.map


/***/ }),
/* 484 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isCurrencyStyle;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_constants__ = __webpack_require__(22);


function isCurrencyStyle(style) {
    return style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["h" /* CURRENCY */] || style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["j" /* ACCOUNTING */];
}
//# sourceMappingURL=is-currency-style.js.map


/***/ }),
/* 485 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

var AppComponent = (function () {
    function AppComponent() {
    }
    AppComponent = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'app',
            template: __webpack_require__(798),
            styles: [__webpack_require__(1041)]
        })
    ], AppComponent);
    return AppComponent;
}());



/***/ }),
/* 486 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FetchDataService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Rx__ = __webpack_require__(811);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Rx__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__ = __webpack_require__(150);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(250);
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var CREATE_ACTION = 'create';
var UPDATE_ACTION = 'update';
var REMOVE_ACTION = 'destroy';
var FetchDataService = (function (_super) {
    __extends(FetchDataService, _super);
    function FetchDataService(http) {
        var _this = _super.call(this, []) || this;
        _this.http = http;
        _this.data = [];
        return _this;
    }
    FetchDataService.prototype.read = function () {
        var _this = this;
        var action = '';
        var data = [];
        this.fetch(action, data, this.assocguid)
            .do(function (data) { return _this.data = data; })
            .subscribe(function (data) {
            _this.extractData(data);
            _super.prototype.next.call(_this, data);
        });
    };
    FetchDataService.prototype.resetItem = function (dataItem) {
        if (!dataItem) {
            return;
        }
        //find orignal data item
        var originalDataItem = this.data.find(function (item) { return item.dateFormatted === dataItem.dateFormatted; });
        //revert changes
        Object.assign(originalDataItem, dataItem);
        _super.prototype.next.call(this, this.data);
    };
    FetchDataService.prototype.reset = function () {
        this.data = [];
    };
    FetchDataService.prototype.fetch = function (action, data, guid) {
        if (action === void 0) { action = ""; }
        var datatest = JSON.stringify(data);
        if (action == "") {
            var options = new __WEBPACK_IMPORTED_MODULE_3__angular_http__["RequestOptions"]();
            options.body = this.serializeModels(data);
            return this.http
                .get('api/SampleData/WeatherForecasts', options)
                .map(function (response) { return response.json(); }).catch(this.handleError);
        }
        throw Error('Internal REST Command Error');
    };
    FetchDataService.prototype.serializeModels = function (data) {
        return data ? "&models=" + JSON.stringify([data]) : '';
    };
    FetchDataService.prototype.handleError = function (error) {
        console.error(error);
        return __WEBPACK_IMPORTED_MODULE_1_rxjs_Rx__["Observable"].throw(error.json().error || 'Server error');
    };
    FetchDataService.prototype.extractData = function (data) {
        data.forEach(function (d) {
            d.doB = new Date(d.doB);
            d.dueDate = new Date(d.dueDate);
        });
        return data;
    };
    FetchDataService = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_3__angular_http__["Http"]])
    ], FetchDataService);
    return FetchDataService;
}(__WEBPACK_IMPORTED_MODULE_2_rxjs_BehaviorSubject__["BehaviorSubject"]));



/***/ }),
/* 487 */
/***/ (function(module, exports) {

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
	var list = [];

	// return the list of modules as css string
	list.toString = function toString() {
		return this.map(function (item) {
			var content = cssWithMappingToString(item, useSourceMap);
			if(item[2]) {
				return "@media " + item[2] + "{" + content + "}";
			} else {
				return content;
			}
		}).join("");
	};

	// import a list of modules into the list
	list.i = function(modules, mediaQuery) {
		if(typeof modules === "string")
			modules = [[null, modules, ""]];
		var alreadyImportedModules = {};
		for(var i = 0; i < this.length; i++) {
			var id = this[i][0];
			if(typeof id === "number")
				alreadyImportedModules[id] = true;
		}
		for(i = 0; i < modules.length; i++) {
			var item = modules[i];
			// skip already imported module
			// this implementation is not 100% perfect for weird media query combinations
			//  when a module is imported multiple times with different media queries.
			//  I hope this will never occur (Hey this way we have smaller bundles)
			if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
				if(mediaQuery && !item[2]) {
					item[2] = mediaQuery;
				} else if(mediaQuery) {
					item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
				}
				list.push(item);
			}
		}
	};
	return list;
};

function cssWithMappingToString(item, useSourceMap) {
	var content = item[1] || '';
	var cssMapping = item[3];
	if (!cssMapping) {
		return content;
	}

	if (useSourceMap && typeof btoa === 'function') {
		var sourceMapping = toComment(cssMapping);
		var sourceURLs = cssMapping.sources.map(function (source) {
			return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
		});

		return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
	}

	return [content].join('\n');
}

// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
	// eslint-disable-next-line no-undef
	var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
	var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;

	return '/*# ' + data + ' */';
}


/***/ }),
/* 488 */
/***/ (function(module, exports) {

var ENTITIES = [['Aacute', [193]], ['aacute', [225]], ['Abreve', [258]], ['abreve', [259]], ['ac', [8766]], ['acd', [8767]], ['acE', [8766, 819]], ['Acirc', [194]], ['acirc', [226]], ['acute', [180]], ['Acy', [1040]], ['acy', [1072]], ['AElig', [198]], ['aelig', [230]], ['af', [8289]], ['Afr', [120068]], ['afr', [120094]], ['Agrave', [192]], ['agrave', [224]], ['alefsym', [8501]], ['aleph', [8501]], ['Alpha', [913]], ['alpha', [945]], ['Amacr', [256]], ['amacr', [257]], ['amalg', [10815]], ['amp', [38]], ['AMP', [38]], ['andand', [10837]], ['And', [10835]], ['and', [8743]], ['andd', [10844]], ['andslope', [10840]], ['andv', [10842]], ['ang', [8736]], ['ange', [10660]], ['angle', [8736]], ['angmsdaa', [10664]], ['angmsdab', [10665]], ['angmsdac', [10666]], ['angmsdad', [10667]], ['angmsdae', [10668]], ['angmsdaf', [10669]], ['angmsdag', [10670]], ['angmsdah', [10671]], ['angmsd', [8737]], ['angrt', [8735]], ['angrtvb', [8894]], ['angrtvbd', [10653]], ['angsph', [8738]], ['angst', [197]], ['angzarr', [9084]], ['Aogon', [260]], ['aogon', [261]], ['Aopf', [120120]], ['aopf', [120146]], ['apacir', [10863]], ['ap', [8776]], ['apE', [10864]], ['ape', [8778]], ['apid', [8779]], ['apos', [39]], ['ApplyFunction', [8289]], ['approx', [8776]], ['approxeq', [8778]], ['Aring', [197]], ['aring', [229]], ['Ascr', [119964]], ['ascr', [119990]], ['Assign', [8788]], ['ast', [42]], ['asymp', [8776]], ['asympeq', [8781]], ['Atilde', [195]], ['atilde', [227]], ['Auml', [196]], ['auml', [228]], ['awconint', [8755]], ['awint', [10769]], ['backcong', [8780]], ['backepsilon', [1014]], ['backprime', [8245]], ['backsim', [8765]], ['backsimeq', [8909]], ['Backslash', [8726]], ['Barv', [10983]], ['barvee', [8893]], ['barwed', [8965]], ['Barwed', [8966]], ['barwedge', [8965]], ['bbrk', [9141]], ['bbrktbrk', [9142]], ['bcong', [8780]], ['Bcy', [1041]], ['bcy', [1073]], ['bdquo', [8222]], ['becaus', [8757]], ['because', [8757]], ['Because', [8757]], ['bemptyv', [10672]], ['bepsi', [1014]], ['bernou', [8492]], ['Bernoullis', [8492]], ['Beta', [914]], ['beta', [946]], ['beth', [8502]], ['between', [8812]], ['Bfr', [120069]], ['bfr', [120095]], ['bigcap', [8898]], ['bigcirc', [9711]], ['bigcup', [8899]], ['bigodot', [10752]], ['bigoplus', [10753]], ['bigotimes', [10754]], ['bigsqcup', [10758]], ['bigstar', [9733]], ['bigtriangledown', [9661]], ['bigtriangleup', [9651]], ['biguplus', [10756]], ['bigvee', [8897]], ['bigwedge', [8896]], ['bkarow', [10509]], ['blacklozenge', [10731]], ['blacksquare', [9642]], ['blacktriangle', [9652]], ['blacktriangledown', [9662]], ['blacktriangleleft', [9666]], ['blacktriangleright', [9656]], ['blank', [9251]], ['blk12', [9618]], ['blk14', [9617]], ['blk34', [9619]], ['block', [9608]], ['bne', [61, 8421]], ['bnequiv', [8801, 8421]], ['bNot', [10989]], ['bnot', [8976]], ['Bopf', [120121]], ['bopf', [120147]], ['bot', [8869]], ['bottom', [8869]], ['bowtie', [8904]], ['boxbox', [10697]], ['boxdl', [9488]], ['boxdL', [9557]], ['boxDl', [9558]], ['boxDL', [9559]], ['boxdr', [9484]], ['boxdR', [9554]], ['boxDr', [9555]], ['boxDR', [9556]], ['boxh', [9472]], ['boxH', [9552]], ['boxhd', [9516]], ['boxHd', [9572]], ['boxhD', [9573]], ['boxHD', [9574]], ['boxhu', [9524]], ['boxHu', [9575]], ['boxhU', [9576]], ['boxHU', [9577]], ['boxminus', [8863]], ['boxplus', [8862]], ['boxtimes', [8864]], ['boxul', [9496]], ['boxuL', [9563]], ['boxUl', [9564]], ['boxUL', [9565]], ['boxur', [9492]], ['boxuR', [9560]], ['boxUr', [9561]], ['boxUR', [9562]], ['boxv', [9474]], ['boxV', [9553]], ['boxvh', [9532]], ['boxvH', [9578]], ['boxVh', [9579]], ['boxVH', [9580]], ['boxvl', [9508]], ['boxvL', [9569]], ['boxVl', [9570]], ['boxVL', [9571]], ['boxvr', [9500]], ['boxvR', [9566]], ['boxVr', [9567]], ['boxVR', [9568]], ['bprime', [8245]], ['breve', [728]], ['Breve', [728]], ['brvbar', [166]], ['bscr', [119991]], ['Bscr', [8492]], ['bsemi', [8271]], ['bsim', [8765]], ['bsime', [8909]], ['bsolb', [10693]], ['bsol', [92]], ['bsolhsub', [10184]], ['bull', [8226]], ['bullet', [8226]], ['bump', [8782]], ['bumpE', [10926]], ['bumpe', [8783]], ['Bumpeq', [8782]], ['bumpeq', [8783]], ['Cacute', [262]], ['cacute', [263]], ['capand', [10820]], ['capbrcup', [10825]], ['capcap', [10827]], ['cap', [8745]], ['Cap', [8914]], ['capcup', [10823]], ['capdot', [10816]], ['CapitalDifferentialD', [8517]], ['caps', [8745, 65024]], ['caret', [8257]], ['caron', [711]], ['Cayleys', [8493]], ['ccaps', [10829]], ['Ccaron', [268]], ['ccaron', [269]], ['Ccedil', [199]], ['ccedil', [231]], ['Ccirc', [264]], ['ccirc', [265]], ['Cconint', [8752]], ['ccups', [10828]], ['ccupssm', [10832]], ['Cdot', [266]], ['cdot', [267]], ['cedil', [184]], ['Cedilla', [184]], ['cemptyv', [10674]], ['cent', [162]], ['centerdot', [183]], ['CenterDot', [183]], ['cfr', [120096]], ['Cfr', [8493]], ['CHcy', [1063]], ['chcy', [1095]], ['check', [10003]], ['checkmark', [10003]], ['Chi', [935]], ['chi', [967]], ['circ', [710]], ['circeq', [8791]], ['circlearrowleft', [8634]], ['circlearrowright', [8635]], ['circledast', [8859]], ['circledcirc', [8858]], ['circleddash', [8861]], ['CircleDot', [8857]], ['circledR', [174]], ['circledS', [9416]], ['CircleMinus', [8854]], ['CirclePlus', [8853]], ['CircleTimes', [8855]], ['cir', [9675]], ['cirE', [10691]], ['cire', [8791]], ['cirfnint', [10768]], ['cirmid', [10991]], ['cirscir', [10690]], ['ClockwiseContourIntegral', [8754]], ['clubs', [9827]], ['clubsuit', [9827]], ['colon', [58]], ['Colon', [8759]], ['Colone', [10868]], ['colone', [8788]], ['coloneq', [8788]], ['comma', [44]], ['commat', [64]], ['comp', [8705]], ['compfn', [8728]], ['complement', [8705]], ['complexes', [8450]], ['cong', [8773]], ['congdot', [10861]], ['Congruent', [8801]], ['conint', [8750]], ['Conint', [8751]], ['ContourIntegral', [8750]], ['copf', [120148]], ['Copf', [8450]], ['coprod', [8720]], ['Coproduct', [8720]], ['copy', [169]], ['COPY', [169]], ['copysr', [8471]], ['CounterClockwiseContourIntegral', [8755]], ['crarr', [8629]], ['cross', [10007]], ['Cross', [10799]], ['Cscr', [119966]], ['cscr', [119992]], ['csub', [10959]], ['csube', [10961]], ['csup', [10960]], ['csupe', [10962]], ['ctdot', [8943]], ['cudarrl', [10552]], ['cudarrr', [10549]], ['cuepr', [8926]], ['cuesc', [8927]], ['cularr', [8630]], ['cularrp', [10557]], ['cupbrcap', [10824]], ['cupcap', [10822]], ['CupCap', [8781]], ['cup', [8746]], ['Cup', [8915]], ['cupcup', [10826]], ['cupdot', [8845]], ['cupor', [10821]], ['cups', [8746, 65024]], ['curarr', [8631]], ['curarrm', [10556]], ['curlyeqprec', [8926]], ['curlyeqsucc', [8927]], ['curlyvee', [8910]], ['curlywedge', [8911]], ['curren', [164]], ['curvearrowleft', [8630]], ['curvearrowright', [8631]], ['cuvee', [8910]], ['cuwed', [8911]], ['cwconint', [8754]], ['cwint', [8753]], ['cylcty', [9005]], ['dagger', [8224]], ['Dagger', [8225]], ['daleth', [8504]], ['darr', [8595]], ['Darr', [8609]], ['dArr', [8659]], ['dash', [8208]], ['Dashv', [10980]], ['dashv', [8867]], ['dbkarow', [10511]], ['dblac', [733]], ['Dcaron', [270]], ['dcaron', [271]], ['Dcy', [1044]], ['dcy', [1076]], ['ddagger', [8225]], ['ddarr', [8650]], ['DD', [8517]], ['dd', [8518]], ['DDotrahd', [10513]], ['ddotseq', [10871]], ['deg', [176]], ['Del', [8711]], ['Delta', [916]], ['delta', [948]], ['demptyv', [10673]], ['dfisht', [10623]], ['Dfr', [120071]], ['dfr', [120097]], ['dHar', [10597]], ['dharl', [8643]], ['dharr', [8642]], ['DiacriticalAcute', [180]], ['DiacriticalDot', [729]], ['DiacriticalDoubleAcute', [733]], ['DiacriticalGrave', [96]], ['DiacriticalTilde', [732]], ['diam', [8900]], ['diamond', [8900]], ['Diamond', [8900]], ['diamondsuit', [9830]], ['diams', [9830]], ['die', [168]], ['DifferentialD', [8518]], ['digamma', [989]], ['disin', [8946]], ['div', [247]], ['divide', [247]], ['divideontimes', [8903]], ['divonx', [8903]], ['DJcy', [1026]], ['djcy', [1106]], ['dlcorn', [8990]], ['dlcrop', [8973]], ['dollar', [36]], ['Dopf', [120123]], ['dopf', [120149]], ['Dot', [168]], ['dot', [729]], ['DotDot', [8412]], ['doteq', [8784]], ['doteqdot', [8785]], ['DotEqual', [8784]], ['dotminus', [8760]], ['dotplus', [8724]], ['dotsquare', [8865]], ['doublebarwedge', [8966]], ['DoubleContourIntegral', [8751]], ['DoubleDot', [168]], ['DoubleDownArrow', [8659]], ['DoubleLeftArrow', [8656]], ['DoubleLeftRightArrow', [8660]], ['DoubleLeftTee', [10980]], ['DoubleLongLeftArrow', [10232]], ['DoubleLongLeftRightArrow', [10234]], ['DoubleLongRightArrow', [10233]], ['DoubleRightArrow', [8658]], ['DoubleRightTee', [8872]], ['DoubleUpArrow', [8657]], ['DoubleUpDownArrow', [8661]], ['DoubleVerticalBar', [8741]], ['DownArrowBar', [10515]], ['downarrow', [8595]], ['DownArrow', [8595]], ['Downarrow', [8659]], ['DownArrowUpArrow', [8693]], ['DownBreve', [785]], ['downdownarrows', [8650]], ['downharpoonleft', [8643]], ['downharpoonright', [8642]], ['DownLeftRightVector', [10576]], ['DownLeftTeeVector', [10590]], ['DownLeftVectorBar', [10582]], ['DownLeftVector', [8637]], ['DownRightTeeVector', [10591]], ['DownRightVectorBar', [10583]], ['DownRightVector', [8641]], ['DownTeeArrow', [8615]], ['DownTee', [8868]], ['drbkarow', [10512]], ['drcorn', [8991]], ['drcrop', [8972]], ['Dscr', [119967]], ['dscr', [119993]], ['DScy', [1029]], ['dscy', [1109]], ['dsol', [10742]], ['Dstrok', [272]], ['dstrok', [273]], ['dtdot', [8945]], ['dtri', [9663]], ['dtrif', [9662]], ['duarr', [8693]], ['duhar', [10607]], ['dwangle', [10662]], ['DZcy', [1039]], ['dzcy', [1119]], ['dzigrarr', [10239]], ['Eacute', [201]], ['eacute', [233]], ['easter', [10862]], ['Ecaron', [282]], ['ecaron', [283]], ['Ecirc', [202]], ['ecirc', [234]], ['ecir', [8790]], ['ecolon', [8789]], ['Ecy', [1069]], ['ecy', [1101]], ['eDDot', [10871]], ['Edot', [278]], ['edot', [279]], ['eDot', [8785]], ['ee', [8519]], ['efDot', [8786]], ['Efr', [120072]], ['efr', [120098]], ['eg', [10906]], ['Egrave', [200]], ['egrave', [232]], ['egs', [10902]], ['egsdot', [10904]], ['el', [10905]], ['Element', [8712]], ['elinters', [9191]], ['ell', [8467]], ['els', [10901]], ['elsdot', [10903]], ['Emacr', [274]], ['emacr', [275]], ['empty', [8709]], ['emptyset', [8709]], ['EmptySmallSquare', [9723]], ['emptyv', [8709]], ['EmptyVerySmallSquare', [9643]], ['emsp13', [8196]], ['emsp14', [8197]], ['emsp', [8195]], ['ENG', [330]], ['eng', [331]], ['ensp', [8194]], ['Eogon', [280]], ['eogon', [281]], ['Eopf', [120124]], ['eopf', [120150]], ['epar', [8917]], ['eparsl', [10723]], ['eplus', [10865]], ['epsi', [949]], ['Epsilon', [917]], ['epsilon', [949]], ['epsiv', [1013]], ['eqcirc', [8790]], ['eqcolon', [8789]], ['eqsim', [8770]], ['eqslantgtr', [10902]], ['eqslantless', [10901]], ['Equal', [10869]], ['equals', [61]], ['EqualTilde', [8770]], ['equest', [8799]], ['Equilibrium', [8652]], ['equiv', [8801]], ['equivDD', [10872]], ['eqvparsl', [10725]], ['erarr', [10609]], ['erDot', [8787]], ['escr', [8495]], ['Escr', [8496]], ['esdot', [8784]], ['Esim', [10867]], ['esim', [8770]], ['Eta', [919]], ['eta', [951]], ['ETH', [208]], ['eth', [240]], ['Euml', [203]], ['euml', [235]], ['euro', [8364]], ['excl', [33]], ['exist', [8707]], ['Exists', [8707]], ['expectation', [8496]], ['exponentiale', [8519]], ['ExponentialE', [8519]], ['fallingdotseq', [8786]], ['Fcy', [1060]], ['fcy', [1092]], ['female', [9792]], ['ffilig', [64259]], ['fflig', [64256]], ['ffllig', [64260]], ['Ffr', [120073]], ['ffr', [120099]], ['filig', [64257]], ['FilledSmallSquare', [9724]], ['FilledVerySmallSquare', [9642]], ['fjlig', [102, 106]], ['flat', [9837]], ['fllig', [64258]], ['fltns', [9649]], ['fnof', [402]], ['Fopf', [120125]], ['fopf', [120151]], ['forall', [8704]], ['ForAll', [8704]], ['fork', [8916]], ['forkv', [10969]], ['Fouriertrf', [8497]], ['fpartint', [10765]], ['frac12', [189]], ['frac13', [8531]], ['frac14', [188]], ['frac15', [8533]], ['frac16', [8537]], ['frac18', [8539]], ['frac23', [8532]], ['frac25', [8534]], ['frac34', [190]], ['frac35', [8535]], ['frac38', [8540]], ['frac45', [8536]], ['frac56', [8538]], ['frac58', [8541]], ['frac78', [8542]], ['frasl', [8260]], ['frown', [8994]], ['fscr', [119995]], ['Fscr', [8497]], ['gacute', [501]], ['Gamma', [915]], ['gamma', [947]], ['Gammad', [988]], ['gammad', [989]], ['gap', [10886]], ['Gbreve', [286]], ['gbreve', [287]], ['Gcedil', [290]], ['Gcirc', [284]], ['gcirc', [285]], ['Gcy', [1043]], ['gcy', [1075]], ['Gdot', [288]], ['gdot', [289]], ['ge', [8805]], ['gE', [8807]], ['gEl', [10892]], ['gel', [8923]], ['geq', [8805]], ['geqq', [8807]], ['geqslant', [10878]], ['gescc', [10921]], ['ges', [10878]], ['gesdot', [10880]], ['gesdoto', [10882]], ['gesdotol', [10884]], ['gesl', [8923, 65024]], ['gesles', [10900]], ['Gfr', [120074]], ['gfr', [120100]], ['gg', [8811]], ['Gg', [8921]], ['ggg', [8921]], ['gimel', [8503]], ['GJcy', [1027]], ['gjcy', [1107]], ['gla', [10917]], ['gl', [8823]], ['glE', [10898]], ['glj', [10916]], ['gnap', [10890]], ['gnapprox', [10890]], ['gne', [10888]], ['gnE', [8809]], ['gneq', [10888]], ['gneqq', [8809]], ['gnsim', [8935]], ['Gopf', [120126]], ['gopf', [120152]], ['grave', [96]], ['GreaterEqual', [8805]], ['GreaterEqualLess', [8923]], ['GreaterFullEqual', [8807]], ['GreaterGreater', [10914]], ['GreaterLess', [8823]], ['GreaterSlantEqual', [10878]], ['GreaterTilde', [8819]], ['Gscr', [119970]], ['gscr', [8458]], ['gsim', [8819]], ['gsime', [10894]], ['gsiml', [10896]], ['gtcc', [10919]], ['gtcir', [10874]], ['gt', [62]], ['GT', [62]], ['Gt', [8811]], ['gtdot', [8919]], ['gtlPar', [10645]], ['gtquest', [10876]], ['gtrapprox', [10886]], ['gtrarr', [10616]], ['gtrdot', [8919]], ['gtreqless', [8923]], ['gtreqqless', [10892]], ['gtrless', [8823]], ['gtrsim', [8819]], ['gvertneqq', [8809, 65024]], ['gvnE', [8809, 65024]], ['Hacek', [711]], ['hairsp', [8202]], ['half', [189]], ['hamilt', [8459]], ['HARDcy', [1066]], ['hardcy', [1098]], ['harrcir', [10568]], ['harr', [8596]], ['hArr', [8660]], ['harrw', [8621]], ['Hat', [94]], ['hbar', [8463]], ['Hcirc', [292]], ['hcirc', [293]], ['hearts', [9829]], ['heartsuit', [9829]], ['hellip', [8230]], ['hercon', [8889]], ['hfr', [120101]], ['Hfr', [8460]], ['HilbertSpace', [8459]], ['hksearow', [10533]], ['hkswarow', [10534]], ['hoarr', [8703]], ['homtht', [8763]], ['hookleftarrow', [8617]], ['hookrightarrow', [8618]], ['hopf', [120153]], ['Hopf', [8461]], ['horbar', [8213]], ['HorizontalLine', [9472]], ['hscr', [119997]], ['Hscr', [8459]], ['hslash', [8463]], ['Hstrok', [294]], ['hstrok', [295]], ['HumpDownHump', [8782]], ['HumpEqual', [8783]], ['hybull', [8259]], ['hyphen', [8208]], ['Iacute', [205]], ['iacute', [237]], ['ic', [8291]], ['Icirc', [206]], ['icirc', [238]], ['Icy', [1048]], ['icy', [1080]], ['Idot', [304]], ['IEcy', [1045]], ['iecy', [1077]], ['iexcl', [161]], ['iff', [8660]], ['ifr', [120102]], ['Ifr', [8465]], ['Igrave', [204]], ['igrave', [236]], ['ii', [8520]], ['iiiint', [10764]], ['iiint', [8749]], ['iinfin', [10716]], ['iiota', [8489]], ['IJlig', [306]], ['ijlig', [307]], ['Imacr', [298]], ['imacr', [299]], ['image', [8465]], ['ImaginaryI', [8520]], ['imagline', [8464]], ['imagpart', [8465]], ['imath', [305]], ['Im', [8465]], ['imof', [8887]], ['imped', [437]], ['Implies', [8658]], ['incare', [8453]], ['in', [8712]], ['infin', [8734]], ['infintie', [10717]], ['inodot', [305]], ['intcal', [8890]], ['int', [8747]], ['Int', [8748]], ['integers', [8484]], ['Integral', [8747]], ['intercal', [8890]], ['Intersection', [8898]], ['intlarhk', [10775]], ['intprod', [10812]], ['InvisibleComma', [8291]], ['InvisibleTimes', [8290]], ['IOcy', [1025]], ['iocy', [1105]], ['Iogon', [302]], ['iogon', [303]], ['Iopf', [120128]], ['iopf', [120154]], ['Iota', [921]], ['iota', [953]], ['iprod', [10812]], ['iquest', [191]], ['iscr', [119998]], ['Iscr', [8464]], ['isin', [8712]], ['isindot', [8949]], ['isinE', [8953]], ['isins', [8948]], ['isinsv', [8947]], ['isinv', [8712]], ['it', [8290]], ['Itilde', [296]], ['itilde', [297]], ['Iukcy', [1030]], ['iukcy', [1110]], ['Iuml', [207]], ['iuml', [239]], ['Jcirc', [308]], ['jcirc', [309]], ['Jcy', [1049]], ['jcy', [1081]], ['Jfr', [120077]], ['jfr', [120103]], ['jmath', [567]], ['Jopf', [120129]], ['jopf', [120155]], ['Jscr', [119973]], ['jscr', [119999]], ['Jsercy', [1032]], ['jsercy', [1112]], ['Jukcy', [1028]], ['jukcy', [1108]], ['Kappa', [922]], ['kappa', [954]], ['kappav', [1008]], ['Kcedil', [310]], ['kcedil', [311]], ['Kcy', [1050]], ['kcy', [1082]], ['Kfr', [120078]], ['kfr', [120104]], ['kgreen', [312]], ['KHcy', [1061]], ['khcy', [1093]], ['KJcy', [1036]], ['kjcy', [1116]], ['Kopf', [120130]], ['kopf', [120156]], ['Kscr', [119974]], ['kscr', [120000]], ['lAarr', [8666]], ['Lacute', [313]], ['lacute', [314]], ['laemptyv', [10676]], ['lagran', [8466]], ['Lambda', [923]], ['lambda', [955]], ['lang', [10216]], ['Lang', [10218]], ['langd', [10641]], ['langle', [10216]], ['lap', [10885]], ['Laplacetrf', [8466]], ['laquo', [171]], ['larrb', [8676]], ['larrbfs', [10527]], ['larr', [8592]], ['Larr', [8606]], ['lArr', [8656]], ['larrfs', [10525]], ['larrhk', [8617]], ['larrlp', [8619]], ['larrpl', [10553]], ['larrsim', [10611]], ['larrtl', [8610]], ['latail', [10521]], ['lAtail', [10523]], ['lat', [10923]], ['late', [10925]], ['lates', [10925, 65024]], ['lbarr', [10508]], ['lBarr', [10510]], ['lbbrk', [10098]], ['lbrace', [123]], ['lbrack', [91]], ['lbrke', [10635]], ['lbrksld', [10639]], ['lbrkslu', [10637]], ['Lcaron', [317]], ['lcaron', [318]], ['Lcedil', [315]], ['lcedil', [316]], ['lceil', [8968]], ['lcub', [123]], ['Lcy', [1051]], ['lcy', [1083]], ['ldca', [10550]], ['ldquo', [8220]], ['ldquor', [8222]], ['ldrdhar', [10599]], ['ldrushar', [10571]], ['ldsh', [8626]], ['le', [8804]], ['lE', [8806]], ['LeftAngleBracket', [10216]], ['LeftArrowBar', [8676]], ['leftarrow', [8592]], ['LeftArrow', [8592]], ['Leftarrow', [8656]], ['LeftArrowRightArrow', [8646]], ['leftarrowtail', [8610]], ['LeftCeiling', [8968]], ['LeftDoubleBracket', [10214]], ['LeftDownTeeVector', [10593]], ['LeftDownVectorBar', [10585]], ['LeftDownVector', [8643]], ['LeftFloor', [8970]], ['leftharpoondown', [8637]], ['leftharpoonup', [8636]], ['leftleftarrows', [8647]], ['leftrightarrow', [8596]], ['LeftRightArrow', [8596]], ['Leftrightarrow', [8660]], ['leftrightarrows', [8646]], ['leftrightharpoons', [8651]], ['leftrightsquigarrow', [8621]], ['LeftRightVector', [10574]], ['LeftTeeArrow', [8612]], ['LeftTee', [8867]], ['LeftTeeVector', [10586]], ['leftthreetimes', [8907]], ['LeftTriangleBar', [10703]], ['LeftTriangle', [8882]], ['LeftTriangleEqual', [8884]], ['LeftUpDownVector', [10577]], ['LeftUpTeeVector', [10592]], ['LeftUpVectorBar', [10584]], ['LeftUpVector', [8639]], ['LeftVectorBar', [10578]], ['LeftVector', [8636]], ['lEg', [10891]], ['leg', [8922]], ['leq', [8804]], ['leqq', [8806]], ['leqslant', [10877]], ['lescc', [10920]], ['les', [10877]], ['lesdot', [10879]], ['lesdoto', [10881]], ['lesdotor', [10883]], ['lesg', [8922, 65024]], ['lesges', [10899]], ['lessapprox', [10885]], ['lessdot', [8918]], ['lesseqgtr', [8922]], ['lesseqqgtr', [10891]], ['LessEqualGreater', [8922]], ['LessFullEqual', [8806]], ['LessGreater', [8822]], ['lessgtr', [8822]], ['LessLess', [10913]], ['lesssim', [8818]], ['LessSlantEqual', [10877]], ['LessTilde', [8818]], ['lfisht', [10620]], ['lfloor', [8970]], ['Lfr', [120079]], ['lfr', [120105]], ['lg', [8822]], ['lgE', [10897]], ['lHar', [10594]], ['lhard', [8637]], ['lharu', [8636]], ['lharul', [10602]], ['lhblk', [9604]], ['LJcy', [1033]], ['ljcy', [1113]], ['llarr', [8647]], ['ll', [8810]], ['Ll', [8920]], ['llcorner', [8990]], ['Lleftarrow', [8666]], ['llhard', [10603]], ['lltri', [9722]], ['Lmidot', [319]], ['lmidot', [320]], ['lmoustache', [9136]], ['lmoust', [9136]], ['lnap', [10889]], ['lnapprox', [10889]], ['lne', [10887]], ['lnE', [8808]], ['lneq', [10887]], ['lneqq', [8808]], ['lnsim', [8934]], ['loang', [10220]], ['loarr', [8701]], ['lobrk', [10214]], ['longleftarrow', [10229]], ['LongLeftArrow', [10229]], ['Longleftarrow', [10232]], ['longleftrightarrow', [10231]], ['LongLeftRightArrow', [10231]], ['Longleftrightarrow', [10234]], ['longmapsto', [10236]], ['longrightarrow', [10230]], ['LongRightArrow', [10230]], ['Longrightarrow', [10233]], ['looparrowleft', [8619]], ['looparrowright', [8620]], ['lopar', [10629]], ['Lopf', [120131]], ['lopf', [120157]], ['loplus', [10797]], ['lotimes', [10804]], ['lowast', [8727]], ['lowbar', [95]], ['LowerLeftArrow', [8601]], ['LowerRightArrow', [8600]], ['loz', [9674]], ['lozenge', [9674]], ['lozf', [10731]], ['lpar', [40]], ['lparlt', [10643]], ['lrarr', [8646]], ['lrcorner', [8991]], ['lrhar', [8651]], ['lrhard', [10605]], ['lrm', [8206]], ['lrtri', [8895]], ['lsaquo', [8249]], ['lscr', [120001]], ['Lscr', [8466]], ['lsh', [8624]], ['Lsh', [8624]], ['lsim', [8818]], ['lsime', [10893]], ['lsimg', [10895]], ['lsqb', [91]], ['lsquo', [8216]], ['lsquor', [8218]], ['Lstrok', [321]], ['lstrok', [322]], ['ltcc', [10918]], ['ltcir', [10873]], ['lt', [60]], ['LT', [60]], ['Lt', [8810]], ['ltdot', [8918]], ['lthree', [8907]], ['ltimes', [8905]], ['ltlarr', [10614]], ['ltquest', [10875]], ['ltri', [9667]], ['ltrie', [8884]], ['ltrif', [9666]], ['ltrPar', [10646]], ['lurdshar', [10570]], ['luruhar', [10598]], ['lvertneqq', [8808, 65024]], ['lvnE', [8808, 65024]], ['macr', [175]], ['male', [9794]], ['malt', [10016]], ['maltese', [10016]], ['Map', [10501]], ['map', [8614]], ['mapsto', [8614]], ['mapstodown', [8615]], ['mapstoleft', [8612]], ['mapstoup', [8613]], ['marker', [9646]], ['mcomma', [10793]], ['Mcy', [1052]], ['mcy', [1084]], ['mdash', [8212]], ['mDDot', [8762]], ['measuredangle', [8737]], ['MediumSpace', [8287]], ['Mellintrf', [8499]], ['Mfr', [120080]], ['mfr', [120106]], ['mho', [8487]], ['micro', [181]], ['midast', [42]], ['midcir', [10992]], ['mid', [8739]], ['middot', [183]], ['minusb', [8863]], ['minus', [8722]], ['minusd', [8760]], ['minusdu', [10794]], ['MinusPlus', [8723]], ['mlcp', [10971]], ['mldr', [8230]], ['mnplus', [8723]], ['models', [8871]], ['Mopf', [120132]], ['mopf', [120158]], ['mp', [8723]], ['mscr', [120002]], ['Mscr', [8499]], ['mstpos', [8766]], ['Mu', [924]], ['mu', [956]], ['multimap', [8888]], ['mumap', [8888]], ['nabla', [8711]], ['Nacute', [323]], ['nacute', [324]], ['nang', [8736, 8402]], ['nap', [8777]], ['napE', [10864, 824]], ['napid', [8779, 824]], ['napos', [329]], ['napprox', [8777]], ['natural', [9838]], ['naturals', [8469]], ['natur', [9838]], ['nbsp', [160]], ['nbump', [8782, 824]], ['nbumpe', [8783, 824]], ['ncap', [10819]], ['Ncaron', [327]], ['ncaron', [328]], ['Ncedil', [325]], ['ncedil', [326]], ['ncong', [8775]], ['ncongdot', [10861, 824]], ['ncup', [10818]], ['Ncy', [1053]], ['ncy', [1085]], ['ndash', [8211]], ['nearhk', [10532]], ['nearr', [8599]], ['neArr', [8663]], ['nearrow', [8599]], ['ne', [8800]], ['nedot', [8784, 824]], ['NegativeMediumSpace', [8203]], ['NegativeThickSpace', [8203]], ['NegativeThinSpace', [8203]], ['NegativeVeryThinSpace', [8203]], ['nequiv', [8802]], ['nesear', [10536]], ['nesim', [8770, 824]], ['NestedGreaterGreater', [8811]], ['NestedLessLess', [8810]], ['nexist', [8708]], ['nexists', [8708]], ['Nfr', [120081]], ['nfr', [120107]], ['ngE', [8807, 824]], ['nge', [8817]], ['ngeq', [8817]], ['ngeqq', [8807, 824]], ['ngeqslant', [10878, 824]], ['nges', [10878, 824]], ['nGg', [8921, 824]], ['ngsim', [8821]], ['nGt', [8811, 8402]], ['ngt', [8815]], ['ngtr', [8815]], ['nGtv', [8811, 824]], ['nharr', [8622]], ['nhArr', [8654]], ['nhpar', [10994]], ['ni', [8715]], ['nis', [8956]], ['nisd', [8954]], ['niv', [8715]], ['NJcy', [1034]], ['njcy', [1114]], ['nlarr', [8602]], ['nlArr', [8653]], ['nldr', [8229]], ['nlE', [8806, 824]], ['nle', [8816]], ['nleftarrow', [8602]], ['nLeftarrow', [8653]], ['nleftrightarrow', [8622]], ['nLeftrightarrow', [8654]], ['nleq', [8816]], ['nleqq', [8806, 824]], ['nleqslant', [10877, 824]], ['nles', [10877, 824]], ['nless', [8814]], ['nLl', [8920, 824]], ['nlsim', [8820]], ['nLt', [8810, 8402]], ['nlt', [8814]], ['nltri', [8938]], ['nltrie', [8940]], ['nLtv', [8810, 824]], ['nmid', [8740]], ['NoBreak', [8288]], ['NonBreakingSpace', [160]], ['nopf', [120159]], ['Nopf', [8469]], ['Not', [10988]], ['not', [172]], ['NotCongruent', [8802]], ['NotCupCap', [8813]], ['NotDoubleVerticalBar', [8742]], ['NotElement', [8713]], ['NotEqual', [8800]], ['NotEqualTilde', [8770, 824]], ['NotExists', [8708]], ['NotGreater', [8815]], ['NotGreaterEqual', [8817]], ['NotGreaterFullEqual', [8807, 824]], ['NotGreaterGreater', [8811, 824]], ['NotGreaterLess', [8825]], ['NotGreaterSlantEqual', [10878, 824]], ['NotGreaterTilde', [8821]], ['NotHumpDownHump', [8782, 824]], ['NotHumpEqual', [8783, 824]], ['notin', [8713]], ['notindot', [8949, 824]], ['notinE', [8953, 824]], ['notinva', [8713]], ['notinvb', [8951]], ['notinvc', [8950]], ['NotLeftTriangleBar', [10703, 824]], ['NotLeftTriangle', [8938]], ['NotLeftTriangleEqual', [8940]], ['NotLess', [8814]], ['NotLessEqual', [8816]], ['NotLessGreater', [8824]], ['NotLessLess', [8810, 824]], ['NotLessSlantEqual', [10877, 824]], ['NotLessTilde', [8820]], ['NotNestedGreaterGreater', [10914, 824]], ['NotNestedLessLess', [10913, 824]], ['notni', [8716]], ['notniva', [8716]], ['notnivb', [8958]], ['notnivc', [8957]], ['NotPrecedes', [8832]], ['NotPrecedesEqual', [10927, 824]], ['NotPrecedesSlantEqual', [8928]], ['NotReverseElement', [8716]], ['NotRightTriangleBar', [10704, 824]], ['NotRightTriangle', [8939]], ['NotRightTriangleEqual', [8941]], ['NotSquareSubset', [8847, 824]], ['NotSquareSubsetEqual', [8930]], ['NotSquareSuperset', [8848, 824]], ['NotSquareSupersetEqual', [8931]], ['NotSubset', [8834, 8402]], ['NotSubsetEqual', [8840]], ['NotSucceeds', [8833]], ['NotSucceedsEqual', [10928, 824]], ['NotSucceedsSlantEqual', [8929]], ['NotSucceedsTilde', [8831, 824]], ['NotSuperset', [8835, 8402]], ['NotSupersetEqual', [8841]], ['NotTilde', [8769]], ['NotTildeEqual', [8772]], ['NotTildeFullEqual', [8775]], ['NotTildeTilde', [8777]], ['NotVerticalBar', [8740]], ['nparallel', [8742]], ['npar', [8742]], ['nparsl', [11005, 8421]], ['npart', [8706, 824]], ['npolint', [10772]], ['npr', [8832]], ['nprcue', [8928]], ['nprec', [8832]], ['npreceq', [10927, 824]], ['npre', [10927, 824]], ['nrarrc', [10547, 824]], ['nrarr', [8603]], ['nrArr', [8655]], ['nrarrw', [8605, 824]], ['nrightarrow', [8603]], ['nRightarrow', [8655]], ['nrtri', [8939]], ['nrtrie', [8941]], ['nsc', [8833]], ['nsccue', [8929]], ['nsce', [10928, 824]], ['Nscr', [119977]], ['nscr', [120003]], ['nshortmid', [8740]], ['nshortparallel', [8742]], ['nsim', [8769]], ['nsime', [8772]], ['nsimeq', [8772]], ['nsmid', [8740]], ['nspar', [8742]], ['nsqsube', [8930]], ['nsqsupe', [8931]], ['nsub', [8836]], ['nsubE', [10949, 824]], ['nsube', [8840]], ['nsubset', [8834, 8402]], ['nsubseteq', [8840]], ['nsubseteqq', [10949, 824]], ['nsucc', [8833]], ['nsucceq', [10928, 824]], ['nsup', [8837]], ['nsupE', [10950, 824]], ['nsupe', [8841]], ['nsupset', [8835, 8402]], ['nsupseteq', [8841]], ['nsupseteqq', [10950, 824]], ['ntgl', [8825]], ['Ntilde', [209]], ['ntilde', [241]], ['ntlg', [8824]], ['ntriangleleft', [8938]], ['ntrianglelefteq', [8940]], ['ntriangleright', [8939]], ['ntrianglerighteq', [8941]], ['Nu', [925]], ['nu', [957]], ['num', [35]], ['numero', [8470]], ['numsp', [8199]], ['nvap', [8781, 8402]], ['nvdash', [8876]], ['nvDash', [8877]], ['nVdash', [8878]], ['nVDash', [8879]], ['nvge', [8805, 8402]], ['nvgt', [62, 8402]], ['nvHarr', [10500]], ['nvinfin', [10718]], ['nvlArr', [10498]], ['nvle', [8804, 8402]], ['nvlt', [60, 8402]], ['nvltrie', [8884, 8402]], ['nvrArr', [10499]], ['nvrtrie', [8885, 8402]], ['nvsim', [8764, 8402]], ['nwarhk', [10531]], ['nwarr', [8598]], ['nwArr', [8662]], ['nwarrow', [8598]], ['nwnear', [10535]], ['Oacute', [211]], ['oacute', [243]], ['oast', [8859]], ['Ocirc', [212]], ['ocirc', [244]], ['ocir', [8858]], ['Ocy', [1054]], ['ocy', [1086]], ['odash', [8861]], ['Odblac', [336]], ['odblac', [337]], ['odiv', [10808]], ['odot', [8857]], ['odsold', [10684]], ['OElig', [338]], ['oelig', [339]], ['ofcir', [10687]], ['Ofr', [120082]], ['ofr', [120108]], ['ogon', [731]], ['Ograve', [210]], ['ograve', [242]], ['ogt', [10689]], ['ohbar', [10677]], ['ohm', [937]], ['oint', [8750]], ['olarr', [8634]], ['olcir', [10686]], ['olcross', [10683]], ['oline', [8254]], ['olt', [10688]], ['Omacr', [332]], ['omacr', [333]], ['Omega', [937]], ['omega', [969]], ['Omicron', [927]], ['omicron', [959]], ['omid', [10678]], ['ominus', [8854]], ['Oopf', [120134]], ['oopf', [120160]], ['opar', [10679]], ['OpenCurlyDoubleQuote', [8220]], ['OpenCurlyQuote', [8216]], ['operp', [10681]], ['oplus', [8853]], ['orarr', [8635]], ['Or', [10836]], ['or', [8744]], ['ord', [10845]], ['order', [8500]], ['orderof', [8500]], ['ordf', [170]], ['ordm', [186]], ['origof', [8886]], ['oror', [10838]], ['orslope', [10839]], ['orv', [10843]], ['oS', [9416]], ['Oscr', [119978]], ['oscr', [8500]], ['Oslash', [216]], ['oslash', [248]], ['osol', [8856]], ['Otilde', [213]], ['otilde', [245]], ['otimesas', [10806]], ['Otimes', [10807]], ['otimes', [8855]], ['Ouml', [214]], ['ouml', [246]], ['ovbar', [9021]], ['OverBar', [8254]], ['OverBrace', [9182]], ['OverBracket', [9140]], ['OverParenthesis', [9180]], ['para', [182]], ['parallel', [8741]], ['par', [8741]], ['parsim', [10995]], ['parsl', [11005]], ['part', [8706]], ['PartialD', [8706]], ['Pcy', [1055]], ['pcy', [1087]], ['percnt', [37]], ['period', [46]], ['permil', [8240]], ['perp', [8869]], ['pertenk', [8241]], ['Pfr', [120083]], ['pfr', [120109]], ['Phi', [934]], ['phi', [966]], ['phiv', [981]], ['phmmat', [8499]], ['phone', [9742]], ['Pi', [928]], ['pi', [960]], ['pitchfork', [8916]], ['piv', [982]], ['planck', [8463]], ['planckh', [8462]], ['plankv', [8463]], ['plusacir', [10787]], ['plusb', [8862]], ['pluscir', [10786]], ['plus', [43]], ['plusdo', [8724]], ['plusdu', [10789]], ['pluse', [10866]], ['PlusMinus', [177]], ['plusmn', [177]], ['plussim', [10790]], ['plustwo', [10791]], ['pm', [177]], ['Poincareplane', [8460]], ['pointint', [10773]], ['popf', [120161]], ['Popf', [8473]], ['pound', [163]], ['prap', [10935]], ['Pr', [10939]], ['pr', [8826]], ['prcue', [8828]], ['precapprox', [10935]], ['prec', [8826]], ['preccurlyeq', [8828]], ['Precedes', [8826]], ['PrecedesEqual', [10927]], ['PrecedesSlantEqual', [8828]], ['PrecedesTilde', [8830]], ['preceq', [10927]], ['precnapprox', [10937]], ['precneqq', [10933]], ['precnsim', [8936]], ['pre', [10927]], ['prE', [10931]], ['precsim', [8830]], ['prime', [8242]], ['Prime', [8243]], ['primes', [8473]], ['prnap', [10937]], ['prnE', [10933]], ['prnsim', [8936]], ['prod', [8719]], ['Product', [8719]], ['profalar', [9006]], ['profline', [8978]], ['profsurf', [8979]], ['prop', [8733]], ['Proportional', [8733]], ['Proportion', [8759]], ['propto', [8733]], ['prsim', [8830]], ['prurel', [8880]], ['Pscr', [119979]], ['pscr', [120005]], ['Psi', [936]], ['psi', [968]], ['puncsp', [8200]], ['Qfr', [120084]], ['qfr', [120110]], ['qint', [10764]], ['qopf', [120162]], ['Qopf', [8474]], ['qprime', [8279]], ['Qscr', [119980]], ['qscr', [120006]], ['quaternions', [8461]], ['quatint', [10774]], ['quest', [63]], ['questeq', [8799]], ['quot', [34]], ['QUOT', [34]], ['rAarr', [8667]], ['race', [8765, 817]], ['Racute', [340]], ['racute', [341]], ['radic', [8730]], ['raemptyv', [10675]], ['rang', [10217]], ['Rang', [10219]], ['rangd', [10642]], ['range', [10661]], ['rangle', [10217]], ['raquo', [187]], ['rarrap', [10613]], ['rarrb', [8677]], ['rarrbfs', [10528]], ['rarrc', [10547]], ['rarr', [8594]], ['Rarr', [8608]], ['rArr', [8658]], ['rarrfs', [10526]], ['rarrhk', [8618]], ['rarrlp', [8620]], ['rarrpl', [10565]], ['rarrsim', [10612]], ['Rarrtl', [10518]], ['rarrtl', [8611]], ['rarrw', [8605]], ['ratail', [10522]], ['rAtail', [10524]], ['ratio', [8758]], ['rationals', [8474]], ['rbarr', [10509]], ['rBarr', [10511]], ['RBarr', [10512]], ['rbbrk', [10099]], ['rbrace', [125]], ['rbrack', [93]], ['rbrke', [10636]], ['rbrksld', [10638]], ['rbrkslu', [10640]], ['Rcaron', [344]], ['rcaron', [345]], ['Rcedil', [342]], ['rcedil', [343]], ['rceil', [8969]], ['rcub', [125]], ['Rcy', [1056]], ['rcy', [1088]], ['rdca', [10551]], ['rdldhar', [10601]], ['rdquo', [8221]], ['rdquor', [8221]], ['CloseCurlyDoubleQuote', [8221]], ['rdsh', [8627]], ['real', [8476]], ['realine', [8475]], ['realpart', [8476]], ['reals', [8477]], ['Re', [8476]], ['rect', [9645]], ['reg', [174]], ['REG', [174]], ['ReverseElement', [8715]], ['ReverseEquilibrium', [8651]], ['ReverseUpEquilibrium', [10607]], ['rfisht', [10621]], ['rfloor', [8971]], ['rfr', [120111]], ['Rfr', [8476]], ['rHar', [10596]], ['rhard', [8641]], ['rharu', [8640]], ['rharul', [10604]], ['Rho', [929]], ['rho', [961]], ['rhov', [1009]], ['RightAngleBracket', [10217]], ['RightArrowBar', [8677]], ['rightarrow', [8594]], ['RightArrow', [8594]], ['Rightarrow', [8658]], ['RightArrowLeftArrow', [8644]], ['rightarrowtail', [8611]], ['RightCeiling', [8969]], ['RightDoubleBracket', [10215]], ['RightDownTeeVector', [10589]], ['RightDownVectorBar', [10581]], ['RightDownVector', [8642]], ['RightFloor', [8971]], ['rightharpoondown', [8641]], ['rightharpoonup', [8640]], ['rightleftarrows', [8644]], ['rightleftharpoons', [8652]], ['rightrightarrows', [8649]], ['rightsquigarrow', [8605]], ['RightTeeArrow', [8614]], ['RightTee', [8866]], ['RightTeeVector', [10587]], ['rightthreetimes', [8908]], ['RightTriangleBar', [10704]], ['RightTriangle', [8883]], ['RightTriangleEqual', [8885]], ['RightUpDownVector', [10575]], ['RightUpTeeVector', [10588]], ['RightUpVectorBar', [10580]], ['RightUpVector', [8638]], ['RightVectorBar', [10579]], ['RightVector', [8640]], ['ring', [730]], ['risingdotseq', [8787]], ['rlarr', [8644]], ['rlhar', [8652]], ['rlm', [8207]], ['rmoustache', [9137]], ['rmoust', [9137]], ['rnmid', [10990]], ['roang', [10221]], ['roarr', [8702]], ['robrk', [10215]], ['ropar', [10630]], ['ropf', [120163]], ['Ropf', [8477]], ['roplus', [10798]], ['rotimes', [10805]], ['RoundImplies', [10608]], ['rpar', [41]], ['rpargt', [10644]], ['rppolint', [10770]], ['rrarr', [8649]], ['Rrightarrow', [8667]], ['rsaquo', [8250]], ['rscr', [120007]], ['Rscr', [8475]], ['rsh', [8625]], ['Rsh', [8625]], ['rsqb', [93]], ['rsquo', [8217]], ['rsquor', [8217]], ['CloseCurlyQuote', [8217]], ['rthree', [8908]], ['rtimes', [8906]], ['rtri', [9657]], ['rtrie', [8885]], ['rtrif', [9656]], ['rtriltri', [10702]], ['RuleDelayed', [10740]], ['ruluhar', [10600]], ['rx', [8478]], ['Sacute', [346]], ['sacute', [347]], ['sbquo', [8218]], ['scap', [10936]], ['Scaron', [352]], ['scaron', [353]], ['Sc', [10940]], ['sc', [8827]], ['sccue', [8829]], ['sce', [10928]], ['scE', [10932]], ['Scedil', [350]], ['scedil', [351]], ['Scirc', [348]], ['scirc', [349]], ['scnap', [10938]], ['scnE', [10934]], ['scnsim', [8937]], ['scpolint', [10771]], ['scsim', [8831]], ['Scy', [1057]], ['scy', [1089]], ['sdotb', [8865]], ['sdot', [8901]], ['sdote', [10854]], ['searhk', [10533]], ['searr', [8600]], ['seArr', [8664]], ['searrow', [8600]], ['sect', [167]], ['semi', [59]], ['seswar', [10537]], ['setminus', [8726]], ['setmn', [8726]], ['sext', [10038]], ['Sfr', [120086]], ['sfr', [120112]], ['sfrown', [8994]], ['sharp', [9839]], ['SHCHcy', [1065]], ['shchcy', [1097]], ['SHcy', [1064]], ['shcy', [1096]], ['ShortDownArrow', [8595]], ['ShortLeftArrow', [8592]], ['shortmid', [8739]], ['shortparallel', [8741]], ['ShortRightArrow', [8594]], ['ShortUpArrow', [8593]], ['shy', [173]], ['Sigma', [931]], ['sigma', [963]], ['sigmaf', [962]], ['sigmav', [962]], ['sim', [8764]], ['simdot', [10858]], ['sime', [8771]], ['simeq', [8771]], ['simg', [10910]], ['simgE', [10912]], ['siml', [10909]], ['simlE', [10911]], ['simne', [8774]], ['simplus', [10788]], ['simrarr', [10610]], ['slarr', [8592]], ['SmallCircle', [8728]], ['smallsetminus', [8726]], ['smashp', [10803]], ['smeparsl', [10724]], ['smid', [8739]], ['smile', [8995]], ['smt', [10922]], ['smte', [10924]], ['smtes', [10924, 65024]], ['SOFTcy', [1068]], ['softcy', [1100]], ['solbar', [9023]], ['solb', [10692]], ['sol', [47]], ['Sopf', [120138]], ['sopf', [120164]], ['spades', [9824]], ['spadesuit', [9824]], ['spar', [8741]], ['sqcap', [8851]], ['sqcaps', [8851, 65024]], ['sqcup', [8852]], ['sqcups', [8852, 65024]], ['Sqrt', [8730]], ['sqsub', [8847]], ['sqsube', [8849]], ['sqsubset', [8847]], ['sqsubseteq', [8849]], ['sqsup', [8848]], ['sqsupe', [8850]], ['sqsupset', [8848]], ['sqsupseteq', [8850]], ['square', [9633]], ['Square', [9633]], ['SquareIntersection', [8851]], ['SquareSubset', [8847]], ['SquareSubsetEqual', [8849]], ['SquareSuperset', [8848]], ['SquareSupersetEqual', [8850]], ['SquareUnion', [8852]], ['squarf', [9642]], ['squ', [9633]], ['squf', [9642]], ['srarr', [8594]], ['Sscr', [119982]], ['sscr', [120008]], ['ssetmn', [8726]], ['ssmile', [8995]], ['sstarf', [8902]], ['Star', [8902]], ['star', [9734]], ['starf', [9733]], ['straightepsilon', [1013]], ['straightphi', [981]], ['strns', [175]], ['sub', [8834]], ['Sub', [8912]], ['subdot', [10941]], ['subE', [10949]], ['sube', [8838]], ['subedot', [10947]], ['submult', [10945]], ['subnE', [10955]], ['subne', [8842]], ['subplus', [10943]], ['subrarr', [10617]], ['subset', [8834]], ['Subset', [8912]], ['subseteq', [8838]], ['subseteqq', [10949]], ['SubsetEqual', [8838]], ['subsetneq', [8842]], ['subsetneqq', [10955]], ['subsim', [10951]], ['subsub', [10965]], ['subsup', [10963]], ['succapprox', [10936]], ['succ', [8827]], ['succcurlyeq', [8829]], ['Succeeds', [8827]], ['SucceedsEqual', [10928]], ['SucceedsSlantEqual', [8829]], ['SucceedsTilde', [8831]], ['succeq', [10928]], ['succnapprox', [10938]], ['succneqq', [10934]], ['succnsim', [8937]], ['succsim', [8831]], ['SuchThat', [8715]], ['sum', [8721]], ['Sum', [8721]], ['sung', [9834]], ['sup1', [185]], ['sup2', [178]], ['sup3', [179]], ['sup', [8835]], ['Sup', [8913]], ['supdot', [10942]], ['supdsub', [10968]], ['supE', [10950]], ['supe', [8839]], ['supedot', [10948]], ['Superset', [8835]], ['SupersetEqual', [8839]], ['suphsol', [10185]], ['suphsub', [10967]], ['suplarr', [10619]], ['supmult', [10946]], ['supnE', [10956]], ['supne', [8843]], ['supplus', [10944]], ['supset', [8835]], ['Supset', [8913]], ['supseteq', [8839]], ['supseteqq', [10950]], ['supsetneq', [8843]], ['supsetneqq', [10956]], ['supsim', [10952]], ['supsub', [10964]], ['supsup', [10966]], ['swarhk', [10534]], ['swarr', [8601]], ['swArr', [8665]], ['swarrow', [8601]], ['swnwar', [10538]], ['szlig', [223]], ['Tab', [9]], ['target', [8982]], ['Tau', [932]], ['tau', [964]], ['tbrk', [9140]], ['Tcaron', [356]], ['tcaron', [357]], ['Tcedil', [354]], ['tcedil', [355]], ['Tcy', [1058]], ['tcy', [1090]], ['tdot', [8411]], ['telrec', [8981]], ['Tfr', [120087]], ['tfr', [120113]], ['there4', [8756]], ['therefore', [8756]], ['Therefore', [8756]], ['Theta', [920]], ['theta', [952]], ['thetasym', [977]], ['thetav', [977]], ['thickapprox', [8776]], ['thicksim', [8764]], ['ThickSpace', [8287, 8202]], ['ThinSpace', [8201]], ['thinsp', [8201]], ['thkap', [8776]], ['thksim', [8764]], ['THORN', [222]], ['thorn', [254]], ['tilde', [732]], ['Tilde', [8764]], ['TildeEqual', [8771]], ['TildeFullEqual', [8773]], ['TildeTilde', [8776]], ['timesbar', [10801]], ['timesb', [8864]], ['times', [215]], ['timesd', [10800]], ['tint', [8749]], ['toea', [10536]], ['topbot', [9014]], ['topcir', [10993]], ['top', [8868]], ['Topf', [120139]], ['topf', [120165]], ['topfork', [10970]], ['tosa', [10537]], ['tprime', [8244]], ['trade', [8482]], ['TRADE', [8482]], ['triangle', [9653]], ['triangledown', [9663]], ['triangleleft', [9667]], ['trianglelefteq', [8884]], ['triangleq', [8796]], ['triangleright', [9657]], ['trianglerighteq', [8885]], ['tridot', [9708]], ['trie', [8796]], ['triminus', [10810]], ['TripleDot', [8411]], ['triplus', [10809]], ['trisb', [10701]], ['tritime', [10811]], ['trpezium', [9186]], ['Tscr', [119983]], ['tscr', [120009]], ['TScy', [1062]], ['tscy', [1094]], ['TSHcy', [1035]], ['tshcy', [1115]], ['Tstrok', [358]], ['tstrok', [359]], ['twixt', [8812]], ['twoheadleftarrow', [8606]], ['twoheadrightarrow', [8608]], ['Uacute', [218]], ['uacute', [250]], ['uarr', [8593]], ['Uarr', [8607]], ['uArr', [8657]], ['Uarrocir', [10569]], ['Ubrcy', [1038]], ['ubrcy', [1118]], ['Ubreve', [364]], ['ubreve', [365]], ['Ucirc', [219]], ['ucirc', [251]], ['Ucy', [1059]], ['ucy', [1091]], ['udarr', [8645]], ['Udblac', [368]], ['udblac', [369]], ['udhar', [10606]], ['ufisht', [10622]], ['Ufr', [120088]], ['ufr', [120114]], ['Ugrave', [217]], ['ugrave', [249]], ['uHar', [10595]], ['uharl', [8639]], ['uharr', [8638]], ['uhblk', [9600]], ['ulcorn', [8988]], ['ulcorner', [8988]], ['ulcrop', [8975]], ['ultri', [9720]], ['Umacr', [362]], ['umacr', [363]], ['uml', [168]], ['UnderBar', [95]], ['UnderBrace', [9183]], ['UnderBracket', [9141]], ['UnderParenthesis', [9181]], ['Union', [8899]], ['UnionPlus', [8846]], ['Uogon', [370]], ['uogon', [371]], ['Uopf', [120140]], ['uopf', [120166]], ['UpArrowBar', [10514]], ['uparrow', [8593]], ['UpArrow', [8593]], ['Uparrow', [8657]], ['UpArrowDownArrow', [8645]], ['updownarrow', [8597]], ['UpDownArrow', [8597]], ['Updownarrow', [8661]], ['UpEquilibrium', [10606]], ['upharpoonleft', [8639]], ['upharpoonright', [8638]], ['uplus', [8846]], ['UpperLeftArrow', [8598]], ['UpperRightArrow', [8599]], ['upsi', [965]], ['Upsi', [978]], ['upsih', [978]], ['Upsilon', [933]], ['upsilon', [965]], ['UpTeeArrow', [8613]], ['UpTee', [8869]], ['upuparrows', [8648]], ['urcorn', [8989]], ['urcorner', [8989]], ['urcrop', [8974]], ['Uring', [366]], ['uring', [367]], ['urtri', [9721]], ['Uscr', [119984]], ['uscr', [120010]], ['utdot', [8944]], ['Utilde', [360]], ['utilde', [361]], ['utri', [9653]], ['utrif', [9652]], ['uuarr', [8648]], ['Uuml', [220]], ['uuml', [252]], ['uwangle', [10663]], ['vangrt', [10652]], ['varepsilon', [1013]], ['varkappa', [1008]], ['varnothing', [8709]], ['varphi', [981]], ['varpi', [982]], ['varpropto', [8733]], ['varr', [8597]], ['vArr', [8661]], ['varrho', [1009]], ['varsigma', [962]], ['varsubsetneq', [8842, 65024]], ['varsubsetneqq', [10955, 65024]], ['varsupsetneq', [8843, 65024]], ['varsupsetneqq', [10956, 65024]], ['vartheta', [977]], ['vartriangleleft', [8882]], ['vartriangleright', [8883]], ['vBar', [10984]], ['Vbar', [10987]], ['vBarv', [10985]], ['Vcy', [1042]], ['vcy', [1074]], ['vdash', [8866]], ['vDash', [8872]], ['Vdash', [8873]], ['VDash', [8875]], ['Vdashl', [10982]], ['veebar', [8891]], ['vee', [8744]], ['Vee', [8897]], ['veeeq', [8794]], ['vellip', [8942]], ['verbar', [124]], ['Verbar', [8214]], ['vert', [124]], ['Vert', [8214]], ['VerticalBar', [8739]], ['VerticalLine', [124]], ['VerticalSeparator', [10072]], ['VerticalTilde', [8768]], ['VeryThinSpace', [8202]], ['Vfr', [120089]], ['vfr', [120115]], ['vltri', [8882]], ['vnsub', [8834, 8402]], ['vnsup', [8835, 8402]], ['Vopf', [120141]], ['vopf', [120167]], ['vprop', [8733]], ['vrtri', [8883]], ['Vscr', [119985]], ['vscr', [120011]], ['vsubnE', [10955, 65024]], ['vsubne', [8842, 65024]], ['vsupnE', [10956, 65024]], ['vsupne', [8843, 65024]], ['Vvdash', [8874]], ['vzigzag', [10650]], ['Wcirc', [372]], ['wcirc', [373]], ['wedbar', [10847]], ['wedge', [8743]], ['Wedge', [8896]], ['wedgeq', [8793]], ['weierp', [8472]], ['Wfr', [120090]], ['wfr', [120116]], ['Wopf', [120142]], ['wopf', [120168]], ['wp', [8472]], ['wr', [8768]], ['wreath', [8768]], ['Wscr', [119986]], ['wscr', [120012]], ['xcap', [8898]], ['xcirc', [9711]], ['xcup', [8899]], ['xdtri', [9661]], ['Xfr', [120091]], ['xfr', [120117]], ['xharr', [10231]], ['xhArr', [10234]], ['Xi', [926]], ['xi', [958]], ['xlarr', [10229]], ['xlArr', [10232]], ['xmap', [10236]], ['xnis', [8955]], ['xodot', [10752]], ['Xopf', [120143]], ['xopf', [120169]], ['xoplus', [10753]], ['xotime', [10754]], ['xrarr', [10230]], ['xrArr', [10233]], ['Xscr', [119987]], ['xscr', [120013]], ['xsqcup', [10758]], ['xuplus', [10756]], ['xutri', [9651]], ['xvee', [8897]], ['xwedge', [8896]], ['Yacute', [221]], ['yacute', [253]], ['YAcy', [1071]], ['yacy', [1103]], ['Ycirc', [374]], ['ycirc', [375]], ['Ycy', [1067]], ['ycy', [1099]], ['yen', [165]], ['Yfr', [120092]], ['yfr', [120118]], ['YIcy', [1031]], ['yicy', [1111]], ['Yopf', [120144]], ['yopf', [120170]], ['Yscr', [119988]], ['yscr', [120014]], ['YUcy', [1070]], ['yucy', [1102]], ['yuml', [255]], ['Yuml', [376]], ['Zacute', [377]], ['zacute', [378]], ['Zcaron', [381]], ['zcaron', [382]], ['Zcy', [1047]], ['zcy', [1079]], ['Zdot', [379]], ['zdot', [380]], ['zeetrf', [8488]], ['ZeroWidthSpace', [8203]], ['Zeta', [918]], ['zeta', [950]], ['zfr', [120119]], ['Zfr', [8488]], ['ZHcy', [1046]], ['zhcy', [1078]], ['zigrarr', [8669]], ['zopf', [120171]], ['Zopf', [8484]], ['Zscr', [119989]], ['zscr', [120015]], ['zwj', [8205]], ['zwnj', [8204]]];

var alphaIndex = {};
var charIndex = {};

createIndexes(alphaIndex, charIndex);

/**
 * @constructor
 */
function Html5Entities() {}

/**
 * @param {String} str
 * @returns {String}
 */
Html5Entities.prototype.decode = function(str) {
    if (!str || !str.length) {
        return '';
    }
    return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) {
        var chr;
        if (entity.charAt(0) === "#") {
            var code = entity.charAt(1) === 'x' ?
                parseInt(entity.substr(2).toLowerCase(), 16) :
                parseInt(entity.substr(1));

            if (!(isNaN(code) || code < -32768 || code > 65535)) {
                chr = String.fromCharCode(code);
            }
        } else {
            chr = alphaIndex[entity];
        }
        return chr || s;
    });
};

/**
 * @param {String} str
 * @returns {String}
 */
 Html5Entities.decode = function(str) {
    return new Html5Entities().decode(str);
 };

/**
 * @param {String} str
 * @returns {String}
 */
Html5Entities.prototype.encode = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var charInfo = charIndex[str.charCodeAt(i)];
        if (charInfo) {
            var alpha = charInfo[str.charCodeAt(i + 1)];
            if (alpha) {
                i++;
            } else {
                alpha = charInfo[''];
            }
            if (alpha) {
                result += "&" + alpha + ";";
                i++;
                continue;
            }
        }
        result += str.charAt(i);
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
 Html5Entities.encode = function(str) {
    return new Html5Entities().encode(str);
 };

/**
 * @param {String} str
 * @returns {String}
 */
Html5Entities.prototype.encodeNonUTF = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var c = str.charCodeAt(i);
        var charInfo = charIndex[c];
        if (charInfo) {
            var alpha = charInfo[str.charCodeAt(i + 1)];
            if (alpha) {
                i++;
            } else {
                alpha = charInfo[''];
            }
            if (alpha) {
                result += "&" + alpha + ";";
                i++;
                continue;
            }
        }
        if (c < 32 || c > 126) {
            result += '&#' + c + ';';
        } else {
            result += str.charAt(i);
        }
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
 Html5Entities.encodeNonUTF = function(str) {
    return new Html5Entities().encodeNonUTF(str);
 };

/**
 * @param {String} str
 * @returns {String}
 */
Html5Entities.prototype.encodeNonASCII = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var c = str.charCodeAt(i);
        if (c <= 255) {
            result += str[i++];
            continue;
        }
        result += '&#' + c + ';';
        i++
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
 Html5Entities.encodeNonASCII = function(str) {
    return new Html5Entities().encodeNonASCII(str);
 };

/**
 * @param {Object} alphaIndex Passed by reference.
 * @param {Object} charIndex Passed by reference.
 */
function createIndexes(alphaIndex, charIndex) {
    var i = ENTITIES.length;
    var _results = [];
    while (i--) {
        var e = ENTITIES[i];
        var alpha = e[0];
        var chars = e[1];
        var chr = chars[0];
        var addChar = (chr < 32 || chr > 126) || chr === 62 || chr === 60 || chr === 38 || chr === 34 || chr === 39;
        var charInfo;
        if (addChar) {
            charInfo = charIndex[chr] = charIndex[chr] || {};
        }
        if (chars[1]) {
            var chr2 = chars[1];
            alphaIndex[alpha] = String.fromCharCode(chr) + String.fromCharCode(chr2);
            _results.push(addChar && (charInfo[chr2] = alpha));
        } else {
            alphaIndex[alpha] = String.fromCharCode(chr);
            _results.push(addChar && (charInfo[''] = alpha));
        }
    }
}

module.exports = Html5Entities;


/***/ }),
/* 489 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var empty_1 = __webpack_require__(933);
Observable_1.Observable.empty = empty_1.empty;
//# sourceMappingURL=empty.js.map

/***/ }),
/* 490 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var timer_1 = __webpack_require__(942);
Observable_1.Observable.timer = timer_1.timer;
//# sourceMappingURL=timer.js.map

/***/ }),
/* 491 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var zip_1 = __webpack_require__(944);
Observable_1.Observable.zip = zip_1.zip;
//# sourceMappingURL=zip.js.map

/***/ }),
/* 492 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var catch_1 = __webpack_require__(1062);
Observable_1.Observable.prototype.catch = catch_1._catch;
Observable_1.Observable.prototype._catch = catch_1._catch;
//# sourceMappingURL=catch.js.map

/***/ }),
/* 493 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var combineLatest_1 = __webpack_require__(246);
Observable_1.Observable.prototype.combineLatest = combineLatest_1.combineLatest;
//# sourceMappingURL=combineLatest.js.map

/***/ }),
/* 494 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var groupBy_1 = __webpack_require__(970);
Observable_1.Observable.prototype.groupBy = groupBy_1.groupBy;
//# sourceMappingURL=groupBy.js.map

/***/ }),
/* 495 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var let_1 = __webpack_require__(973);
Observable_1.Observable.prototype.let = let_1.letProto;
Observable_1.Observable.prototype.letBind = let_1.letProto;
//# sourceMappingURL=let.js.map

/***/ }),
/* 496 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var partition_1 = __webpack_require__(980);
Observable_1.Observable.prototype.partition = partition_1.partition;
//# sourceMappingURL=partition.js.map

/***/ }),
/* 497 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var scan_1 = __webpack_require__(992);
Observable_1.Observable.prototype.scan = scan_1.scan;
//# sourceMappingURL=scan.js.map

/***/ }),
/* 498 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var skipWhile_1 = __webpack_require__(999);
Observable_1.Observable.prototype.skipWhile = skipWhile_1.skipWhile;
//# sourceMappingURL=skipWhile.js.map

/***/ }),
/* 499 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var startWith_1 = __webpack_require__(1000);
Observable_1.Observable.prototype.startWith = startWith_1.startWith;
//# sourceMappingURL=startWith.js.map

/***/ }),
/* 500 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var switchMapTo_1 = __webpack_require__(1004);
Observable_1.Observable.prototype.switchMapTo = switchMapTo_1.switchMapTo;
//# sourceMappingURL=switchMapTo.js.map

/***/ }),
/* 501 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var takeWhile_1 = __webpack_require__(1008);
Observable_1.Observable.prototype.takeWhile = takeWhile_1.takeWhile;
//# sourceMappingURL=takeWhile.js.map

/***/ }),
/* 502 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 root_1 = __webpack_require__(42);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var Observable_1 = __webpack_require__(1);
var Subscriber_1 = __webpack_require__(6);
var map_1 = __webpack_require__(249);
function getCORSRequest() {
    if (root_1.root.XMLHttpRequest) {
        return new root_1.root.XMLHttpRequest();
    }
    else if (!!root_1.root.XDomainRequest) {
        return new root_1.root.XDomainRequest();
    }
    else {
        throw new Error('CORS is not supported by your browser');
    }
}
function getXMLHttpRequest() {
    if (root_1.root.XMLHttpRequest) {
        return new root_1.root.XMLHttpRequest();
    }
    else {
        var progId = void 0;
        try {
            var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
            for (var i = 0; i < 3; i++) {
                try {
                    progId = progIds[i];
                    if (new root_1.root.ActiveXObject(progId)) {
                        break;
                    }
                }
                catch (e) {
                }
            }
            return new root_1.root.ActiveXObject(progId);
        }
        catch (e) {
            throw new Error('XMLHttpRequest is not supported by your browser');
        }
    }
}
function ajaxGet(url, headers) {
    if (headers === void 0) { headers = null; }
    return new AjaxObservable({ method: 'GET', url: url, headers: headers });
}
exports.ajaxGet = ajaxGet;
;
function ajaxPost(url, body, headers) {
    return new AjaxObservable({ method: 'POST', url: url, body: body, headers: headers });
}
exports.ajaxPost = ajaxPost;
;
function ajaxDelete(url, headers) {
    return new AjaxObservable({ method: 'DELETE', url: url, headers: headers });
}
exports.ajaxDelete = ajaxDelete;
;
function ajaxPut(url, body, headers) {
    return new AjaxObservable({ method: 'PUT', url: url, body: body, headers: headers });
}
exports.ajaxPut = ajaxPut;
;
function ajaxPatch(url, body, headers) {
    return new AjaxObservable({ method: 'PATCH', url: url, body: body, headers: headers });
}
exports.ajaxPatch = ajaxPatch;
;
function ajaxGetJSON(url, headers) {
    return new AjaxObservable({ method: 'GET', url: url, responseType: 'json', headers: headers })
        .lift(new map_1.MapOperator(function (x, index) { return x.response; }, null));
}
exports.ajaxGetJSON = ajaxGetJSON;
;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var AjaxObservable = (function (_super) {
    __extends(AjaxObservable, _super);
    function AjaxObservable(urlOrRequest) {
        _super.call(this);
        var request = {
            async: true,
            createXHR: function () {
                return this.crossDomain ? getCORSRequest.call(this) : getXMLHttpRequest();
            },
            crossDomain: false,
            withCredentials: false,
            headers: {},
            method: 'GET',
            responseType: 'json',
            timeout: 0
        };
        if (typeof urlOrRequest === 'string') {
            request.url = urlOrRequest;
        }
        else {
            for (var prop in urlOrRequest) {
                if (urlOrRequest.hasOwnProperty(prop)) {
                    request[prop] = urlOrRequest[prop];
                }
            }
        }
        this.request = request;
    }
    AjaxObservable.prototype._subscribe = function (subscriber) {
        return new AjaxSubscriber(subscriber, this.request);
    };
    /**
     * Creates an observable for an Ajax request with either a request object with
     * url, headers, etc or a string for a URL.
     *
     * @example
     * source = Rx.Observable.ajax('/products');
     * source = Rx.Observable.ajax({ url: 'products', method: 'GET' });
     *
     * @param {string|Object} request Can be one of the following:
     *   A string of the URL to make the Ajax call.
     *   An object with the following properties
     *   - url: URL of the request
     *   - body: The body of the request
     *   - method: Method of the request, such as GET, POST, PUT, PATCH, DELETE
     *   - async: Whether the request is async
     *   - headers: Optional headers
     *   - crossDomain: true if a cross domain request, else false
     *   - createXHR: a function to override if you need to use an alternate
     *   XMLHttpRequest implementation.
     *   - resultSelector: a function to use to alter the output value type of
     *   the Observable. Gets {@link AjaxResponse} as an argument.
     * @return {Observable} An observable sequence containing the XMLHttpRequest.
     * @static true
     * @name ajax
     * @owner Observable
    */
    AjaxObservable.create = (function () {
        var create = function (urlOrRequest) {
            return new AjaxObservable(urlOrRequest);
        };
        create.get = ajaxGet;
        create.post = ajaxPost;
        create.delete = ajaxDelete;
        create.put = ajaxPut;
        create.patch = ajaxPatch;
        create.getJSON = ajaxGetJSON;
        return create;
    })();
    return AjaxObservable;
}(Observable_1.Observable));
exports.AjaxObservable = AjaxObservable;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var AjaxSubscriber = (function (_super) {
    __extends(AjaxSubscriber, _super);
    function AjaxSubscriber(destination, request) {
        _super.call(this, destination);
        this.request = request;
        this.done = false;
        var headers = request.headers = request.headers || {};
        // force CORS if requested
        if (!request.crossDomain && !headers['X-Requested-With']) {
            headers['X-Requested-With'] = 'XMLHttpRequest';
        }
        // ensure content type is set
        if (!('Content-Type' in headers) && !(root_1.root.FormData && request.body instanceof root_1.root.FormData) && typeof request.body !== 'undefined') {
            headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
        }
        // properly serialize body
        request.body = this.serializeBody(request.body, request.headers['Content-Type']);
        this.send();
    }
    AjaxSubscriber.prototype.next = function (e) {
        this.done = true;
        var _a = this, xhr = _a.xhr, request = _a.request, destination = _a.destination;
        var response = new AjaxResponse(e, xhr, request);
        destination.next(response);
    };
    AjaxSubscriber.prototype.send = function () {
        var _a = this, request = _a.request, _b = _a.request, user = _b.user, method = _b.method, url = _b.url, async = _b.async, password = _b.password, headers = _b.headers, body = _b.body;
        var createXHR = request.createXHR;
        var xhr = tryCatch_1.tryCatch(createXHR).call(request);
        if (xhr === errorObject_1.errorObject) {
            this.error(errorObject_1.errorObject.e);
        }
        else {
            this.xhr = xhr;
            // set up the events before open XHR
            // https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest
            // You need to add the event listeners before calling open() on the request.
            // Otherwise the progress events will not fire.
            this.setupEvents(xhr, request);
            // open XHR
            var result = void 0;
            if (user) {
                result = tryCatch_1.tryCatch(xhr.open).call(xhr, method, url, async, user, password);
            }
            else {
                result = tryCatch_1.tryCatch(xhr.open).call(xhr, method, url, async);
            }
            if (result === errorObject_1.errorObject) {
                this.error(errorObject_1.errorObject.e);
                return null;
            }
            // timeout, responseType and withCredentials can be set once the XHR is open
            if (async) {
                xhr.timeout = request.timeout;
                xhr.responseType = request.responseType;
            }
            if ('withCredentials' in xhr) {
                xhr.withCredentials = !!request.withCredentials;
            }
            // set headers
            this.setHeaders(xhr, headers);
            // finally send the request
            result = body ? tryCatch_1.tryCatch(xhr.send).call(xhr, body) : tryCatch_1.tryCatch(xhr.send).call(xhr);
            if (result === errorObject_1.errorObject) {
                this.error(errorObject_1.errorObject.e);
                return null;
            }
        }
        return xhr;
    };
    AjaxSubscriber.prototype.serializeBody = function (body, contentType) {
        if (!body || typeof body === 'string') {
            return body;
        }
        else if (root_1.root.FormData && body instanceof root_1.root.FormData) {
            return body;
        }
        if (contentType) {
            var splitIndex = contentType.indexOf(';');
            if (splitIndex !== -1) {
                contentType = contentType.substring(0, splitIndex);
            }
        }
        switch (contentType) {
            case 'application/x-www-form-urlencoded':
                return Object.keys(body).map(function (key) { return (encodeURI(key) + "=" + encodeURI(body[key])); }).join('&');
            case 'application/json':
                return JSON.stringify(body);
            default:
                return body;
        }
    };
    AjaxSubscriber.prototype.setHeaders = function (xhr, headers) {
        for (var key in headers) {
            if (headers.hasOwnProperty(key)) {
                xhr.setRequestHeader(key, headers[key]);
            }
        }
    };
    AjaxSubscriber.prototype.setupEvents = function (xhr, request) {
        var progressSubscriber = request.progressSubscriber;
        function xhrTimeout(e) {
            var _a = xhrTimeout, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;
            if (progressSubscriber) {
                progressSubscriber.error(e);
            }
            subscriber.error(new AjaxTimeoutError(this, request)); //TODO: Make betterer.
        }
        ;
        xhr.ontimeout = xhrTimeout;
        xhrTimeout.request = request;
        xhrTimeout.subscriber = this;
        xhrTimeout.progressSubscriber = progressSubscriber;
        if (xhr.upload && 'withCredentials' in xhr) {
            if (progressSubscriber) {
                var xhrProgress_1;
                xhrProgress_1 = function (e) {
                    var progressSubscriber = xhrProgress_1.progressSubscriber;
                    progressSubscriber.next(e);
                };
                if (root_1.root.XDomainRequest) {
                    xhr.onprogress = xhrProgress_1;
                }
                else {
                    xhr.upload.onprogress = xhrProgress_1;
                }
                xhrProgress_1.progressSubscriber = progressSubscriber;
            }
            var xhrError_1;
            xhrError_1 = function (e) {
                var _a = xhrError_1, progressSubscriber = _a.progressSubscriber, subscriber = _a.subscriber, request = _a.request;
                if (progressSubscriber) {
                    progressSubscriber.error(e);
                }
                subscriber.error(new AjaxError('ajax error', this, request));
            };
            xhr.onerror = xhrError_1;
            xhrError_1.request = request;
            xhrError_1.subscriber = this;
            xhrError_1.progressSubscriber = progressSubscriber;
        }
        function xhrReadyStateChange(e) {
            var _a = xhrReadyStateChange, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;
            if (this.readyState === 4) {
                // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
                var status_1 = this.status === 1223 ? 204 : this.status;
                var response = (this.responseType === 'text' ? (this.response || this.responseText) : this.response);
                // fix status code when it is 0 (0 status is undocumented).
                // Occurs when accessing file resources or on Android 4.1 stock browser
                // while retrieving files from application cache.
                if (status_1 === 0) {
                    status_1 = response ? 200 : 0;
                }
                if (200 <= status_1 && status_1 < 300) {
                    if (progressSubscriber) {
                        progressSubscriber.complete();
                    }
                    subscriber.next(e);
                    subscriber.complete();
                }
                else {
                    if (progressSubscriber) {
                        progressSubscriber.error(e);
                    }
                    subscriber.error(new AjaxError('ajax error ' + status_1, this, request));
                }
            }
        }
        ;
        xhr.onreadystatechange = xhrReadyStateChange;
        xhrReadyStateChange.subscriber = this;
        xhrReadyStateChange.progressSubscriber = progressSubscriber;
        xhrReadyStateChange.request = request;
    };
    AjaxSubscriber.prototype.unsubscribe = function () {
        var _a = this, done = _a.done, xhr = _a.xhr;
        if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {
            xhr.abort();
        }
        _super.prototype.unsubscribe.call(this);
    };
    return AjaxSubscriber;
}(Subscriber_1.Subscriber));
exports.AjaxSubscriber = AjaxSubscriber;
/**
 * A normalized AJAX response.
 *
 * @see {@link ajax}
 *
 * @class AjaxResponse
 */
var AjaxResponse = (function () {
    function AjaxResponse(originalEvent, xhr, request) {
        this.originalEvent = originalEvent;
        this.xhr = xhr;
        this.request = request;
        this.status = xhr.status;
        this.responseType = xhr.responseType || request.responseType;
        switch (this.responseType) {
            case 'json':
                if ('response' in xhr) {
                    //IE does not support json as responseType, parse it internally
                    this.response = xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');
                }
                else {
                    this.response = JSON.parse(xhr.responseText || 'null');
                }
                break;
            case 'xml':
                this.response = xhr.responseXML;
                break;
            case 'text':
            default:
                this.response = ('response' in xhr) ? xhr.response : xhr.responseText;
                break;
        }
    }
    return AjaxResponse;
}());
exports.AjaxResponse = AjaxResponse;
/**
 * A normalized AJAX error.
 *
 * @see {@link ajax}
 *
 * @class AjaxError
 */
var AjaxError = (function (_super) {
    __extends(AjaxError, _super);
    function AjaxError(message, xhr, request) {
        _super.call(this, message);
        this.message = message;
        this.xhr = xhr;
        this.request = request;
        this.status = xhr.status;
    }
    return AjaxError;
}(Error));
exports.AjaxError = AjaxError;
/**
 * @see {@link ajax}
 *
 * @class AjaxTimeoutError
 */
var AjaxTimeoutError = (function (_super) {
    __extends(AjaxTimeoutError, _super);
    function AjaxTimeoutError(xhr, request) {
        _super.call(this, 'ajax timeout', xhr, request);
    }
    return AjaxTimeoutError;
}(AjaxError));
exports.AjaxTimeoutError = AjaxTimeoutError;
//# sourceMappingURL=AjaxObservable.js.map

/***/ }),
/* 503 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
/* tslint:enable:max-line-length */
/**
 * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item.
 *
 * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.
 *
 * If a comparator function is not provided, an equality check is used by default.
 *
 * @example <caption>A simple example with numbers</caption>
 * Observable.of(1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 4)
 *   .distinctUntilChanged()
 *   .subscribe(x => console.log(x)); // 1, 2, 1, 2, 3, 4
 *
 * @example <caption>An example using a compare function</caption>
 * interface Person {
 *    age: number,
 *    name: string
 * }
 *
 * Observable.of<Person>(
 *     { age: 4, name: 'Foo'},
 *     { age: 7, name: 'Bar'},
 *     { age: 5, name: 'Foo'})
 *     { age: 6, name: 'Foo'})
 *     .distinctUntilChanged((p: Person, q: Person) => p.name === q.name)
 *     .subscribe(x => console.log(x));
 *
 * // displays:
 * // { age: 4, name: 'Foo' }
 * // { age: 7, name: 'Bar' }
 * // { age: 5, name: 'Foo' }
 *
 * @see {@link distinct}
 * @see {@link distinctUntilKeyChanged}
 *
 * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.
 * @return {Observable} An Observable that emits items from the source Observable with distinct values.
 * @method distinctUntilChanged
 * @owner Observable
 */
function distinctUntilChanged(compare, keySelector) {
    return this.lift(new DistinctUntilChangedOperator(compare, keySelector));
}
exports.distinctUntilChanged = distinctUntilChanged;
var DistinctUntilChangedOperator = (function () {
    function DistinctUntilChangedOperator(compare, keySelector) {
        this.compare = compare;
        this.keySelector = keySelector;
    }
    DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
    };
    return DistinctUntilChangedOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DistinctUntilChangedSubscriber = (function (_super) {
    __extends(DistinctUntilChangedSubscriber, _super);
    function DistinctUntilChangedSubscriber(destination, compare, keySelector) {
        _super.call(this, destination);
        this.keySelector = keySelector;
        this.hasKey = false;
        if (typeof compare === 'function') {
            this.compare = compare;
        }
    }
    DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
        return x === y;
    };
    DistinctUntilChangedSubscriber.prototype._next = function (value) {
        var keySelector = this.keySelector;
        var key = value;
        if (keySelector) {
            key = tryCatch_1.tryCatch(this.keySelector)(value);
            if (key === errorObject_1.errorObject) {
                return this.destination.error(errorObject_1.errorObject.e);
            }
        }
        var result = false;
        if (this.hasKey) {
            result = tryCatch_1.tryCatch(this.compare)(this.key, key);
            if (result === errorObject_1.errorObject) {
                return this.destination.error(errorObject_1.errorObject.e);
            }
        }
        else {
            this.hasKey = true;
        }
        if (Boolean(result) === false) {
            this.key = key;
            this.destination.next(value);
        }
    };
    return DistinctUntilChangedSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=distinctUntilChanged.js.map

/***/ }),
/* 504 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/* tslint:enable:max-line-length */
/**
 * Emits only the first value emitted by the source Observable that meets some
 * condition.
 *
 * <span class="informal">Finds the first value that passes some test and emits
 * that.</span>
 *
 * <img src="./img/find.png" width="100%">
 *
 * `find` searches for the first item in the source Observable that matches the
 * specified condition embodied by the `predicate`, and returns the first
 * occurrence in the source. Unlike {@link first}, the `predicate` is required
 * in `find`, and does not emit an error if a valid value is not found.
 *
 * @example <caption>Find and emit the first click that happens on a DIV element</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.find(ev => ev.target.tagName === 'DIV');
 * result.subscribe(x => console.log(x));
 *
 * @see {@link filter}
 * @see {@link first}
 * @see {@link findIndex}
 * @see {@link take}
 *
 * @param {function(value: T, index: number, source: Observable<T>): boolean} predicate
 * A function called with each item to test for condition matching.
 * @param {any} [thisArg] An optional argument to determine the value of `this`
 * in the `predicate` function.
 * @return {Observable<T>} An Observable of the first item that matches the
 * condition.
 * @method find
 * @owner Observable
 */
function find(predicate, thisArg) {
    if (typeof predicate !== 'function') {
        throw new TypeError('predicate is not a function');
    }
    return this.lift(new FindValueOperator(predicate, this, false, thisArg));
}
exports.find = find;
var FindValueOperator = (function () {
    function FindValueOperator(predicate, source, yieldIndex, thisArg) {
        this.predicate = predicate;
        this.source = source;
        this.yieldIndex = yieldIndex;
        this.thisArg = thisArg;
    }
    FindValueOperator.prototype.call = function (observer, source) {
        return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
    };
    return FindValueOperator;
}());
exports.FindValueOperator = FindValueOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var FindValueSubscriber = (function (_super) {
    __extends(FindValueSubscriber, _super);
    function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
        _super.call(this, destination);
        this.predicate = predicate;
        this.source = source;
        this.yieldIndex = yieldIndex;
        this.thisArg = thisArg;
        this.index = 0;
    }
    FindValueSubscriber.prototype.notifyComplete = function (value) {
        var destination = this.destination;
        destination.next(value);
        destination.complete();
    };
    FindValueSubscriber.prototype._next = function (value) {
        var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;
        var index = this.index++;
        try {
            var result = predicate.call(thisArg || this, value, index, this.source);
            if (result) {
                this.notifyComplete(this.yieldIndex ? index : value);
            }
        }
        catch (err) {
            this.destination.error(err);
        }
    };
    FindValueSubscriber.prototype._complete = function () {
        this.notifyComplete(this.yieldIndex ? -1 : undefined);
    };
    return FindValueSubscriber;
}(Subscriber_1.Subscriber));
exports.FindValueSubscriber = FindValueSubscriber;
//# sourceMappingURL=find.js.map

/***/ }),
/* 505 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Projects each source value to the same Observable which is merged multiple
 * times in the output Observable.
 *
 * <span class="informal">It's like {@link mergeMap}, but maps each value always
 * to the same inner Observable.</span>
 *
 * <img src="./img/mergeMapTo.png" width="100%">
 *
 * Maps each source value to the given Observable `innerObservable` regardless
 * of the source value, and then merges those resulting Observables into one
 * single Observable, which is the output Observable.
 *
 * @example <caption>For each click event, start an interval Observable ticking every 1 second</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.mergeMapTo(Rx.Observable.interval(1000));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link concatMapTo}
 * @see {@link merge}
 * @see {@link mergeAll}
 * @see {@link mergeMap}
 * @see {@link mergeScan}
 * @see {@link switchMapTo}
 *
 * @param {ObservableInput} innerObservable An Observable to replace each value from
 * the source Observable.
 * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
 * A function to produce the value on the output Observable based on the values
 * and the indices of the source (outer) emission and the inner Observable
 * emission. The arguments passed to this function are:
 * - `outerValue`: the value that came from the source
 * - `innerValue`: the value that came from the projected Observable
 * - `outerIndex`: the "index" of the value that came from the source
 * - `innerIndex`: the "index" of the value from the projected Observable
 * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
 * Observables being subscribed to concurrently.
 * @return {Observable} An Observable that emits items from the given
 * `innerObservable` (and optionally transformed through `resultSelector`) every
 * time a value is emitted on the source Observable.
 * @method mergeMapTo
 * @owner Observable
 */
function mergeMapTo(innerObservable, resultSelector, concurrent) {
    if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
    if (typeof resultSelector === 'number') {
        concurrent = resultSelector;
        resultSelector = null;
    }
    return this.lift(new MergeMapToOperator(innerObservable, resultSelector, concurrent));
}
exports.mergeMapTo = mergeMapTo;
// TODO: Figure out correct signature here: an Operator<Observable<T>, R>
//       needs to implement call(observer: Subscriber<R>): Subscriber<Observable<T>>
var MergeMapToOperator = (function () {
    function MergeMapToOperator(ish, resultSelector, concurrent) {
        if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
        this.ish = ish;
        this.resultSelector = resultSelector;
        this.concurrent = concurrent;
    }
    MergeMapToOperator.prototype.call = function (observer, source) {
        return source.subscribe(new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent));
    };
    return MergeMapToOperator;
}());
exports.MergeMapToOperator = MergeMapToOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var MergeMapToSubscriber = (function (_super) {
    __extends(MergeMapToSubscriber, _super);
    function MergeMapToSubscriber(destination, ish, resultSelector, concurrent) {
        if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
        _super.call(this, destination);
        this.ish = ish;
        this.resultSelector = resultSelector;
        this.concurrent = concurrent;
        this.hasCompleted = false;
        this.buffer = [];
        this.active = 0;
        this.index = 0;
    }
    MergeMapToSubscriber.prototype._next = function (value) {
        if (this.active < this.concurrent) {
            var resultSelector = this.resultSelector;
            var index = this.index++;
            var ish = this.ish;
            var destination = this.destination;
            this.active++;
            this._innerSub(ish, destination, resultSelector, value, index);
        }
        else {
            this.buffer.push(value);
        }
    };
    MergeMapToSubscriber.prototype._innerSub = function (ish, destination, resultSelector, value, index) {
        this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));
    };
    MergeMapToSubscriber.prototype._complete = function () {
        this.hasCompleted = true;
        if (this.active === 0 && this.buffer.length === 0) {
            this.destination.complete();
        }
    };
    MergeMapToSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var _a = this, resultSelector = _a.resultSelector, destination = _a.destination;
        if (resultSelector) {
            this.trySelectResult(outerValue, innerValue, outerIndex, innerIndex);
        }
        else {
            destination.next(innerValue);
        }
    };
    MergeMapToSubscriber.prototype.trySelectResult = function (outerValue, innerValue, outerIndex, innerIndex) {
        var _a = this, resultSelector = _a.resultSelector, destination = _a.destination;
        var result;
        try {
            result = resultSelector(outerValue, innerValue, outerIndex, innerIndex);
        }
        catch (err) {
            destination.error(err);
            return;
        }
        destination.next(result);
    };
    MergeMapToSubscriber.prototype.notifyError = function (err) {
        this.destination.error(err);
    };
    MergeMapToSubscriber.prototype.notifyComplete = function (innerSub) {
        var buffer = this.buffer;
        this.remove(innerSub);
        this.active--;
        if (buffer.length > 0) {
            this._next(buffer.shift());
        }
        else if (this.active === 0 && this.hasCompleted) {
            this.destination.complete();
        }
    };
    return MergeMapToSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.MergeMapToSubscriber = MergeMapToSubscriber;
//# sourceMappingURL=mergeMapTo.js.map

/***/ }),
/* 506 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 FromObservable_1 = __webpack_require__(1057);
var isArray_1 = __webpack_require__(83);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one
 * that was passed.
 *
 * <span class="informal">Execute series of Observables no matter what, even if it means swallowing errors.</span>
 *
 * <img src="./img/onErrorResumeNext.png" width="100%">
 *
 * `onErrorResumeNext` is an operator that accepts a series of Observables, provided either directly as
 * arguments or as an array. If no single Observable is provided, returned Observable will simply behave the same
 * as the source.
 *
 * `onErrorResumeNext` returns an Observable that starts by subscribing and re-emitting values from the source Observable.
 * When its stream of values ends - no matter if Observable completed or emitted an error - `onErrorResumeNext`
 * will subscribe to the first Observable that was passed as an argument to the method. It will start re-emitting
 * its values as well and - again - when that stream ends, `onErrorResumeNext` will proceed to subscribing yet another
 * Observable in provided series, no matter if previous Observable completed or ended with an error. This will
 * be happening until there is no more Observables left in the series, at which point returned Observable will
 * complete - even if the last subscribed stream ended with an error.
 *
 * `onErrorResumeNext` can be therefore though of as version of {@link concat} operator, which is more permissive
 * when it comes to the errors emitted by its input Observables. While `concat` subscribes to the next Observable
 * in series only if previous one successfully completed, `onErrorResumeNext` subscribes even if it ended with
 * an error.
 *
 * Note that you do not get any access to errors emitted by the Observables. In particular do not
 * expect these errors to appear in error callback passed to {@link subscribe}. If you want to take
 * specific actions based on what error was emitted by an Observable, you should try out {@link catch} instead.
 *
 *
 * @example <caption>Subscribe to the next Observable after map fails</caption>
 * Rx.Observable.of(1, 2, 3, 0)
 *   .map(x => {
 *       if (x === 0) { throw Error(); }
         return 10 / x;
 *   })
 *   .onErrorResumeNext(Rx.Observable.of(1, 2, 3))
 *   .subscribe(
 *     val => console.log(val),
 *     err => console.log(err),          // Will never be called.
 *     () => console.log('that\'s it!')
 *   );
 *
 * // Logs:
 * // 10
 * // 5
 * // 3.3333333333333335
 * // 1
 * // 2
 * // 3
 * // "that's it!"
 *
 * @see {@link concat}
 * @see {@link catch}
 *
 * @param {...ObservableInput} observables Observables passed either directly or as an array.
 * @return {Observable} An Observable that emits values from source Observable, but - if it errors - subscribes
 * to the next passed Observable and so on, until it completes or runs out of Observables.
 * @method onErrorResumeNext
 * @owner Observable
 */
function onErrorResumeNext() {
    var nextSources = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        nextSources[_i - 0] = arguments[_i];
    }
    if (nextSources.length === 1 && isArray_1.isArray(nextSources[0])) {
        nextSources = nextSources[0];
    }
    return this.lift(new OnErrorResumeNextOperator(nextSources));
}
exports.onErrorResumeNext = onErrorResumeNext;
/* tslint:enable:max-line-length */
function onErrorResumeNextStatic() {
    var nextSources = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        nextSources[_i - 0] = arguments[_i];
    }
    var source = null;
    if (nextSources.length === 1 && isArray_1.isArray(nextSources[0])) {
        nextSources = nextSources[0];
    }
    source = nextSources.shift();
    return new FromObservable_1.FromObservable(source, null).lift(new OnErrorResumeNextOperator(nextSources));
}
exports.onErrorResumeNextStatic = onErrorResumeNextStatic;
var OnErrorResumeNextOperator = (function () {
    function OnErrorResumeNextOperator(nextSources) {
        this.nextSources = nextSources;
    }
    OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
    };
    return OnErrorResumeNextOperator;
}());
var OnErrorResumeNextSubscriber = (function (_super) {
    __extends(OnErrorResumeNextSubscriber, _super);
    function OnErrorResumeNextSubscriber(destination, nextSources) {
        _super.call(this, destination);
        this.destination = destination;
        this.nextSources = nextSources;
    }
    OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
        this.subscribeToNextSource();
    };
    OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
        this.subscribeToNextSource();
    };
    OnErrorResumeNextSubscriber.prototype._error = function (err) {
        this.subscribeToNextSource();
    };
    OnErrorResumeNextSubscriber.prototype._complete = function () {
        this.subscribeToNextSource();
    };
    OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
        var next = this.nextSources.shift();
        if (next) {
            this.add(subscribeToResult_1.subscribeToResult(this, next));
        }
        else {
            this.destination.complete();
        }
    };
    return OnErrorResumeNextSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=onErrorResumeNext.js.map

/***/ }),
/* 507 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 isArray_1 = __webpack_require__(83);
var ArrayObservable_1 = __webpack_require__(82);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Returns an Observable that mirrors the first source Observable to emit an item
 * from the combination of this Observable and supplied Observables.
 * @param {...Observables} ...observables Sources used to race for which Observable emits first.
 * @return {Observable} An Observable that mirrors the output of the first Observable to emit an item.
 * @method race
 * @owner Observable
 */
function race() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    // if the only argument is an array, it was most likely called with
    // `pair([obs1, obs2, ...])`
    if (observables.length === 1 && isArray_1.isArray(observables[0])) {
        observables = observables[0];
    }
    return this.lift.call(raceStatic.apply(void 0, [this].concat(observables)));
}
exports.race = race;
function raceStatic() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    // if the only argument is an array, it was most likely called with
    // `race([obs1, obs2, ...])`
    if (observables.length === 1) {
        if (isArray_1.isArray(observables[0])) {
            observables = observables[0];
        }
        else {
            return observables[0];
        }
    }
    return new ArrayObservable_1.ArrayObservable(observables).lift(new RaceOperator());
}
exports.raceStatic = raceStatic;
var RaceOperator = (function () {
    function RaceOperator() {
    }
    RaceOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new RaceSubscriber(subscriber));
    };
    return RaceOperator;
}());
exports.RaceOperator = RaceOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var RaceSubscriber = (function (_super) {
    __extends(RaceSubscriber, _super);
    function RaceSubscriber(destination) {
        _super.call(this, destination);
        this.hasFirst = false;
        this.observables = [];
        this.subscriptions = [];
    }
    RaceSubscriber.prototype._next = function (observable) {
        this.observables.push(observable);
    };
    RaceSubscriber.prototype._complete = function () {
        var observables = this.observables;
        var len = observables.length;
        if (len === 0) {
            this.destination.complete();
        }
        else {
            for (var i = 0; i < len && !this.hasFirst; i++) {
                var observable = observables[i];
                var subscription = subscribeToResult_1.subscribeToResult(this, observable, observable, i);
                if (this.subscriptions) {
                    this.subscriptions.push(subscription);
                }
                this.add(subscription);
            }
            this.observables = null;
        }
    };
    RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        if (!this.hasFirst) {
            this.hasFirst = true;
            for (var i = 0; i < this.subscriptions.length; i++) {
                if (i !== outerIndex) {
                    var subscription = this.subscriptions[i];
                    subscription.unsubscribe();
                    this.remove(subscription);
                }
            }
            this.subscriptions = null;
        }
        this.destination.next(innerValue);
    };
    return RaceSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.RaceSubscriber = RaceSubscriber;
//# sourceMappingURL=race.js.map

/***/ }),
/* 508 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
exports.defaultThrottleConfig = {
    leading: true,
    trailing: false
};
/**
 * Emits a value from the source Observable, then ignores subsequent source
 * values for a duration determined by another Observable, then repeats this
 * process.
 *
 * <span class="informal">It's like {@link throttleTime}, but the silencing
 * duration is determined by a second Observable.</span>
 *
 * <img src="./img/throttle.png" width="100%">
 *
 * `throttle` emits the source Observable values on the output Observable
 * when its internal timer is disabled, and ignores source values when the timer
 * is enabled. Initially, the timer is disabled. As soon as the first source
 * value arrives, it is forwarded to the output Observable, and then the timer
 * is enabled by calling the `durationSelector` function with the source value,
 * which returns the "duration" Observable. When the duration Observable emits a
 * value or completes, the timer is disabled, and this process repeats for the
 * next source value.
 *
 * @example <caption>Emit clicks at a rate of at most one click per second</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.throttle(ev => Rx.Observable.interval(1000));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link audit}
 * @see {@link debounce}
 * @see {@link delayWhen}
 * @see {@link sample}
 * @see {@link throttleTime}
 *
 * @param {function(value: T): SubscribableOrPromise} durationSelector A function
 * that receives a value from the source Observable, for computing the silencing
 * duration for each source value, returned as an Observable or a Promise.
 * @param {Object} config a configuration object to define `leading` and `trailing` behavior. Defaults
 * to `{ leading: true, trailing: false }`.
 * @return {Observable<T>} An Observable that performs the throttle operation to
 * limit the rate of emissions from the source.
 * @method throttle
 * @owner Observable
 */
function throttle(durationSelector, config) {
    if (config === void 0) { config = exports.defaultThrottleConfig; }
    return this.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing));
}
exports.throttle = throttle;
var ThrottleOperator = (function () {
    function ThrottleOperator(durationSelector, leading, trailing) {
        this.durationSelector = durationSelector;
        this.leading = leading;
        this.trailing = trailing;
    }
    ThrottleOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
    };
    return ThrottleOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc
 * @ignore
 * @extends {Ignored}
 */
var ThrottleSubscriber = (function (_super) {
    __extends(ThrottleSubscriber, _super);
    function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {
        _super.call(this, destination);
        this.destination = destination;
        this.durationSelector = durationSelector;
        this._leading = _leading;
        this._trailing = _trailing;
        this._hasTrailingValue = false;
    }
    ThrottleSubscriber.prototype._next = function (value) {
        if (this.throttled) {
            if (this._trailing) {
                this._hasTrailingValue = true;
                this._trailingValue = value;
            }
        }
        else {
            var duration = this.tryDurationSelector(value);
            if (duration) {
                this.add(this.throttled = subscribeToResult_1.subscribeToResult(this, duration));
            }
            if (this._leading) {
                this.destination.next(value);
                if (this._trailing) {
                    this._hasTrailingValue = true;
                    this._trailingValue = value;
                }
            }
        }
    };
    ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
        try {
            return this.durationSelector(value);
        }
        catch (err) {
            this.destination.error(err);
            return null;
        }
    };
    ThrottleSubscriber.prototype._unsubscribe = function () {
        var _a = this, throttled = _a.throttled, _trailingValue = _a._trailingValue, _hasTrailingValue = _a._hasTrailingValue, _trailing = _a._trailing;
        this._trailingValue = null;
        this._hasTrailingValue = false;
        if (throttled) {
            this.remove(throttled);
            this.throttled = null;
            throttled.unsubscribe();
        }
    };
    ThrottleSubscriber.prototype._sendTrailing = function () {
        var _a = this, destination = _a.destination, throttled = _a.throttled, _trailing = _a._trailing, _trailingValue = _a._trailingValue, _hasTrailingValue = _a._hasTrailingValue;
        if (throttled && _trailing && _hasTrailingValue) {
            destination.next(_trailingValue);
            this._trailingValue = null;
            this._hasTrailingValue = false;
        }
    };
    ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this._sendTrailing();
        this._unsubscribe();
    };
    ThrottleSubscriber.prototype.notifyComplete = function () {
        this._sendTrailing();
        this._unsubscribe();
    };
    return ThrottleSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=throttle.js.map

/***/ }),
/* 509 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var async_1 = __webpack_require__(23);
/**
 * @param scheduler
 * @return {Observable<TimeInterval<any>>|WebSocketSubject<T>|Observable<T>}
 * @method timeInterval
 * @owner Observable
 */
function timeInterval(scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    return this.lift(new TimeIntervalOperator(scheduler));
}
exports.timeInterval = timeInterval;
var TimeInterval = (function () {
    function TimeInterval(value, interval) {
        this.value = value;
        this.interval = interval;
    }
    return TimeInterval;
}());
exports.TimeInterval = TimeInterval;
;
var TimeIntervalOperator = (function () {
    function TimeIntervalOperator(scheduler) {
        this.scheduler = scheduler;
    }
    TimeIntervalOperator.prototype.call = function (observer, source) {
        return source.subscribe(new TimeIntervalSubscriber(observer, this.scheduler));
    };
    return TimeIntervalOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TimeIntervalSubscriber = (function (_super) {
    __extends(TimeIntervalSubscriber, _super);
    function TimeIntervalSubscriber(destination, scheduler) {
        _super.call(this, destination);
        this.scheduler = scheduler;
        this.lastTime = 0;
        this.lastTime = scheduler.now();
    }
    TimeIntervalSubscriber.prototype._next = function (value) {
        var now = this.scheduler.now();
        var span = now - this.lastTime;
        this.lastTime = now;
        this.destination.next(new TimeInterval(value, span));
    };
    return TimeIntervalSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=timeInterval.js.map

/***/ }),
/* 510 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var async_1 = __webpack_require__(23);
/**
 * @param scheduler
 * @return {Observable<Timestamp<any>>|WebSocketSubject<T>|Observable<T>}
 * @method timestamp
 * @owner Observable
 */
function timestamp(scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    return this.lift(new TimestampOperator(scheduler));
}
exports.timestamp = timestamp;
var Timestamp = (function () {
    function Timestamp(value, timestamp) {
        this.value = value;
        this.timestamp = timestamp;
    }
    return Timestamp;
}());
exports.Timestamp = Timestamp;
;
var TimestampOperator = (function () {
    function TimestampOperator(scheduler) {
        this.scheduler = scheduler;
    }
    TimestampOperator.prototype.call = function (observer, source) {
        return source.subscribe(new TimestampSubscriber(observer, this.scheduler));
    };
    return TimestampOperator;
}());
var TimestampSubscriber = (function (_super) {
    __extends(TimestampSubscriber, _super);
    function TimestampSubscriber(destination, scheduler) {
        _super.call(this, destination);
        this.scheduler = scheduler;
    }
    TimestampSubscriber.prototype._next = function (value) {
        var now = this.scheduler.now();
        this.destination.next(new Timestamp(value, now));
    };
    return TimestampSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=timestamp.js.map

/***/ }),
/* 511 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 AsyncAction_1 = __webpack_require__(108);
var AsyncScheduler_1 = __webpack_require__(109);
var VirtualTimeScheduler = (function (_super) {
    __extends(VirtualTimeScheduler, _super);
    function VirtualTimeScheduler(SchedulerAction, maxFrames) {
        var _this = this;
        if (SchedulerAction === void 0) { SchedulerAction = VirtualAction; }
        if (maxFrames === void 0) { maxFrames = Number.POSITIVE_INFINITY; }
        _super.call(this, SchedulerAction, function () { return _this.frame; });
        this.maxFrames = maxFrames;
        this.frame = 0;
        this.index = -1;
    }
    /**
     * Prompt the Scheduler to execute all of its queued actions, therefore
     * clearing its queue.
     * @return {void}
     */
    VirtualTimeScheduler.prototype.flush = function () {
        var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
        var error, action;
        while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) {
            if (error = action.execute(action.state, action.delay)) {
                break;
            }
        }
        if (error) {
            while (action = actions.shift()) {
                action.unsubscribe();
            }
            throw error;
        }
    };
    VirtualTimeScheduler.frameTimeFactor = 10;
    return VirtualTimeScheduler;
}(AsyncScheduler_1.AsyncScheduler));
exports.VirtualTimeScheduler = VirtualTimeScheduler;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var VirtualAction = (function (_super) {
    __extends(VirtualAction, _super);
    function VirtualAction(scheduler, work, index) {
        if (index === void 0) { index = scheduler.index += 1; }
        _super.call(this, scheduler, work);
        this.scheduler = scheduler;
        this.work = work;
        this.index = index;
        this.active = true;
        this.index = scheduler.index = index;
    }
    VirtualAction.prototype.schedule = function (state, delay) {
        if (delay === void 0) { delay = 0; }
        if (!this.id) {
            return _super.prototype.schedule.call(this, state, delay);
        }
        this.active = false;
        // If an action is rescheduled, we save allocations by mutating its state,
        // pushing it to the end of the scheduler queue, and recycling the action.
        // But since the VirtualTimeScheduler is used for testing, VirtualActions
        // must be immutable so they can be inspected later.
        var action = new VirtualAction(this.scheduler, this.work);
        this.add(action);
        return action.schedule(state, delay);
    };
    VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        this.delay = scheduler.frame + delay;
        var actions = scheduler.actions;
        actions.push(this);
        actions.sort(VirtualAction.sortActions);
        return true;
    };
    VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        return undefined;
    };
    VirtualAction.prototype._execute = function (state, delay) {
        if (this.active === true) {
            return _super.prototype._execute.call(this, state, delay);
        }
    };
    VirtualAction.sortActions = function (a, b) {
        if (a.delay === b.delay) {
            if (a.index === b.index) {
                return 0;
            }
            else if (a.index > b.index) {
                return 1;
            }
            else {
                return -1;
            }
        }
        else if (a.delay > b.delay) {
            return 1;
        }
        else {
            return -1;
        }
    };
    return VirtualAction;
}(AsyncAction_1.AsyncAction));
exports.VirtualAction = VirtualAction;
//# sourceMappingURL=VirtualTimeScheduler.js.map

/***/ }),
/* 512 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var AnimationFrameAction_1 = __webpack_require__(1022);
var AnimationFrameScheduler_1 = __webpack_require__(1023);
/**
 *
 * Animation Frame Scheduler
 *
 * <span class="informal">Perform task when `window.requestAnimationFrame` would fire</span>
 *
 * When `animationFrame` scheduler is used with delay, it will fall back to {@link async} scheduler
 * behaviour.
 *
 * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.
 * It makes sure scheduled task will happen just before next browser content repaint,
 * thus performing animations as efficiently as possible.
 *
 * @example <caption>Schedule div height animation</caption>
 * const div = document.querySelector('.some-div');
 *
 * Rx.Scheduler.schedule(function(height) {
 *   div.style.height = height + "px";
 *
 *   this.schedule(height + 1);  // `this` references currently executing Action,
 *                               // which we reschedule with new state
 * }, 0, 0);
 *
 * // You will see .some-div element growing in height
 *
 *
 * @static true
 * @name animationFrame
 * @owner Scheduler
 */
exports.animationFrame = new AnimationFrameScheduler_1.AnimationFrameScheduler(AnimationFrameAction_1.AnimationFrameAction);
//# sourceMappingURL=animationFrame.js.map

/***/ }),
/* 513 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var AsapAction_1 = __webpack_require__(1024);
var AsapScheduler_1 = __webpack_require__(1025);
/**
 *
 * Asap Scheduler
 *
 * <span class="informal">Perform task as fast as it can be performed asynchronously</span>
 *
 * `asap` scheduler behaves the same as {@link async} scheduler when you use it to delay task
 * in time. If however you set delay to `0`, `asap` will wait for current synchronously executing
 * code to end and then it will try to execute given task as fast as possible.
 *
 * `asap` scheduler will do its best to minimize time between end of currently executing code
 * and start of scheduled task. This makes it best candidate for performing so called "deferring".
 * Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves
 * some (although minimal) unwanted delay.
 *
 * Note that using `asap` scheduler does not necessarily mean that your task will be first to process
 * after currently executing code. In particular, if some task was also scheduled with `asap` before,
 * that task will execute first. That being said, if you need to schedule task asynchronously, but
 * as soon as possible, `asap` scheduler is your best bet.
 *
 * @example <caption>Compare async and asap scheduler</caption>
 *
 * Rx.Scheduler.async.schedule(() => console.log('async')); // scheduling 'async' first...
 * Rx.Scheduler.asap.schedule(() => console.log('asap'));
 *
 * // Logs:
 * // "asap"
 * // "async"
 * // ... but 'asap' goes first!
 *
 * @static true
 * @name asap
 * @owner Scheduler
 */
exports.asap = new AsapScheduler_1.AsapScheduler(AsapAction_1.AsapAction);
//# sourceMappingURL=asap.js.map

/***/ }),
/* 514 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var QueueAction_1 = __webpack_require__(1026);
var QueueScheduler_1 = __webpack_require__(1027);
/**
 *
 * Queue Scheduler
 *
 * <span class="informal">Put every next task on a queue, instead of executing it immediately</span>
 *
 * `queue` scheduler, when used with delay, behaves the same as {@link async} scheduler.
 *
 * When used without delay, it schedules given task synchronously - executes it right when
 * it is scheduled. However when called recursively, that is when inside the scheduled task,
 * another task is scheduled with queue scheduler, instead of executing immediately as well,
 * that task will be put on a queue and wait for current one to finish.
 *
 * This means that when you execute task with `queue` scheduler, you are sure it will end
 * before any other task scheduled with that scheduler will start.
 *
 * @examples <caption>Schedule recursively first, then do something</caption>
 *
 * Rx.Scheduler.queue.schedule(() => {
 *   Rx.Scheduler.queue.schedule(() => console.log('second')); // will not happen now, but will be put on a queue
 *
 *   console.log('first');
 * });
 *
 * // Logs:
 * // "first"
 * // "second"
 *
 *
 * @example <caption>Reschedule itself recursively</caption>
 *
 * Rx.Scheduler.queue.schedule(function(state) {
 *   if (state !== 0) {
 *     console.log('before', state);
 *     this.schedule(state - 1); // `this` references currently executing Action,
 *                               // which we reschedule with new state
 *     console.log('after', state);
 *   }
 * }, 0, 3);
 *
 * // In scheduler that runs recursively, you would expect:
 * // "before", 3
 * // "before", 2
 * // "before", 1
 * // "after", 1
 * // "after", 2
 * // "after", 3
 *
 * // But with queue it logs:
 * // "before", 3
 * // "after", 3
 * // "before", 2
 * // "after", 2
 * // "before", 1
 * // "after", 1
 *
 *
 * @static true
 * @name queue
 * @owner Scheduler
 */
exports.queue = new QueueScheduler_1.QueueScheduler(QueueAction_1.QueueAction);
//# sourceMappingURL=queue.js.map

/***/ }),
/* 515 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var SubscriptionLog = (function () {
    function SubscriptionLog(subscribedFrame, unsubscribedFrame) {
        if (unsubscribedFrame === void 0) { unsubscribedFrame = Number.POSITIVE_INFINITY; }
        this.subscribedFrame = subscribedFrame;
        this.unsubscribedFrame = unsubscribedFrame;
    }
    return SubscriptionLog;
}());
exports.SubscriptionLog = SubscriptionLog;
//# sourceMappingURL=SubscriptionLog.js.map

/***/ }),
/* 516 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var SubscriptionLog_1 = __webpack_require__(515);
var SubscriptionLoggable = (function () {
    function SubscriptionLoggable() {
        this.subscriptions = [];
    }
    SubscriptionLoggable.prototype.logSubscribedFrame = function () {
        this.subscriptions.push(new SubscriptionLog_1.SubscriptionLog(this.scheduler.now()));
        return this.subscriptions.length - 1;
    };
    SubscriptionLoggable.prototype.logUnsubscribedFrame = function (index) {
        var subscriptionLogs = this.subscriptions;
        var oldSubscriptionLog = subscriptionLogs[index];
        subscriptionLogs[index] = new SubscriptionLog_1.SubscriptionLog(oldSubscriptionLog.subscribedFrame, this.scheduler.now());
    };
    return SubscriptionLoggable;
}());
exports.SubscriptionLoggable = SubscriptionLoggable;
//# sourceMappingURL=SubscriptionLoggable.js.map

/***/ }),
/* 517 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 __());
};
/**
 * An error thrown when duetime elapses.
 *
 * @see {@link timeout}
 *
 * @class TimeoutError
 */
var TimeoutError = (function (_super) {
    __extends(TimeoutError, _super);
    function TimeoutError() {
        var err = _super.call(this, 'Timeout has occurred');
        this.name = err.name = 'TimeoutError';
        this.stack = err.stack;
        this.message = err.message;
    }
    return TimeoutError;
}(Error));
exports.TimeoutError = TimeoutError;
//# sourceMappingURL=TimeoutError.js.map

/***/ }),
/* 518 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function applyMixins(derivedCtor, baseCtors) {
    for (var i = 0, len = baseCtors.length; i < len; i++) {
        var baseCtor = baseCtors[i];
        var propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype);
        for (var j = 0, len2 = propertyKeys.length; j < len2; j++) {
            var name_1 = propertyKeys[j];
            derivedCtor.prototype[name_1] = baseCtor.prototype[name_1];
        }
    }
}
exports.applyMixins = applyMixins;
//# sourceMappingURL=applyMixins.js.map

/***/ }),
/* 519 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

/* tslint:disable:no-empty */
function noop() { }
exports.noop = noop;
//# sourceMappingURL=noop.js.map

/***/ }),
/* 520 */
/***/ (function(module, exports, __webpack_require__) {

var apply = Function.prototype.apply;

// DOM APIs, for completeness

exports.setTimeout = function() {
  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) {
  if (timeout) {
    timeout.close();
  }
};

function Timeout(id, clearFn) {
  this._id = id;
  this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
  this._clearFn.call(window, this._id);
};

// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
  clearTimeout(item._idleTimeoutId);
  item._idleTimeout = msecs;
};

exports.unenroll = function(item) {
  clearTimeout(item._idleTimeoutId);
  item._idleTimeout = -1;
};

exports._unrefActive = exports.active = function(item) {
  clearTimeout(item._idleTimeoutId);

  var msecs = item._idleTimeout;
  if (msecs >= 0) {
    item._idleTimeoutId = setTimeout(function onTimeout() {
      if (item._onTimeout)
        item._onTimeout();
    }, msecs);
  }
};

// setimmediate attaches itself to the global object
__webpack_require__(1039);
exports.setImmediate = setImmediate;
exports.clearImmediate = clearImmediate;


/***/ }),
/* 521 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(15);

/***/ }),
/* 522 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(19);

/***/ }),
/* 523 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(23);

/***/ }),
/* 524 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(30);

/***/ }),
/* 525 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(33);

/***/ }),
/* 526 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(37);

/***/ }),
/* 527 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(78);

/***/ }),
/* 528 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(83);

/***/ }),
/* 529 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_reflect_metadata__ = __webpack_require__(810);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_reflect_metadata___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_reflect_metadata__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_zone_js__ = __webpack_require__(1054);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_zone_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_zone_js__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_bootstrap__ = __webpack_require__(1053);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_bootstrap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_bootstrap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_platform_browser_dynamic__ = __webpack_require__(1051);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_app_browser_module__ = __webpack_require__(785);






if (true) {
    module.hot.accept();
    module.hot.dispose(function () {
        // Before restarting the app, we create a new root element and dispose the old one
        var oldRootElem = document.querySelector('app');
        var newRootElem = document.createElement('app');
        oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem);
        modulePromise.then(function (appModule) { return appModule.destroy(); });
    });
}
else {
    enableProdMode();
}
// Note: @ng-tools/webpack looks for the following expression when performing production
// builds. Don't change how this line looks, otherwise you may break tree-shaking.
var modulePromise = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__angular_platform_browser_dynamic__["platformBrowserDynamic"])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_5__app_app_browser_module__["a" /* AppModule */]);


/***/ }),
/* 530 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(__resourceQuery, module) {/*eslint-env browser*/
/*global __resourceQuery __webpack_public_path__*/

var options = {
  path: "/__webpack_hmr",
  timeout: 20 * 1000,
  overlay: true,
  reload: false,
  log: true,
  warn: true,
  name: ''
};
if (true) {
  var querystring = __webpack_require__(809);
  var overrides = querystring.parse(__resourceQuery.slice(1));
  if (overrides.path) options.path = overrides.path;
  if (overrides.timeout) options.timeout = overrides.timeout;
  if (overrides.overlay) options.overlay = overrides.overlay !== 'false';
  if (overrides.reload) options.reload = overrides.reload !== 'false';
  if (overrides.noInfo && overrides.noInfo !== 'false') {
    options.log = false;
  }
  if (overrides.name) {
    options.name = overrides.name;
  }
  if (overrides.quiet && overrides.quiet !== 'false') {
    options.log = false;
    options.warn = false;
  }
  if (overrides.dynamicPublicPath) {
    options.path = __webpack_require__.p + options.path;
  }
}

if (typeof window === 'undefined') {
  // do nothing
} else if (typeof window.EventSource === 'undefined') {
  console.warn(
    "webpack-hot-middleware's client requires EventSource to work. " +
    "You should include a polyfill if you want to support this browser: " +
    "https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events#Tools"
  );
} else {
  connect();
}

function EventSourceWrapper() {
  var source;
  var lastActivity = new Date();
  var listeners = [];

  init();
  var timer = setInterval(function() {
    if ((new Date() - lastActivity) > options.timeout) {
      handleDisconnect();
    }
  }, options.timeout / 2);

  function init() {
    source = new window.EventSource(options.path);
    source.onopen = handleOnline;
    source.onerror = handleDisconnect;
    source.onmessage = handleMessage;
  }

  function handleOnline() {
    if (options.log) console.log("[HMR] connected");
    lastActivity = new Date();
  }

  function handleMessage(event) {
    lastActivity = new Date();
    for (var i = 0; i < listeners.length; i++) {
      listeners[i](event);
    }
  }

  function handleDisconnect() {
    clearInterval(timer);
    source.close();
    setTimeout(init, options.timeout);
  }

  return {
    addMessageListener: function(fn) {
      listeners.push(fn);
    }
  };
}

function getEventSourceWrapper() {
  if (!window.__whmEventSourceWrapper) {
    window.__whmEventSourceWrapper = {};
  }
  if (!window.__whmEventSourceWrapper[options.path]) {
    // cache the wrapper for other entries loaded on
    // the same page with the same options.path
    window.__whmEventSourceWrapper[options.path] = EventSourceWrapper();
  }
  return window.__whmEventSourceWrapper[options.path];
}

function connect() {
  getEventSourceWrapper().addMessageListener(handleMessage);

  function handleMessage(event) {
    if (event.data == "\uD83D\uDC93") {
      return;
    }
    try {
      processMessage(JSON.parse(event.data));
    } catch (ex) {
      if (options.warn) {
        console.warn("Invalid HMR message: " + event.data + "\n" + ex);
      }
    }
  }
}

// the reporter needs to be a singleton on the page
// in case the client is being used by multiple bundles
// we only want to report once.
// all the errors will go to all clients
var singletonKey = '__webpack_hot_middleware_reporter__';
var reporter;
if (typeof window !== 'undefined') {
  if (!window[singletonKey]) {
    window[singletonKey] = createReporter();
  }
  reporter = window[singletonKey];
}

function createReporter() {
  var strip = __webpack_require__(1040);

  var overlay;
  if (typeof document !== 'undefined' && options.overlay) {
    overlay = __webpack_require__(1043);
  }

  var styles = {
    errors: "color: #ff0000;",
    warnings: "color: #999933;"
  };
  var previousProblems = null;
  function log(type, obj) {
    var newProblems = obj[type].map(function(msg) { return strip(msg); }).join('\n');
    if (previousProblems == newProblems) {
      return;
    } else {
      previousProblems = newProblems;
    }

    var style = styles[type];
    var name = obj.name ? "'" + obj.name + "' " : "";
    var title = "[HMR] bundle " + name + "has " + obj[type].length + " " + type;
    // NOTE: console.warn or console.error will print the stack trace
    // which isn't helpful here, so using console.log to escape it.
    if (console.group && console.groupEnd) {
      console.group("%c" + title, style);
      console.log("%c" + newProblems, style);
      console.groupEnd();
    } else {
      console.log(
        "%c" + title + "\n\t%c" + newProblems.replace(/\n/g, "\n\t"),
        style + "font-weight: bold;",
        style + "font-weight: normal;"
      );
    }
  }

  return {
    cleanProblemsCache: function () {
      previousProblems = null;
    },
    problems: function(type, obj) {
      if (options.warn) {
        log(type, obj);
      }
      if (overlay && type !== 'warnings') overlay.showProblems(type, obj[type]);
    },
    success: function() {
      if (overlay) overlay.clear();
    },
    useCustomOverlay: function(customOverlay) {
      overlay = customOverlay;
    }
  };
}

var processUpdate = __webpack_require__(1044);

var customHandler;
var subscribeAllHandler;
function processMessage(obj) {
  switch(obj.action) {
    case "building":
      if (options.log) {
        console.log(
          "[HMR] bundle " + (obj.name ? "'" + obj.name + "' " : "") +
          "rebuilding"
        );
      }
      break;
    case "built":
      if (options.log) {
        console.log(
          "[HMR] bundle " + (obj.name ? "'" + obj.name + "' " : "") +
          "rebuilt in " + obj.time + "ms"
        );
      }
      // fall through
    case "sync":
      if (obj.name && options.name && obj.name !== options.name) {
        return;
      }
      if (obj.errors.length > 0) {
        if (reporter) reporter.problems('errors', obj);
      } else {
        if (reporter) {
          if (obj.warnings.length > 0) {
            reporter.problems('warnings', obj);
          } else {
            reporter.cleanProblemsCache();
          }
          reporter.success();
        }
        processUpdate(obj.hash, obj.modules, options);
      }
      break;
    default:
      if (customHandler) {
        customHandler(obj);
      }
  }

  if (subscribeAllHandler) {
    subscribeAllHandler(obj);
  }
}

if (module) {
  module.exports = {
    subscribeAll: function subscribeAll(handler) {
      subscribeAllHandler = handler;
    },
    subscribe: function subscribe(handler) {
      customHandler = handler;
    },
    useCustomOverlay: function useCustomOverlay(customOverlay) {
      if (reporter) reporter.useCustomOverlay(customOverlay);
    }
  };
}

/* WEBPACK VAR INJECTION */}.call(exports, "?path=__webpack_hmr&dynamicPublicPath=true", __webpack_require__(1045)(module)))

/***/ }),
/* 531 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(45);

/***/ }),
/* 532 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return AnimationDriver; });
/* unused harmony export ɵAnimation */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return AnimationStyleNormalizer; });
/* unused harmony export ɵNoopAnimationStyleNormalizer */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return WebAnimationsStyleNormalizer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return NoopAnimationDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationEngine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WebAnimationsDriver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return supportsWebAnimations; });
/* unused harmony export ɵWebAnimationsPlayer */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_animations__ = __webpack_require__(526);

/**
 * @license Angular v4.2.5
 * (c) 2010-2017 Google, Inc. https://angular.io/
 * License: MIT
 */

/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
function optimizeGroupPlayer(players) {
    switch (players.length) {
        case 0:
            return new __WEBPACK_IMPORTED_MODULE_1__angular_animations__["NoopAnimationPlayer"]();
        case 1:
            return players[0];
        default:
            return new __WEBPACK_IMPORTED_MODULE_1__angular_animations__["ɵAnimationGroupPlayer"](players);
    }
}
function normalizeKeyframes(driver, normalizer, element, keyframes, preStyles, postStyles) {
    if (preStyles === void 0) { preStyles = {}; }
    if (postStyles === void 0) { postStyles = {}; }
    var errors = [];
    var normalizedKeyframes = [];
    var previousOffset = -1;
    var previousKeyframe = null;
    keyframes.forEach(function (kf) {
        var offset = kf['offset'];
        var isSameOffset = offset == previousOffset;
        var normalizedKeyframe = (isSameOffset && previousKeyframe) || {};
        Object.keys(kf).forEach(function (prop) {
            var normalizedProp = prop;
            var normalizedValue = kf[prop];
            if (normalizedValue == __WEBPACK_IMPORTED_MODULE_1__angular_animations__["ɵPRE_STYLE"]) {
                normalizedValue = preStyles[prop];
            }
            else if (normalizedValue == __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"]) {
                normalizedValue = postStyles[prop];
            }
            else if (prop != 'offset') {
                normalizedProp = normalizer.normalizePropertyName(prop, errors);
                normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, kf[prop], errors);
            }
            normalizedKeyframe[normalizedProp] = normalizedValue;
        });
        if (!isSameOffset) {
            normalizedKeyframes.push(normalizedKeyframe);
        }
        previousKeyframe = normalizedKeyframe;
        previousOffset = offset;
    });
    if (errors.length) {
        var LINE_START = '\n - ';
        throw new Error("Unable to animate due to the following errors:" + LINE_START + errors.join(LINE_START));
    }
    return normalizedKeyframes;
}
function listenOnPlayer(player, eventName, event, callback) {
    switch (eventName) {
        case 'start':
            player.onStart(function () { return callback(event && copyAnimationEvent(event, 'start', player.totalTime)); });
            break;
        case 'done':
            player.onDone(function () { return callback(event && copyAnimationEvent(event, 'done', player.totalTime)); });
            break;
        case 'destroy':
            player.onDestroy(function () { return callback(event && copyAnimationEvent(event, 'destroy', player.totalTime)); });
            break;
    }
}
function copyAnimationEvent(e, phaseName, totalTime) {
    var event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime);
    var data = e['_data'];
    if (data != null) {
        event['_data'] = data;
    }
    return event;
}
function makeAnimationEvent(element, triggerName, fromState, toState, phaseName, totalTime) {
    if (phaseName === void 0) { phaseName = ''; }
    if (totalTime === void 0) { totalTime = 0; }
    return { element: element, triggerName: triggerName, fromState: fromState, toState: toState, phaseName: phaseName, totalTime: totalTime };
}
function getOrSetAsInMap(map, key, defaultValue) {
    var value;
    if (map instanceof Map) {
        value = map.get(key);
        if (!value) {
            map.set(key, value = defaultValue);
        }
    }
    else {
        value = map[key];
        if (!value) {
            value = map[key] = defaultValue;
        }
    }
    return value;
}
function parseTimelineCommand(command) {
    var separatorPos = command.indexOf(':');
    var id = command.substring(1, separatorPos);
    var action = command.substr(separatorPos + 1);
    return [id, action];
}
var _contains = function (elm1, elm2) { return false; };
var _matches = function (element, selector) { return false; };
var _query = function (element, selector, multi) {
    return [];
};
if (typeof Element != 'undefined') {
    // this is well supported in all browsers
    _contains = function (elm1, elm2) { return elm1.contains(elm2); };
    if (Element.prototype.matches) {
        _matches = function (element, selector) { return element.matches(selector); };
    }
    else {
        var proto = Element.prototype;
        var fn_1 = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector ||
            proto.oMatchesSelector || proto.webkitMatchesSelector;
        if (fn_1) {
            _matches = function (element, selector) { return fn_1.apply(element, [selector]); };
        }
    }
    _query = function (element, selector, multi) {
        var results = [];
        if (multi) {
            results.push.apply(results, element.querySelectorAll(selector));
        }
        else {
            var elm = element.querySelector(selector);
            if (elm) {
                results.push(elm);
            }
        }
        return results;
    };
}
var matchesElement = _matches;
var containsElement = _contains;
var invokeQuery = _query;
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @experimental
 */
var NoopAnimationDriver = (function () {
    function NoopAnimationDriver() {
    }
    NoopAnimationDriver.prototype.matchesElement = function (element, selector) {
        return matchesElement(element, selector);
    };
    NoopAnimationDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };
    NoopAnimationDriver.prototype.query = function (element, selector, multi) {
        return invokeQuery(element, selector, multi);
    };
    NoopAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) {
        return defaultValue || '';
    };
    NoopAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) {
        if (previousPlayers === void 0) { previousPlayers = []; }
        return new __WEBPACK_IMPORTED_MODULE_1__angular_animations__["NoopAnimationPlayer"]();
    };
    return NoopAnimationDriver;
}());
/**
 * @experimental
 */
var AnimationDriver = (function () {
    function AnimationDriver() {
    }
    return AnimationDriver;
}());
AnimationDriver.NOOP = new NoopAnimationDriver();
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var ONE_SECOND = 1000;
var ENTER_CLASSNAME = 'ng-enter';
var LEAVE_CLASSNAME = 'ng-leave';
var ENTER_SELECTOR = '.ng-enter';
var LEAVE_SELECTOR = '.ng-leave';
var NG_TRIGGER_CLASSNAME = 'ng-trigger';
var NG_TRIGGER_SELECTOR = '.ng-trigger';
var NG_ANIMATING_CLASSNAME = 'ng-animating';
var NG_ANIMATING_SELECTOR = '.ng-animating';
/**
 * @param {?} value
 * @return {?}
 */
function resolveTimingValue(value) {
    if (typeof value == 'number')
        return value;
    var /** @type {?} */ matches = ((value)).match(/^(-?[\.\d]+)(m?s)/);
    if (!matches || matches.length < 2)
        return 0;
    return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
}
/**
 * @param {?} value
 * @param {?} unit
 * @return {?}
 */
function _convertTimeValueToMS(value, unit) {
    switch (unit) {
        case 's':
            return value * ONE_SECOND;
        default:
            return value;
    }
}
/**
 * @param {?} timings
 * @param {?} errors
 * @param {?=} allowNegativeValues
 * @return {?}
 */
function resolveTiming(timings, errors, allowNegativeValues) {
    return timings.hasOwnProperty('duration') ? (timings) :
        parseTimeExpression(/** @type {?} */ (timings), errors, allowNegativeValues);
}
/**
 * @param {?} exp
 * @param {?} errors
 * @param {?=} allowNegativeValues
 * @return {?}
 */
function parseTimeExpression(exp, errors, allowNegativeValues) {
    var /** @type {?} */ regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
    var /** @type {?} */ duration;
    var /** @type {?} */ delay = 0;
    var /** @type {?} */ easing = '';
    if (typeof exp === 'string') {
        var /** @type {?} */ matches = exp.match(regex);
        if (matches === null) {
            errors.push("The provided timing value \"" + exp + "\" is invalid.");
            return { duration: 0, delay: 0, easing: '' };
        }
        duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
        var /** @type {?} */ delayMatch = matches[3];
        if (delayMatch != null) {
            delay = _convertTimeValueToMS(Math.floor(parseFloat(delayMatch)), matches[4]);
        }
        var /** @type {?} */ easingVal = matches[5];
        if (easingVal) {
            easing = easingVal;
        }
    }
    else {
        duration = (exp);
    }
    if (!allowNegativeValues) {
        var /** @type {?} */ containsErrors = false;
        var /** @type {?} */ startIndex = errors.length;
        if (duration < 0) {
            errors.push("Duration values below 0 are not allowed for this animation step.");
            containsErrors = true;
        }
        if (delay < 0) {
            errors.push("Delay values below 0 are not allowed for this animation step.");
            containsErrors = true;
        }
        if (containsErrors) {
            errors.splice(startIndex, 0, "The provided timing value \"" + exp + "\" is invalid.");
        }
    }
    return { duration: duration, delay: delay, easing: easing };
}
/**
 * @param {?} obj
 * @param {?=} destination
 * @return {?}
 */
function copyObj(obj, destination) {
    if (destination === void 0) { destination = {}; }
    Object.keys(obj).forEach(function (prop) { destination[prop] = obj[prop]; });
    return destination;
}
/**
 * @param {?} styles
 * @return {?}
 */
function normalizeStyles(styles) {
    var /** @type {?} */ normalizedStyles = {};
    if (Array.isArray(styles)) {
        styles.forEach(function (data) { return copyStyles(data, false, normalizedStyles); });
    }
    else {
        copyStyles(styles, false, normalizedStyles);
    }
    return normalizedStyles;
}
/**
 * @param {?} styles
 * @param {?} readPrototype
 * @param {?=} destination
 * @return {?}
 */
function copyStyles(styles, readPrototype, destination) {
    if (destination === void 0) { destination = {}; }
    if (readPrototype) {
        // we make use of a for-in loop so that the
        // prototypically inherited properties are
        // revealed from the backFill map
        for (var /** @type {?} */ prop in styles) {
            destination[prop] = styles[prop];
        }
    }
    else {
        copyObj(styles, destination);
    }
    return destination;
}
/**
 * @param {?} element
 * @param {?} styles
 * @return {?}
 */
function setStyles(element, styles) {
    if (element['style']) {
        Object.keys(styles).forEach(function (prop) {
            var /** @type {?} */ camelProp = dashCaseToCamelCase(prop);
            element.style[camelProp] = styles[prop];
        });
    }
}
/**
 * @param {?} element
 * @param {?} styles
 * @return {?}
 */
function eraseStyles(element, styles) {
    if (element['style']) {
        Object.keys(styles).forEach(function (prop) {
            var /** @type {?} */ camelProp = dashCaseToCamelCase(prop);
            element.style[camelProp] = '';
        });
    }
}
/**
 * @param {?} steps
 * @return {?}
 */
function normalizeAnimationEntry(steps) {
    if (Array.isArray(steps)) {
        if (steps.length == 1)
            return steps[0];
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_animations__["sequence"])(steps);
    }
    return (steps);
}
/**
 * @param {?} value
 * @param {?} options
 * @param {?} errors
 * @return {?}
 */
function validateStyleParams(value, options, errors) {
    var /** @type {?} */ params = options.params || {};
    if (typeof value !== 'string')
        return;
    var /** @type {?} */ matches = value.toString().match(PARAM_REGEX);
    if (matches) {
        matches.forEach(function (varName) {
            if (!params.hasOwnProperty(varName)) {
                errors.push("Unable to resolve the local animation param " + varName + " in the given list of values");
            }
        });
    }
}
var PARAM_REGEX = /\{\{\s*(.+?)\s*\}\}/g;
/**
 * @param {?} value
 * @param {?} params
 * @param {?} errors
 * @return {?}
 */
function interpolateParams(value, params, errors) {
    var /** @type {?} */ original = value.toString();
    var /** @type {?} */ str = original.replace(PARAM_REGEX, function (_, varName) {
        var /** @type {?} */ localVal = params[varName];
        // this means that the value was never overidden by the data passed in by the user
        if (!params.hasOwnProperty(varName)) {
            errors.push("Please provide a value for the animation param " + varName);
            localVal = '';
        }
        return localVal.toString();
    });
    // we do this to assert that numeric values stay as they are
    return str == original ? value : str;
}
/**
 * @param {?} iterator
 * @return {?}
 */
function iteratorToArray(iterator) {
    var /** @type {?} */ arr = [];
    var /** @type {?} */ item = iterator.next();
    while (!item.done) {
        arr.push(item.value);
        item = iterator.next();
    }
    return arr;
}
/**
 * @param {?} source
 * @param {?} destination
 * @return {?}
 */
function mergeAnimationOptions(source, destination) {
    if (source.params) {
        var /** @type {?} */ p0_1 = source.params;
        if (!destination.params) {
            destination.params = {};
        }
        var /** @type {?} */ p1_1 = destination.params;
        Object.keys(p0_1).forEach(function (param) {
            if (!p1_1.hasOwnProperty(param)) {
                p1_1[param] = p0_1[param];
            }
        });
    }
    return destination;
}
var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
/**
 * @param {?} input
 * @return {?}
 */
function dashCaseToCamelCase(input) {
    return input.replace(DASH_CASE_REGEXP, function () {
        var m = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            m[_i] = arguments[_i];
        }
        return m[1].toUpperCase();
    });
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var EMPTY_ANIMATION_OPTIONS = {};
/**
 * @abstract
 */
var Ast = (function () {
    function Ast() {
        this.options = EMPTY_ANIMATION_OPTIONS;
    }
    /**
     * @abstract
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    Ast.prototype.visit = function (ast, context) { };
    Object.defineProperty(Ast.prototype, "params", {
        /**
         * @return {?}
         */
        get: function () { return this.options['params'] || null; },
        enumerable: true,
        configurable: true
    });
    return Ast;
}());
var TriggerAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TriggerAst, _super);
    /**
     * @param {?} name
     * @param {?} states
     * @param {?} transitions
     */
    function TriggerAst(name, states, transitions) {
        var _this = _super.call(this) || this;
        _this.name = name;
        _this.states = states;
        _this.transitions = transitions;
        _this.queryCount = 0;
        _this.depCount = 0;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    TriggerAst.prototype.visit = function (visitor, context) { return visitor.visitTrigger(this, context); };
    return TriggerAst;
}(Ast));
var StateAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StateAst, _super);
    /**
     * @param {?} name
     * @param {?} style
     */
    function StateAst(name, style$$1) {
        var _this = _super.call(this) || this;
        _this.name = name;
        _this.style = style$$1;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    StateAst.prototype.visit = function (visitor, context) { return visitor.visitState(this, context); };
    return StateAst;
}(Ast));
var TransitionAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TransitionAst, _super);
    /**
     * @param {?} matchers
     * @param {?} animation
     */
    function TransitionAst(matchers, animation) {
        var _this = _super.call(this) || this;
        _this.matchers = matchers;
        _this.animation = animation;
        _this.queryCount = 0;
        _this.depCount = 0;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    TransitionAst.prototype.visit = function (visitor, context) { return visitor.visitTransition(this, context); };
    return TransitionAst;
}(Ast));
var SequenceAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](SequenceAst, _super);
    /**
     * @param {?} steps
     */
    function SequenceAst(steps) {
        var _this = _super.call(this) || this;
        _this.steps = steps;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    SequenceAst.prototype.visit = function (visitor, context) { return visitor.visitSequence(this, context); };
    return SequenceAst;
}(Ast));
var GroupAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](GroupAst, _super);
    /**
     * @param {?} steps
     */
    function GroupAst(steps) {
        var _this = _super.call(this) || this;
        _this.steps = steps;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    GroupAst.prototype.visit = function (visitor, context) { return visitor.visitGroup(this, context); };
    return GroupAst;
}(Ast));
var AnimateAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AnimateAst, _super);
    /**
     * @param {?} timings
     * @param {?} style
     */
    function AnimateAst(timings, style$$1) {
        var _this = _super.call(this) || this;
        _this.timings = timings;
        _this.style = style$$1;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    AnimateAst.prototype.visit = function (visitor, context) { return visitor.visitAnimate(this, context); };
    return AnimateAst;
}(Ast));
var StyleAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StyleAst, _super);
    /**
     * @param {?} styles
     * @param {?} easing
     * @param {?} offset
     */
    function StyleAst(styles, easing, offset) {
        var _this = _super.call(this) || this;
        _this.styles = styles;
        _this.easing = easing;
        _this.offset = offset;
        _this.isEmptyStep = false;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    StyleAst.prototype.visit = function (visitor, context) { return visitor.visitStyle(this, context); };
    return StyleAst;
}(Ast));
var KeyframesAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](KeyframesAst, _super);
    /**
     * @param {?} styles
     */
    function KeyframesAst(styles) {
        var _this = _super.call(this) || this;
        _this.styles = styles;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    KeyframesAst.prototype.visit = function (visitor, context) { return visitor.visitKeyframes(this, context); };
    return KeyframesAst;
}(Ast));
var ReferenceAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ReferenceAst, _super);
    /**
     * @param {?} animation
     */
    function ReferenceAst(animation) {
        var _this = _super.call(this) || this;
        _this.animation = animation;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    ReferenceAst.prototype.visit = function (visitor, context) { return visitor.visitReference(this, context); };
    return ReferenceAst;
}(Ast));
var AnimateChildAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AnimateChildAst, _super);
    function AnimateChildAst() {
        return _super.call(this) || this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    AnimateChildAst.prototype.visit = function (visitor, context) { return visitor.visitAnimateChild(this, context); };
    return AnimateChildAst;
}(Ast));
var AnimateRefAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AnimateRefAst, _super);
    /**
     * @param {?} animation
     */
    function AnimateRefAst(animation) {
        var _this = _super.call(this) || this;
        _this.animation = animation;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    AnimateRefAst.prototype.visit = function (visitor, context) { return visitor.visitAnimateRef(this, context); };
    return AnimateRefAst;
}(Ast));
var QueryAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](QueryAst, _super);
    /**
     * @param {?} selector
     * @param {?} limit
     * @param {?} optional
     * @param {?} includeSelf
     * @param {?} animation
     */
    function QueryAst(selector, limit, optional, includeSelf, animation) {
        var _this = _super.call(this) || this;
        _this.selector = selector;
        _this.limit = limit;
        _this.optional = optional;
        _this.includeSelf = includeSelf;
        _this.animation = animation;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    QueryAst.prototype.visit = function (visitor, context) { return visitor.visitQuery(this, context); };
    return QueryAst;
}(Ast));
var StaggerAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](StaggerAst, _super);
    /**
     * @param {?} timings
     * @param {?} animation
     */
    function StaggerAst(timings, animation) {
        var _this = _super.call(this) || this;
        _this.timings = timings;
        _this.animation = animation;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    StaggerAst.prototype.visit = function (visitor, context) { return visitor.visitStagger(this, context); };
    return StaggerAst;
}(Ast));
var TimingAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TimingAst, _super);
    /**
     * @param {?} duration
     * @param {?=} delay
     * @param {?=} easing
     */
    function TimingAst(duration, delay, easing) {
        if (delay === void 0) { delay = 0; }
        if (easing === void 0) { easing = null; }
        var _this = _super.call(this) || this;
        _this.duration = duration;
        _this.delay = delay;
        _this.easing = easing;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    TimingAst.prototype.visit = function (visitor, context) { return visitor.visitTiming(this, context); };
    return TimingAst;
}(Ast));
var DynamicTimingAst = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](DynamicTimingAst, _super);
    /**
     * @param {?} value
     */
    function DynamicTimingAst(value) {
        var _this = _super.call(this, 0, 0, '') || this;
        _this.value = value;
        return _this;
    }
    /**
     * @param {?} visitor
     * @param {?} context
     * @return {?}
     */
    DynamicTimingAst.prototype.visit = function (visitor, context) { return visitor.visitTiming(this, context); };
    return DynamicTimingAst;
}(TimingAst));
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @param {?} visitor
 * @param {?} node
 * @param {?} context
 * @return {?}
 */
function visitAnimationNode(visitor, node, context) {
    switch (node.type) {
        case 7 /* Trigger */:
            return visitor.visitTrigger(/** @type {?} */ (node), context);
        case 0 /* State */:
            return visitor.visitState(/** @type {?} */ (node), context);
        case 1 /* Transition */:
            return visitor.visitTransition(/** @type {?} */ (node), context);
        case 2 /* Sequence */:
            return visitor.visitSequence(/** @type {?} */ (node), context);
        case 3 /* Group */:
            return visitor.visitGroup(/** @type {?} */ (node), context);
        case 4 /* Animate */:
            return visitor.visitAnimate(/** @type {?} */ (node), context);
        case 5 /* Keyframes */:
            return visitor.visitKeyframes(/** @type {?} */ (node), context);
        case 6 /* Style */:
            return visitor.visitStyle(/** @type {?} */ (node), context);
        case 8 /* Reference */:
            return visitor.visitReference(/** @type {?} */ (node), context);
        case 9 /* AnimateChild */:
            return visitor.visitAnimateChild(/** @type {?} */ (node), context);
        case 10 /* AnimateRef */:
            return visitor.visitAnimateRef(/** @type {?} */ (node), context);
        case 11 /* Query */:
            return visitor.visitQuery(/** @type {?} */ (node), context);
        case 12 /* Stagger */:
            return visitor.visitStagger(/** @type {?} */ (node), context);
        default:
            throw new Error("Unable to resolve animation metadata node #" + node.type);
    }
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var ANY_STATE = '*';
/**
 * @param {?} transitionValue
 * @param {?} errors
 * @return {?}
 */
function parseTransitionExpr(transitionValue, errors) {
    var /** @type {?} */ expressions = [];
    if (typeof transitionValue == 'string') {
        ((transitionValue))
            .split(/\s*,\s*/)
            .forEach(function (str) { return parseInnerTransitionStr(str, expressions, errors); });
    }
    else {
        expressions.push(/** @type {?} */ (transitionValue));
    }
    return expressions;
}
/**
 * @param {?} eventStr
 * @param {?} expressions
 * @param {?} errors
 * @return {?}
 */
function parseInnerTransitionStr(eventStr, expressions, errors) {
    if (eventStr[0] == ':') {
        eventStr = parseAnimationAlias(eventStr, errors);
    }
    var /** @type {?} */ match = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);
    if (match == null || match.length < 4) {
        errors.push("The provided transition expression \"" + eventStr + "\" is not supported");
        return expressions;
    }
    var /** @type {?} */ fromState = match[1];
    var /** @type {?} */ separator = match[2];
    var /** @type {?} */ toState = match[3];
    expressions.push(makeLambdaFromStates(fromState, toState));
    var /** @type {?} */ isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;
    if (separator[0] == '<' && !isFullAnyStateExpr) {
        expressions.push(makeLambdaFromStates(toState, fromState));
    }
}
/**
 * @param {?} alias
 * @param {?} errors
 * @return {?}
 */
function parseAnimationAlias(alias, errors) {
    switch (alias) {
        case ':enter':
            return 'void => *';
        case ':leave':
            return '* => void';
        default:
            errors.push("The transition alias value \"" + alias + "\" is not supported");
            return '* => *';
    }
}
/**
 * @param {?} lhs
 * @param {?} rhs
 * @return {?}
 */
function makeLambdaFromStates(lhs, rhs) {
    return function (fromState, toState) {
        var /** @type {?} */ lhsMatch = lhs == ANY_STATE || lhs == fromState;
        var /** @type {?} */ rhsMatch = rhs == ANY_STATE || rhs == toState;
        if (!lhsMatch && typeof fromState === 'boolean') {
            lhsMatch = fromState ? lhs === 'true' : lhs === 'false';
        }
        if (!rhsMatch && typeof toState === 'boolean') {
            rhsMatch = toState ? rhs === 'true' : rhs === 'false';
        }
        return lhsMatch && rhsMatch;
    };
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var SELF_TOKEN = ':self';
var SELF_TOKEN_REGEX = new RegExp("s*" + SELF_TOKEN + "s*,?", 'g');
/**
 * @param {?} metadata
 * @param {?} errors
 * @return {?}
 */
function buildAnimationAst(metadata, errors) {
    return new AnimationAstBuilderVisitor().build(metadata, errors);
}
var LEAVE_TOKEN = ':leave';
var LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
var ENTER_TOKEN = ':enter';
var ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, 'g');
var ROOT_SELECTOR = '';
var AnimationAstBuilderVisitor = (function () {
    function AnimationAstBuilderVisitor() {
    }
    /**
     * @param {?} metadata
     * @param {?} errors
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.build = function (metadata, errors) {
        var /** @type {?} */ context = new AnimationAstBuilderContext(errors);
        this._resetContextStyleTimingState(context);
        return (visitAnimationNode(this, normalizeAnimationEntry(metadata), context));
    };
    /**
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype._resetContextStyleTimingState = function (context) {
        context.currentQuerySelector = ROOT_SELECTOR;
        context.collectedStyles = {};
        context.collectedStyles[ROOT_SELECTOR] = {};
        context.currentTime = 0;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitTrigger = function (metadata, context) {
        var _this = this;
        var /** @type {?} */ queryCount = context.queryCount = 0;
        var /** @type {?} */ depCount = context.depCount = 0;
        var /** @type {?} */ states = [];
        var /** @type {?} */ transitions = [];
        metadata.definitions.forEach(function (def) {
            _this._resetContextStyleTimingState(context);
            if (def.type == 0 /* State */) {
                var /** @type {?} */ stateDef_1 = (def);
                var /** @type {?} */ name = stateDef_1.name;
                name.split(/\s*,\s*/).forEach(function (n) {
                    stateDef_1.name = n;
                    states.push(_this.visitState(stateDef_1, context));
                });
                stateDef_1.name = name;
            }
            else if (def.type == 1 /* Transition */) {
                var /** @type {?} */ transition = _this.visitTransition(/** @type {?} */ (def), context);
                queryCount += transition.queryCount;
                depCount += transition.depCount;
                transitions.push(transition);
            }
            else {
                context.errors.push('only state() and transition() definitions can sit inside of a trigger()');
            }
        });
        var /** @type {?} */ ast = new TriggerAst(metadata.name, states, transitions);
        ast.options = normalizeAnimationOptions(metadata.options);
        ast.queryCount = queryCount;
        ast.depCount = depCount;
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitState = function (metadata, context) {
        return new StateAst(metadata.name, this.visitStyle(metadata.styles, context));
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitTransition = function (metadata, context) {
        context.queryCount = 0;
        context.depCount = 0;
        var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
        var /** @type {?} */ matchers = parseTransitionExpr(metadata.expr, context.errors);
        var /** @type {?} */ ast = new TransitionAst(matchers, entry);
        ast.options = normalizeAnimationOptions(metadata.options);
        ast.queryCount = context.queryCount;
        ast.depCount = context.depCount;
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitSequence = function (metadata, context) {
        var _this = this;
        var /** @type {?} */ ast = new SequenceAst(metadata.steps.map(function (s) { return visitAnimationNode(_this, s, context); }));
        ast.options = normalizeAnimationOptions(metadata.options);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitGroup = function (metadata, context) {
        var _this = this;
        var /** @type {?} */ currentTime = context.currentTime;
        var /** @type {?} */ furthestTime = 0;
        var /** @type {?} */ steps = metadata.steps.map(function (step) {
            context.currentTime = currentTime;
            var /** @type {?} */ innerAst = visitAnimationNode(_this, step, context);
            furthestTime = Math.max(furthestTime, context.currentTime);
            return innerAst;
        });
        context.currentTime = furthestTime;
        var /** @type {?} */ ast = new GroupAst(steps);
        ast.options = normalizeAnimationOptions(metadata.options);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitAnimate = function (metadata, context) {
        var /** @type {?} */ timingAst = constructTimingAst(metadata.timings, context.errors);
        context.currentAnimateTimings = timingAst;
        var /** @type {?} */ styles;
        var /** @type {?} */ styleMetadata = metadata.styles ? metadata.styles : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_animations__["style"])({});
        if (styleMetadata.type == 5 /* Keyframes */) {
            styles = this.visitKeyframes(/** @type {?} */ (styleMetadata), context);
        }
        else {
            var /** @type {?} */ styleMetadata_1 = (metadata.styles);
            var /** @type {?} */ isEmpty = false;
            if (!styleMetadata_1) {
                isEmpty = true;
                var /** @type {?} */ newStyleData = {};
                if (timingAst.easing) {
                    newStyleData['easing'] = timingAst.easing;
                }
                styleMetadata_1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_animations__["style"])(newStyleData);
            }
            context.currentTime += timingAst.duration + timingAst.delay;
            var /** @type {?} */ styleAst = this.visitStyle(styleMetadata_1, context);
            styleAst.isEmptyStep = isEmpty;
            styles = styleAst;
        }
        context.currentAnimateTimings = null;
        return new AnimateAst(timingAst, styles);
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitStyle = function (metadata, context) {
        var /** @type {?} */ ast = this._makeStyleAst(metadata, context);
        this._validateStyleAst(ast, context);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype._makeStyleAst = function (metadata, context) {
        var /** @type {?} */ styles = [];
        if (Array.isArray(metadata.styles)) {
            ((metadata.styles)).forEach(function (styleTuple) {
                if (typeof styleTuple == 'string') {
                    if (styleTuple == __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"]) {
                        styles.push(/** @type {?} */ (styleTuple));
                    }
                    else {
                        context.errors.push("The provided style string value " + styleTuple + " is not allowed.");
                    }
                }
                else {
                    styles.push(/** @type {?} */ (styleTuple));
                }
            });
        }
        else {
            styles.push(metadata.styles);
        }
        var /** @type {?} */ collectedEasing = null;
        styles.forEach(function (styleData) {
            if (isObject(styleData)) {
                var /** @type {?} */ styleMap = (styleData);
                var /** @type {?} */ easing = styleMap['easing'];
                if (easing) {
                    collectedEasing = (easing);
                    delete styleMap['easing'];
                }
            }
        });
        return new StyleAst(styles, collectedEasing, metadata.offset);
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype._validateStyleAst = function (ast, context) {
        var /** @type {?} */ timings = context.currentAnimateTimings;
        var /** @type {?} */ endTime = context.currentTime;
        var /** @type {?} */ startTime = context.currentTime;
        if (timings && startTime > 0) {
            startTime -= timings.duration + timings.delay;
        }
        ast.styles.forEach(function (tuple) {
            if (typeof tuple == 'string')
                return;
            Object.keys(tuple).forEach(function (prop) {
                var /** @type {?} */ collectedStyles = context.collectedStyles[((context.currentQuerySelector))];
                var /** @type {?} */ collectedEntry = collectedStyles[prop];
                var /** @type {?} */ updateCollectedStyle = true;
                if (collectedEntry) {
                    if (startTime != endTime && startTime >= collectedEntry.startTime &&
                        endTime <= collectedEntry.endTime) {
                        context.errors.push("The CSS property \"" + prop + "\" that exists between the times of \"" + collectedEntry.startTime + "ms\" and \"" + collectedEntry.endTime + "ms\" is also being animated in a parallel animation between the times of \"" + startTime + "ms\" and \"" + endTime + "ms\"");
                        updateCollectedStyle = false;
                    }
                    // we always choose the smaller start time value since we
                    // want to have a record of the entire animation window where
                    // the style property is being animated in between
                    startTime = collectedEntry.startTime;
                }
                if (updateCollectedStyle) {
                    collectedStyles[prop] = { startTime: startTime, endTime: endTime };
                }
                if (context.options) {
                    validateStyleParams(tuple[prop], context.options, context.errors);
                }
            });
        });
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitKeyframes = function (metadata, context) {
        var _this = this;
        if (!context.currentAnimateTimings) {
            context.errors.push("keyframes() must be placed inside of a call to animate()");
            return new KeyframesAst([]);
        }
        var /** @type {?} */ MAX_KEYFRAME_OFFSET = 1;
        var /** @type {?} */ totalKeyframesWithOffsets = 0;
        var /** @type {?} */ offsets = [];
        var /** @type {?} */ offsetsOutOfOrder = false;
        var /** @type {?} */ keyframesOutOfRange = false;
        var /** @type {?} */ previousOffset = 0;
        var /** @type {?} */ keyframes = metadata.steps.map(function (styles) {
            var /** @type {?} */ style$$1 = _this._makeStyleAst(styles, context);
            var /** @type {?} */ offsetVal = style$$1.offset != null ? style$$1.offset : consumeOffset(style$$1.styles);
            var /** @type {?} */ offset = 0;
            if (offsetVal != null) {
                totalKeyframesWithOffsets++;
                offset = style$$1.offset = offsetVal;
            }
            keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1;
            offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset;
            previousOffset = offset;
            offsets.push(offset);
            return style$$1;
        });
        if (keyframesOutOfRange) {
            context.errors.push("Please ensure that all keyframe offsets are between 0 and 1");
        }
        if (offsetsOutOfOrder) {
            context.errors.push("Please ensure that all keyframe offsets are in order");
        }
        var /** @type {?} */ length = metadata.steps.length;
        var /** @type {?} */ generatedOffset = 0;
        if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {
            context.errors.push("Not all style() steps within the declared keyframes() contain offsets");
        }
        else if (totalKeyframesWithOffsets == 0) {
            generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);
        }
        var /** @type {?} */ limit = length - 1;
        var /** @type {?} */ currentTime = context.currentTime;
        var /** @type {?} */ currentAnimateTimings = ((context.currentAnimateTimings));
        var /** @type {?} */ animateDuration = currentAnimateTimings.duration;
        keyframes.forEach(function (kf, i) {
            var /** @type {?} */ offset = generatedOffset > 0 ? (i == limit ? 1 : (generatedOffset * i)) : offsets[i];
            var /** @type {?} */ durationUpToThisFrame = offset * animateDuration;
            context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;
            currentAnimateTimings.duration = durationUpToThisFrame;
            _this._validateStyleAst(kf, context);
            kf.offset = offset;
        });
        return new KeyframesAst(keyframes);
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitReference = function (metadata, context) {
        var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
        var /** @type {?} */ ast = new ReferenceAst(entry);
        ast.options = normalizeAnimationOptions(metadata.options);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitAnimateChild = function (metadata, context) {
        context.depCount++;
        var /** @type {?} */ ast = new AnimateChildAst();
        ast.options = normalizeAnimationOptions(metadata.options);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitAnimateRef = function (metadata, context) {
        var /** @type {?} */ animation = this.visitReference(metadata.animation, context);
        var /** @type {?} */ ast = new AnimateRefAst(animation);
        ast.options = normalizeAnimationOptions(metadata.options);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitQuery = function (metadata, context) {
        var /** @type {?} */ parentSelector = ((context.currentQuerySelector));
        var /** @type {?} */ options = ((metadata.options || {}));
        context.queryCount++;
        context.currentQuery = metadata;
        var _a = normalizeSelector(metadata.selector), selector = _a[0], includeSelf = _a[1];
        context.currentQuerySelector =
            parentSelector.length ? (parentSelector + ' ' + selector) : selector;
        getOrSetAsInMap(context.collectedStyles, context.currentQuerySelector, {});
        var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
        context.currentQuery = null;
        context.currentQuerySelector = parentSelector;
        var /** @type {?} */ ast = new QueryAst(selector, options.limit || 0, !!options.optional, includeSelf, entry);
        ast.originalSelector = metadata.selector;
        ast.options = normalizeAnimationOptions(metadata.options);
        return ast;
    };
    /**
     * @param {?} metadata
     * @param {?} context
     * @return {?}
     */
    AnimationAstBuilderVisitor.prototype.visitStagger = function (metadata, context) {
        if (!context.currentQuery) {
            context.errors.push("stagger() can only be used inside of query()");
        }
        var /** @type {?} */ timings = metadata.timings === 'full' ?
            { duration: 0, delay: 0, easing: 'full' } :
            resolveTiming(metadata.timings, context.errors, true);
        var /** @type {?} */ animation = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
        return new StaggerAst(timings, animation);
    };
    return AnimationAstBuilderVisitor;
}());
/**
 * @param {?} selector
 * @return {?}
 */
function normalizeSelector(selector) {
    var /** @type {?} */ hasAmpersand = selector.split(/\s*,\s*/).find(function (token) { return token == SELF_TOKEN; }) ? true : false;
    if (hasAmpersand) {
        selector = selector.replace(SELF_TOKEN_REGEX, '');
    }
    selector = selector.replace(ENTER_TOKEN_REGEX, ENTER_SELECTOR)
        .replace(LEAVE_TOKEN_REGEX, LEAVE_SELECTOR)
        .replace(/@\*/g, NG_TRIGGER_SELECTOR)
        .replace(/@\w+/g, function (match) { return NG_TRIGGER_SELECTOR + '-' + match.substr(1); })
        .replace(/:animating/g, NG_ANIMATING_SELECTOR);
    return [selector, hasAmpersand];
}
/**
 * @param {?} obj
 * @return {?}
 */
function normalizeParams(obj) {
    return obj ? copyObj(obj) : null;
}
var AnimationAstBuilderContext = (function () {
    /**
     * @param {?} errors
     */
    function AnimationAstBuilderContext(errors) {
        this.errors = errors;
        this.queryCount = 0;
        this.depCount = 0;
        this.currentTransition = null;
        this.currentQuery = null;
        this.currentQuerySelector = null;
        this.currentAnimateTimings = null;
        this.currentTime = 0;
        this.collectedStyles = {};
        this.options = null;
    }
    return AnimationAstBuilderContext;
}());
/**
 * @param {?} styles
 * @return {?}
 */
function consumeOffset(styles) {
    if (typeof styles == 'string')
        return null;
    var /** @type {?} */ offset = null;
    if (Array.isArray(styles)) {
        styles.forEach(function (styleTuple) {
            if (isObject(styleTuple) && styleTuple.hasOwnProperty('offset')) {
                var /** @type {?} */ obj = (styleTuple);
                offset = parseFloat(/** @type {?} */ (obj['offset']));
                delete obj['offset'];
            }
        });
    }
    else if (isObject(styles) && styles.hasOwnProperty('offset')) {
        var /** @type {?} */ obj = (styles);
        offset = parseFloat(/** @type {?} */ (obj['offset']));
        delete obj['offset'];
    }
    return offset;
}
/**
 * @param {?} value
 * @return {?}
 */
function isObject(value) {
    return !Array.isArray(value) && typeof value == 'object';
}
/**
 * @param {?} value
 * @param {?} errors
 * @return {?}
 */
function constructTimingAst(value, errors) {
    var /** @type {?} */ timings = null;
    if (value.hasOwnProperty('duration')) {
        timings = (value);
    }
    else if (typeof value == 'number') {
        var /** @type {?} */ duration = resolveTiming(/** @type {?} */ (value), errors).duration;
        return new TimingAst(/** @type {?} */ (value), 0, '');
    }
    var /** @type {?} */ strValue = (value);
    var /** @type {?} */ isDynamic = strValue.split(/\s+/).some(function (v) { return v.charAt(0) == '{' && v.charAt(1) == '{'; });
    if (isDynamic) {
        return new DynamicTimingAst(strValue);
    }
    timings = timings || resolveTiming(strValue, errors);
    return new TimingAst(timings.duration, timings.delay, timings.easing);
}
/**
 * @param {?} options
 * @return {?}
 */
function normalizeAnimationOptions(options) {
    if (options) {
        options = copyObj(options);
        if (options['params']) {
            options['params'] = ((normalizeParams(options['params'])));
        }
    }
    else {
        options = {};
    }
    return options;
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @param {?} element
 * @param {?} keyframes
 * @param {?} preStyleProps
 * @param {?} postStyleProps
 * @param {?} duration
 * @param {?} delay
 * @param {?=} easing
 * @param {?=} subTimeline
 * @return {?}
 */
function createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing, subTimeline) {
    if (easing === void 0) { easing = null; }
    if (subTimeline === void 0) { subTimeline = false; }
    return {
        type: 1 /* TimelineAnimation */,
        element: element,
        keyframes: keyframes,
        preStyleProps: preStyleProps,
        postStyleProps: postStyleProps,
        duration: duration,
        delay: delay,
        totalTime: duration + delay, easing: easing, subTimeline: subTimeline
    };
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var ElementInstructionMap = (function () {
    function ElementInstructionMap() {
        this._map = new Map();
    }
    /**
     * @param {?} element
     * @return {?}
     */
    ElementInstructionMap.prototype.consume = function (element) {
        var /** @type {?} */ instructions = this._map.get(element);
        if (instructions) {
            this._map.delete(element);
        }
        else {
            instructions = [];
        }
        return instructions;
    };
    /**
     * @param {?} element
     * @param {?} instructions
     * @return {?}
     */
    ElementInstructionMap.prototype.append = function (element, instructions) {
        var /** @type {?} */ existingInstructions = this._map.get(element);
        if (!existingInstructions) {
            this._map.set(element, existingInstructions = []);
        }
        existingInstructions.push.apply(existingInstructions, instructions);
    };
    /**
     * @param {?} element
     * @return {?}
     */
    ElementInstructionMap.prototype.has = function (element) { return this._map.has(element); };
    /**
     * @return {?}
     */
    ElementInstructionMap.prototype.clear = function () { this._map.clear(); };
    return ElementInstructionMap;
}());
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var ONE_FRAME_IN_MILLISECONDS = 1;
/**
 * @param {?} driver
 * @param {?} rootElement
 * @param {?} ast
 * @param {?=} startingStyles
 * @param {?=} finalStyles
 * @param {?=} options
 * @param {?=} subInstructions
 * @param {?=} errors
 * @return {?}
 */
function buildAnimationTimelines(driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors) {
    if (startingStyles === void 0) { startingStyles = {}; }
    if (finalStyles === void 0) { finalStyles = {}; }
    if (errors === void 0) { errors = []; }
    return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors);
}
var AnimationTimelineBuilderVisitor = (function () {
    function AnimationTimelineBuilderVisitor() {
    }
    /**
     * @param {?} driver
     * @param {?} rootElement
     * @param {?} ast
     * @param {?} startingStyles
     * @param {?} finalStyles
     * @param {?} options
     * @param {?=} subInstructions
     * @param {?=} errors
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.buildKeyframes = function (driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors) {
        if (errors === void 0) { errors = []; }
        subInstructions = subInstructions || new ElementInstructionMap();
        var /** @type {?} */ context = new AnimationTimelineContext(driver, rootElement, subInstructions, errors, []);
        context.options = options;
        context.currentTimeline.setStyles([startingStyles], null, context.errors, options);
        ast.visit(this, context);
        // this checks to see if an actual animation happened
        var /** @type {?} */ timelines = context.timelines.filter(function (timeline) { return timeline.containsAnimation(); });
        if (timelines.length && Object.keys(finalStyles).length) {
            var /** @type {?} */ tl = timelines[timelines.length - 1];
            if (!tl.allowOnlyTimelineStyles()) {
                tl.setStyles([finalStyles], null, context.errors, options);
            }
        }
        return timelines.length ? timelines.map(function (timeline) { return timeline.buildKeyframes(); }) :
            [createTimelineInstruction(rootElement, [], [], [], 0, 0, '', false)];
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitTrigger = function (ast, context) {
        // these values are not visited in this AST
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitState = function (ast, context) {
        // these values are not visited in this AST
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitTransition = function (ast, context) {
        // these values are not visited in this AST
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitAnimateChild = function (ast, context) {
        var /** @type {?} */ elementInstructions = context.subInstructions.consume(context.element);
        if (elementInstructions) {
            var /** @type {?} */ innerContext = context.createSubContext(ast.options);
            var /** @type {?} */ startTime = context.currentTimeline.currentTime;
            var /** @type {?} */ endTime = this._visitSubInstructions(elementInstructions, innerContext, /** @type {?} */ (innerContext.options));
            if (startTime != endTime) {
                // we do this on the upper context because we created a sub context for
                // the sub child animations
                context.transformIntoNewTimeline(endTime);
            }
        }
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitAnimateRef = function (ast, context) {
        var /** @type {?} */ innerContext = context.createSubContext(ast.options);
        innerContext.transformIntoNewTimeline();
        this.visitReference(ast.animation, innerContext);
        context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);
        context.previousNode = ast;
    };
    /**
     * @param {?} instructions
     * @param {?} context
     * @param {?} options
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype._visitSubInstructions = function (instructions, context, options) {
        var /** @type {?} */ startTime = context.currentTimeline.currentTime;
        var /** @type {?} */ furthestTime = startTime;
        // this is a special-case for when a user wants to skip a sub
        // animation from being fired entirely.
        var /** @type {?} */ duration = options.duration != null ? resolveTimingValue(options.duration) : null;
        var /** @type {?} */ delay = options.delay != null ? resolveTimingValue(options.delay) : null;
        if (duration !== 0) {
            instructions.forEach(function (instruction) {
                var /** @type {?} */ instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay);
                furthestTime =
                    Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);
            });
        }
        return furthestTime;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitReference = function (ast, context) {
        context.updateOptions(ast.options, true);
        ast.animation.visit(this, context);
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitSequence = function (ast, context) {
        var _this = this;
        var /** @type {?} */ subContextCount = context.subContextCount;
        var /** @type {?} */ ctx = context;
        var /** @type {?} */ options = ast.options;
        if (options && (options.params || options.delay)) {
            ctx = context.createSubContext(options);
            ctx.transformIntoNewTimeline();
            if (options.delay != null) {
                if (ctx.previousNode instanceof StyleAst) {
                    ctx.currentTimeline.snapshotCurrentStyles();
                    ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
                }
                var /** @type {?} */ delay = resolveTimingValue(options.delay);
                ctx.delayNextStep(delay);
            }
        }
        if (ast.steps.length) {
            ast.steps.forEach(function (s) { return s.visit(_this, ctx); });
            // this is here just incase the inner steps only contain or end with a style() call
            ctx.currentTimeline.applyStylesToKeyframe();
            // this means that some animation function within the sequence
            // ended up creating a sub timeline (which means the current
            // timeline cannot overlap with the contents of the sequence)
            if (ctx.subContextCount > subContextCount) {
                ctx.transformIntoNewTimeline();
            }
        }
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitGroup = function (ast, context) {
        var _this = this;
        var /** @type {?} */ innerTimelines = [];
        var /** @type {?} */ furthestTime = context.currentTimeline.currentTime;
        var /** @type {?} */ delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;
        ast.steps.forEach(function (s) {
            var /** @type {?} */ innerContext = context.createSubContext(ast.options);
            if (delay) {
                innerContext.delayNextStep(delay);
            }
            s.visit(_this, innerContext);
            furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);
            innerTimelines.push(innerContext.currentTimeline);
        });
        // this operation is run after the AST loop because otherwise
        // if the parent timeline's collected styles were updated then
        // it would pass in invalid data into the new-to-be forked items
        innerTimelines.forEach(function (timeline) { return context.currentTimeline.mergeTimelineCollectedStyles(timeline); });
        context.transformIntoNewTimeline(furthestTime);
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitTiming = function (ast, context) {
        if (ast instanceof DynamicTimingAst) {
            var /** @type {?} */ strValue = context.params ?
                interpolateParams(ast.value, context.params, context.errors) :
                ast.value.toString();
            return resolveTiming(strValue, context.errors);
        }
        else {
            return { duration: ast.duration, delay: ast.delay, easing: ast.easing };
        }
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitAnimate = function (ast, context) {
        var /** @type {?} */ timings = context.currentAnimateTimings = this.visitTiming(ast.timings, context);
        var /** @type {?} */ timeline = context.currentTimeline;
        if (timings.delay) {
            context.incrementTime(timings.delay);
            timeline.snapshotCurrentStyles();
        }
        var /** @type {?} */ style$$1 = ast.style;
        if (style$$1 instanceof KeyframesAst) {
            this.visitKeyframes(style$$1, context);
        }
        else {
            context.incrementTime(timings.duration);
            this.visitStyle(/** @type {?} */ (style$$1), context);
            timeline.applyStylesToKeyframe();
        }
        context.currentAnimateTimings = null;
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitStyle = function (ast, context) {
        var /** @type {?} */ timeline = context.currentTimeline;
        var /** @type {?} */ timings = ((context.currentAnimateTimings));
        // this is a special case for when a style() call
        // directly follows  an animate() call (but not inside of an animate() call)
        if (!timings && timeline.getCurrentStyleProperties().length) {
            timeline.forwardFrame();
        }
        var /** @type {?} */ easing = (timings && timings.easing) || ast.easing;
        if (ast.isEmptyStep) {
            timeline.applyEmptyStep(easing);
        }
        else {
            timeline.setStyles(ast.styles, easing, context.errors, context.options);
        }
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitKeyframes = function (ast, context) {
        var /** @type {?} */ currentAnimateTimings = ((context.currentAnimateTimings));
        var /** @type {?} */ startTime = (((context.currentTimeline))).duration;
        var /** @type {?} */ duration = currentAnimateTimings.duration;
        var /** @type {?} */ innerContext = context.createSubContext();
        var /** @type {?} */ innerTimeline = innerContext.currentTimeline;
        innerTimeline.easing = currentAnimateTimings.easing;
        ast.styles.forEach(function (step) {
            var /** @type {?} */ offset = step.offset || 0;
            innerTimeline.forwardTime(offset * duration);
            innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options);
            innerTimeline.applyStylesToKeyframe();
        });
        // this will ensure that the parent timeline gets all the styles from
        // the child even if the new timeline below is not used
        context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);
        // we do this because the window between this timeline and the sub timeline
        // should ensure that the styles within are exactly the same as they were before
        context.transformIntoNewTimeline(startTime + duration);
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitQuery = function (ast, context) {
        var _this = this;
        // in the event that the first step before this is a style step we need
        // to ensure the styles are applied before the children are animated
        var /** @type {?} */ startTime = context.currentTimeline.currentTime;
        var /** @type {?} */ options = ((ast.options || {}));
        var /** @type {?} */ delay = options.delay ? resolveTimingValue(options.delay) : 0;
        if (delay && (context.previousNode instanceof StyleAst ||
            (startTime == 0 && context.currentTimeline.getCurrentStyleProperties().length))) {
            context.currentTimeline.snapshotCurrentStyles();
            context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
        }
        var /** @type {?} */ furthestTime = startTime;
        var /** @type {?} */ elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors);
        context.currentQueryTotal = elms.length;
        var /** @type {?} */ sameElementTimeline = null;
        elms.forEach(function (element, i) {
            context.currentQueryIndex = i;
            var /** @type {?} */ innerContext = context.createSubContext(ast.options, element);
            if (delay) {
                innerContext.delayNextStep(delay);
            }
            if (element === context.element) {
                sameElementTimeline = innerContext.currentTimeline;
            }
            ast.animation.visit(_this, innerContext);
            // this is here just incase the inner steps only contain or end
            // with a style() call (which is here to signal that this is a preparatory
            // call to style an element before it is animated again)
            innerContext.currentTimeline.applyStylesToKeyframe();
            var /** @type {?} */ endTime = innerContext.currentTimeline.currentTime;
            furthestTime = Math.max(furthestTime, endTime);
        });
        context.currentQueryIndex = 0;
        context.currentQueryTotal = 0;
        context.transformIntoNewTimeline(furthestTime);
        if (sameElementTimeline) {
            context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);
            context.currentTimeline.snapshotCurrentStyles();
        }
        context.previousNode = ast;
    };
    /**
     * @param {?} ast
     * @param {?} context
     * @return {?}
     */
    AnimationTimelineBuilderVisitor.prototype.visitStagger = function (ast, context) {
        var /** @type {?} */ parentContext = ((context.parentContext));
        var /** @type {?} */ tl = context.currentTimeline;
        var /** @type {?} */ timings = ast.timings;
        var /** @type {?} */ duration = Math.abs(timings.duration);
        var /** @type {?} */ maxTime = duration * (context.currentQueryTotal - 1);
        var /** @type {?} */ delay = duration * context.currentQueryIndex;
        var /** @type {?} */ staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing;
        switch (staggerTransformer) {
            case 'reverse':
                delay = maxTime - delay;
                break;
            case 'full':
                delay = parentContext.currentStaggerTime;
                break;
        }
        var /** @type {?} */ timeline = context.currentTimeline;
        if (delay) {
            timeline.delayNextStep(delay);
        }
        var /** @type {?} */ startingTime = timeline.currentTime;
        ast.animation.visit(this, context);
        context.previousNode = ast;
        // time = duration + delay
        // the reason why this computation is so complex is because
        // the inner timeline may either have a delay value or a stretched
        // keyframe depending on if a subtimeline is not used or is used.
        parentContext.currentStaggerTime =
            (tl.currentTime - startingTime) + (tl.startTime - parentContext.currentTimeline.startTime);
    };
    return AnimationTimelineBuilderVisitor;
}());
var DEFAULT_NOOP_PREVIOUS_NODE = ({});
var AnimationTimelineContext = (function () {
    /**
     * @param {?} _driver
     * @param {?} element
     * @param {?} subInstructions
     * @param {?} errors
     * @param {?} timelines
     * @param {?=} initialTimeline
     */
    function AnimationTimelineContext(_driver, element, subInstructions, errors, timelines, initialTimeline) {
        this._driver = _driver;
        this.element = element;
        this.subInstructions = subInstructions;
        this.errors = errors;
        this.timelines = timelines;
        this.parentContext = null;
        this.currentAnimateTimings = null;
        this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
        this.subContextCount = 0;
        this.options = {};
        this.currentQueryIndex = 0;
        this.currentQueryTotal = 0;
        this.currentStaggerTime = 0;
        this.currentTimeline = initialTimeline || new TimelineBuilder(element, 0);
        timelines.push(this.currentTimeline);
    }
    Object.defineProperty(AnimationTimelineContext.prototype, "params", {
        /**
         * @return {?}
         */
        get: function () { return this.options.params; },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} options
     * @param {?=} skipIfExists
     * @return {?}
     */
    AnimationTimelineContext.prototype.updateOptions = function (options, skipIfExists) {
        var _this = this;
        if (!options)
            return;
        var /** @type {?} */ newOptions = (options);
        var /** @type {?} */ optionsToUpdate = this.options;
        // NOTE: this will get patched up when other animation methods support duration overrides
        if (newOptions.duration != null) {
            ((optionsToUpdate)).duration = resolveTimingValue(newOptions.duration);
        }
        if (newOptions.delay != null) {
            optionsToUpdate.delay = resolveTimingValue(newOptions.delay);
        }
        var /** @type {?} */ newParams = newOptions.params;
        if (newParams) {
            var /** @type {?} */ paramsToUpdate_1 = ((optionsToUpdate.params));
            if (!paramsToUpdate_1) {
                paramsToUpdate_1 = this.options.params = {};
            }
            Object.keys(newParams).forEach(function (name) {
                if (!skipIfExists || !paramsToUpdate_1.hasOwnProperty(name)) {
                    paramsToUpdate_1[name] = interpolateParams(newParams[name], paramsToUpdate_1, _this.errors);
                }
            });
        }
    };
    /**
     * @return {?}
     */
    AnimationTimelineContext.prototype._copyOptions = function () {
        var /** @type {?} */ options = {};
        if (this.options) {
            var /** @type {?} */ oldParams_1 = this.options.params;
            if (oldParams_1) {
                var /** @type {?} */ params_1 = options['params'] = {};
                Object.keys(this.options.params).forEach(function (name) { params_1[name] = oldParams_1[name]; });
            }
        }
        return options;
    };
    /**
     * @param {?=} options
     * @param {?=} element
     * @param {?=} newTime
     * @return {?}
     */
    AnimationTimelineContext.prototype.createSubContext = function (options, element, newTime) {
        if (options === void 0) { options = null; }
        var /** @type {?} */ target = element || this.element;
        var /** @type {?} */ context = new AnimationTimelineContext(this._driver, target, this.subInstructions, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));
        context.previousNode = this.previousNode;
        context.currentAnimateTimings = this.currentAnimateTimings;
        context.options = this._copyOptions();
        context.updateOptions(options);
        context.currentQueryIndex = this.currentQueryIndex;
        context.currentQueryTotal = this.currentQueryTotal;
        context.parentContext = this;
        this.subContextCount++;
        return context;
    };
    /**
     * @param {?=} newTime
     * @return {?}
     */
    AnimationTimelineContext.prototype.transformIntoNewTimeline = function (newTime) {
        this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
        this.currentTimeline = this.currentTimeline.fork(this.element, newTime);
        this.timelines.push(this.currentTimeline);
        return this.currentTimeline;
    };
    /**
     * @param {?} instruction
     * @param {?} duration
     * @param {?} delay
     * @return {?}
     */
    AnimationTimelineContext.prototype.appendInstructionToTimeline = function (instruction, duration, delay) {
        var /** @type {?} */ updatedTimings = {
            duration: duration != null ? duration : instruction.duration,
            delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay,
            easing: ''
        };
        var /** @type {?} */ builder = new SubTimelineBuilder(instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);
        this.timelines.push(builder);
        return updatedTimings;
    };
    /**
     * @param {?} time
     * @return {?}
     */
    AnimationTimelineContext.prototype.incrementTime = function (time) {
        this.currentTimeline.forwardTime(this.currentTimeline.duration + time);
    };
    /**
     * @param {?} delay
     * @return {?}
     */
    AnimationTimelineContext.prototype.delayNextStep = function (delay) {
        // negative delays are not yet supported
        if (delay > 0) {
            this.currentTimeline.delayNextStep(delay);
        }
    };
    /**
     * @param {?} selector
     * @param {?} originalSelector
     * @param {?} limit
     * @param {?} includeSelf
     * @param {?} optional
     * @param {?} errors
     * @return {?}
     */
    AnimationTimelineContext.prototype.invokeQuery = function (selector, originalSelector, limit, includeSelf, optional, errors) {
        var /** @type {?} */ results = [];
        if (includeSelf) {
            results.push(this.element);
        }
        if (selector.length > 0) {
            var /** @type {?} */ multi = limit != 1;
            results.push.apply(results, this._driver.query(this.element, selector, multi));
        }
        if (!optional && results.length == 0) {
            errors.push("`query(\"" + originalSelector + "\")` returned zero elements. (Use `query(\"" + originalSelector + "\", { optional: true })` if you wish to allow this.)");
        }
        return results;
    };
    return AnimationTimelineContext;
}());
var TimelineBuilder = (function () {
    /**
     * @param {?} element
     * @param {?} startTime
     * @param {?=} _elementTimelineStylesLookup
     */
    function TimelineBuilder(element, startTime, _elementTimelineStylesLookup) {
        this.element = element;
        this.startTime = startTime;
        this._elementTimelineStylesLookup = _elementTimelineStylesLookup;
        this.duration = 0;
        this._previousKeyframe = {};
        this._currentKeyframe = {};
        this._keyframes = new Map();
        this._styleSummary = {};
        this._pendingStyles = {};
        this._backFill = {};
        this._currentEmptyStepKeyframe = null;
        if (!this._elementTimelineStylesLookup) {
            this._elementTimelineStylesLookup = new Map();
        }
        this._localTimelineStyles = Object.create(this._backFill, {});
        this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element);
        if (!this._globalTimelineStyles) {
            this._globalTimelineStyles = this._localTimelineStyles;
            this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);
        }
        this._loadKeyframe();
    }
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.containsAnimation = function () {
        switch (this._keyframes.size) {
            case 0:
                return false;
            case 1:
                return this.getCurrentStyleProperties().length > 0;
            default:
                return true;
        }
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.getCurrentStyleProperties = function () { return Object.keys(this._currentKeyframe); };
    Object.defineProperty(TimelineBuilder.prototype, "currentTime", {
        /**
         * @return {?}
         */
        get: function () { return this.startTime + this.duration; },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} delay
     * @return {?}
     */
    TimelineBuilder.prototype.delayNextStep = function (delay) {
        // in the event that a style() step is placed right before a stagger()
        // and that style() step is the very first style() value in the animation
        // then we need to make a copy of the keyframe [0, copy, 1] so that the delay
        // properly applies the style() values to work with the stagger...
        var /** @type {?} */ hasPreStyleStep = this._keyframes.size == 1 && Object.keys(this._pendingStyles).length;
        if (this.duration || hasPreStyleStep) {
            this.forwardTime(this.currentTime + delay);
            if (hasPreStyleStep) {
                this.snapshotCurrentStyles();
            }
        }
        else {
            this.startTime += delay;
        }
    };
    /**
     * @param {?} element
     * @param {?=} currentTime
     * @return {?}
     */
    TimelineBuilder.prototype.fork = function (element, currentTime) {
        this.applyStylesToKeyframe();
        return new TimelineBuilder(element, currentTime || this.currentTime, this._elementTimelineStylesLookup);
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype._loadKeyframe = function () {
        if (this._currentKeyframe) {
            this._previousKeyframe = this._currentKeyframe;
        }
        this._currentKeyframe = ((this._keyframes.get(this.duration)));
        if (!this._currentKeyframe) {
            this._currentKeyframe = Object.create(this._backFill, {});
            this._keyframes.set(this.duration, this._currentKeyframe);
        }
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.forwardFrame = function () {
        this.duration += ONE_FRAME_IN_MILLISECONDS;
        this._loadKeyframe();
    };
    /**
     * @param {?} time
     * @return {?}
     */
    TimelineBuilder.prototype.forwardTime = function (time) {
        this.applyStylesToKeyframe();
        this.duration = time;
        this._loadKeyframe();
    };
    /**
     * @param {?} prop
     * @param {?} value
     * @return {?}
     */
    TimelineBuilder.prototype._updateStyle = function (prop, value) {
        this._localTimelineStyles[prop] = value;
        this._globalTimelineStyles[prop] = value;
        this._styleSummary[prop] = { time: this.currentTime, value: value };
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.allowOnlyTimelineStyles = function () { return this._currentEmptyStepKeyframe !== this._currentKeyframe; };
    /**
     * @param {?} easing
     * @return {?}
     */
    TimelineBuilder.prototype.applyEmptyStep = function (easing) {
        var _this = this;
        if (easing) {
            this._previousKeyframe['easing'] = easing;
        }
        // special case for animate(duration):
        // all missing styles are filled with a `*` value then
        // if any destination styles are filled in later on the same
        // keyframe then they will override the overridden styles
        // We use `_globalTimelineStyles` here because there may be
        // styles in previous keyframes that are not present in this timeline
        Object.keys(this._globalTimelineStyles).forEach(function (prop) {
            _this._backFill[prop] = _this._globalTimelineStyles[prop] || __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"];
            _this._currentKeyframe[prop] = __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"];
        });
        this._currentEmptyStepKeyframe = this._currentKeyframe;
    };
    /**
     * @param {?} input
     * @param {?} easing
     * @param {?} errors
     * @param {?=} options
     * @return {?}
     */
    TimelineBuilder.prototype.setStyles = function (input, easing, errors, options) {
        var _this = this;
        if (easing) {
            this._previousKeyframe['easing'] = easing;
        }
        var /** @type {?} */ params = (options && options.params) || {};
        var /** @type {?} */ styles = flattenStyles(input, this._globalTimelineStyles);
        Object.keys(styles).forEach(function (prop) {
            var /** @type {?} */ val = interpolateParams(styles[prop], params, errors);
            _this._pendingStyles[prop] = val;
            if (!_this._localTimelineStyles.hasOwnProperty(prop)) {
                _this._backFill[prop] = _this._globalTimelineStyles.hasOwnProperty(prop) ?
                    _this._globalTimelineStyles[prop] :
                    __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"];
            }
            _this._updateStyle(prop, val);
        });
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.applyStylesToKeyframe = function () {
        var _this = this;
        var /** @type {?} */ styles = this._pendingStyles;
        var /** @type {?} */ props = Object.keys(styles);
        if (props.length == 0)
            return;
        this._pendingStyles = {};
        props.forEach(function (prop) {
            var /** @type {?} */ val = styles[prop];
            _this._currentKeyframe[prop] = val;
        });
        Object.keys(this._localTimelineStyles).forEach(function (prop) {
            if (!_this._currentKeyframe.hasOwnProperty(prop)) {
                _this._currentKeyframe[prop] = _this._localTimelineStyles[prop];
            }
        });
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.snapshotCurrentStyles = function () {
        var _this = this;
        Object.keys(this._localTimelineStyles).forEach(function (prop) {
            var /** @type {?} */ val = _this._localTimelineStyles[prop];
            _this._pendingStyles[prop] = val;
            _this._updateStyle(prop, val);
        });
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.getFinalKeyframe = function () { return this._keyframes.get(this.duration); };
    Object.defineProperty(TimelineBuilder.prototype, "properties", {
        /**
         * @return {?}
         */
        get: function () {
            var /** @type {?} */ properties = [];
            for (var /** @type {?} */ prop in this._currentKeyframe) {
                properties.push(prop);
            }
            return properties;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} timeline
     * @return {?}
     */
    TimelineBuilder.prototype.mergeTimelineCollectedStyles = function (timeline) {
        var _this = this;
        Object.keys(timeline._styleSummary).forEach(function (prop) {
            var /** @type {?} */ details0 = _this._styleSummary[prop];
            var /** @type {?} */ details1 = timeline._styleSummary[prop];
            if (!details0 || details1.time > details0.time) {
                _this._updateStyle(prop, details1.value);
            }
        });
    };
    /**
     * @return {?}
     */
    TimelineBuilder.prototype.buildKeyframes = function () {
        var _this = this;
        this.applyStylesToKeyframe();
        var /** @type {?} */ preStyleProps = new Set();
        var /** @type {?} */ postStyleProps = new Set();
        var /** @type {?} */ isEmpty = this._keyframes.size === 1 && this.duration === 0;
        var /** @type {?} */ finalKeyframes = [];
        this._keyframes.forEach(function (keyframe, time) {
            var /** @type {?} */ finalKeyframe = copyStyles(keyframe, true);
            Object.keys(finalKeyframe).forEach(function (prop) {
                var /** @type {?} */ value = finalKeyframe[prop];
                if (value == __WEBPACK_IMPORTED_MODULE_1__angular_animations__["ɵPRE_STYLE"]) {
                    preStyleProps.add(prop);
                }
                else if (value == __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"]) {
                    postStyleProps.add(prop);
                }
            });
            if (!isEmpty) {
                finalKeyframe['offset'] = time / _this.duration;
            }
            finalKeyframes.push(finalKeyframe);
        });
        var /** @type {?} */ preProps = preStyleProps.size ? iteratorToArray(preStyleProps.values()) : [];
        var /** @type {?} */ postProps = postStyleProps.size ? iteratorToArray(postStyleProps.values()) : [];
        // special case for a 0-second animation (which is designed just to place styles onscreen)
        if (isEmpty) {
            var /** @type {?} */ kf0 = finalKeyframes[0];
            var /** @type {?} */ kf1 = copyObj(kf0);
            kf0['offset'] = 0;
            kf1['offset'] = 1;
            finalKeyframes = [kf0, kf1];
        }
        return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false);
    };
    return TimelineBuilder;
}());
var SubTimelineBuilder = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](SubTimelineBuilder, _super);
    /**
     * @param {?} element
     * @param {?} keyframes
     * @param {?} preStyleProps
     * @param {?} postStyleProps
     * @param {?} timings
     * @param {?=} _stretchStartingKeyframe
     */
    function SubTimelineBuilder(element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe) {
        if (_stretchStartingKeyframe === void 0) { _stretchStartingKeyframe = false; }
        var _this = _super.call(this, element, timings.delay) || this;
        _this.element = element;
        _this.keyframes = keyframes;
        _this.preStyleProps = preStyleProps;
        _this.postStyleProps = postStyleProps;
        _this._stretchStartingKeyframe = _stretchStartingKeyframe;
        _this.timings = { duration: timings.duration, delay: timings.delay, easing: timings.easing };
        return _this;
    }
    /**
     * @return {?}
     */
    SubTimelineBuilder.prototype.containsAnimation = function () { return this.keyframes.length > 1; };
    /**
     * @return {?}
     */
    SubTimelineBuilder.prototype.buildKeyframes = function () {
        var /** @type {?} */ keyframes = this.keyframes;
        var _a = this.timings, delay = _a.delay, duration = _a.duration, easing = _a.easing;
        if (this._stretchStartingKeyframe && delay) {
            var /** @type {?} */ newKeyframes = [];
            var /** @type {?} */ totalTime = duration + delay;
            var /** @type {?} */ startingGap = delay / totalTime;
            // the original starting keyframe now starts once the delay is done
            var /** @type {?} */ newFirstKeyframe = copyStyles(keyframes[0], false);
            newFirstKeyframe['offset'] = 0;
            newKeyframes.push(newFirstKeyframe);
            var /** @type {?} */ oldFirstKeyframe = copyStyles(keyframes[0], false);
            oldFirstKeyframe['offset'] = roundOffset(startingGap);
            newKeyframes.push(oldFirstKeyframe);
            /*
              When the keyframe is stretched then it means that the delay before the animation
              starts is gone. Instead the first keyframe is placed at the start of the animation
              and it is then copied to where it starts when the original delay is over. This basically
              means nothing animates during that delay, but the styles are still renderered. For this
              to work the original offset values that exist in the original keyframes must be "warped"
              so that they can take the new keyframe + delay into account.
      
              delay=1000, duration=1000, keyframes = 0 .5 1
      
              turns into
      
              delay=0, duration=2000, keyframes = 0 .33 .66 1
             */
            // offsets between 1 ... n -1 are all warped by the keyframe stretch
            var /** @type {?} */ limit = keyframes.length - 1;
            for (var /** @type {?} */ i = 1; i <= limit; i++) {
                var /** @type {?} */ kf = copyStyles(keyframes[i], false);
                var /** @type {?} */ oldOffset = (kf['offset']);
                var /** @type {?} */ timeAtKeyframe = delay + oldOffset * duration;
                kf['offset'] = roundOffset(timeAtKeyframe / totalTime);
                newKeyframes.push(kf);
            }
            // the new starting keyframe should be added at the start
            duration = totalTime;
            delay = 0;
            easing = '';
            keyframes = newKeyframes;
        }
        return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing, true);
    };
    return SubTimelineBuilder;
}(TimelineBuilder));
/**
 * @param {?} offset
 * @param {?=} decimalPoints
 * @return {?}
 */
function roundOffset(offset, decimalPoints) {
    if (decimalPoints === void 0) { decimalPoints = 3; }
    var /** @type {?} */ mult = Math.pow(10, decimalPoints - 1);
    return Math.round(offset * mult) / mult;
}
/**
 * @param {?} input
 * @param {?} allStyles
 * @return {?}
 */
function flattenStyles(input, allStyles) {
    var /** @type {?} */ styles = {};
    var /** @type {?} */ allProperties;
    input.forEach(function (token) {
        if (token === '*') {
            allProperties = allProperties || Object.keys(allStyles);
            allProperties.forEach(function (prop) { styles[prop] = __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"]; });
        }
        else {
            copyStyles(/** @type {?} */ (token), false, styles);
        }
    });
    return styles;
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var Animation = (function () {
    /**
     * @param {?} _driver
     * @param {?} input
     */
    function Animation(_driver, input) {
        this._driver = _driver;
        var errors = [];
        var ast = buildAnimationAst(input, errors);
        if (errors.length) {
            var errorMessage = "animation validation failed:\n" + errors.join("\n");
            throw new Error(errorMessage);
        }
        this._animationAst = ast;
    }
    /**
     * @param {?} element
     * @param {?} startingStyles
     * @param {?} destinationStyles
     * @param {?} options
     * @param {?=} subInstructions
     * @return {?}
     */
    Animation.prototype.buildTimelines = function (element, startingStyles, destinationStyles, options, subInstructions) {
        var /** @type {?} */ start = Array.isArray(startingStyles) ? normalizeStyles(startingStyles) : (startingStyles);
        var /** @type {?} */ dest = Array.isArray(destinationStyles) ? normalizeStyles(destinationStyles) : (destinationStyles);
        var /** @type {?} */ errors = [];
        subInstructions = subInstructions || new ElementInstructionMap();
        var /** @type {?} */ result = buildAnimationTimelines(this._driver, element, this._animationAst, start, dest, options, subInstructions, errors);
        if (errors.length) {
            var /** @type {?} */ errorMessage = "animation building failed:\n" + errors.join("\n");
            throw new Error(errorMessage);
        }
        return result;
    };
    return Animation;
}());
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @experimental Animation support is experimental.
 */
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */ var AnimationStyleNormalizer = (function () {
    function AnimationStyleNormalizer() {
    }
    return AnimationStyleNormalizer;
}());
/**
 * @experimental Animation support is experimental.
 */
var NoopAnimationStyleNormalizer = (function () {
    function NoopAnimationStyleNormalizer() {
    }
    NoopAnimationStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) { return propertyName; };
    NoopAnimationStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) {
        return value;
    };
    return NoopAnimationStyleNormalizer;
}());
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var WebAnimationsStyleNormalizer = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](WebAnimationsStyleNormalizer, _super);
    function WebAnimationsStyleNormalizer() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * @param {?} propertyName
     * @param {?} errors
     * @return {?}
     */
    WebAnimationsStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) {
        return dashCaseToCamelCase(propertyName);
    };
    /**
     * @param {?} userProvidedProperty
     * @param {?} normalizedProperty
     * @param {?} value
     * @param {?} errors
     * @return {?}
     */
    WebAnimationsStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) {
        var /** @type {?} */ unit = '';
        var /** @type {?} */ strVal = value.toString().trim();
        if (DIMENSIONAL_PROP_MAP[normalizedProperty] && value !== 0 && value !== '0') {
            if (typeof value === 'number') {
                unit = 'px';
            }
            else {
                var /** @type {?} */ valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/);
                if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
                    errors.push("Please provide a CSS unit value for " + userProvidedProperty + ":" + value);
                }
            }
        }
        return strVal + unit;
    };
    return WebAnimationsStyleNormalizer;
}(AnimationStyleNormalizer));
var DIMENSIONAL_PROP_MAP = makeBooleanMap('width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective'
    .split(','));
/**
 * @param {?} keys
 * @return {?}
 */
function makeBooleanMap(keys) {
    var /** @type {?} */ map = {};
    keys.forEach(function (key) { return map[key] = true; });
    return map;
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @param {?} element
 * @param {?} triggerName
 * @param {?} fromState
 * @param {?} toState
 * @param {?} isRemovalTransition
 * @param {?} fromStyles
 * @param {?} toStyles
 * @param {?} timelines
 * @param {?} queriedElements
 * @param {?} preStyleProps
 * @param {?} postStyleProps
 * @return {?}
 */
function createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps) {
    return {
        type: 0 /* TransitionAnimation */,
        element: element,
        triggerName: triggerName,
        isRemovalTransition: isRemovalTransition,
        fromState: fromState,
        fromStyles: fromStyles,
        toState: toState,
        toStyles: toStyles,
        timelines: timelines,
        queriedElements: queriedElements,
        preStyleProps: preStyleProps,
        postStyleProps: postStyleProps
    };
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var AnimationTransitionFactory = (function () {
    /**
     * @param {?} _triggerName
     * @param {?} ast
     * @param {?} _stateStyles
     */
    function AnimationTransitionFactory(_triggerName, ast, _stateStyles) {
        this._triggerName = _triggerName;
        this.ast = ast;
        this._stateStyles = _stateStyles;
    }
    /**
     * @param {?} currentState
     * @param {?} nextState
     * @return {?}
     */
    AnimationTransitionFactory.prototype.match = function (currentState, nextState) {
        return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState);
    };
    /**
     * @param {?} driver
     * @param {?} element
     * @param {?} currentState
     * @param {?} nextState
     * @param {?=} options
     * @param {?=} subInstructions
     * @return {?}
     */
    AnimationTransitionFactory.prototype.build = function (driver, element, currentState, nextState, options, subInstructions) {
        var /** @type {?} */ animationOptions = mergeAnimationOptions(this.ast.options || {}, options || {});
        var /** @type {?} */ backupStateStyles = this._stateStyles['*'] || {};
        var /** @type {?} */ currentStateStyles = this._stateStyles[currentState] || backupStateStyles;
        var /** @type {?} */ nextStateStyles = this._stateStyles[nextState] || backupStateStyles;
        var /** @type {?} */ errors = [];
        var /** @type {?} */ timelines = buildAnimationTimelines(driver, element, this.ast.animation, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors);
        if (errors.length) {
            var /** @type {?} */ errorMessage = "animation building failed:\n" + errors.join("\n");
            throw new Error(errorMessage);
        }
        var /** @type {?} */ preStyleMap = new Map();
        var /** @type {?} */ postStyleMap = new Map();
        var /** @type {?} */ queriedElements = new Set();
        timelines.forEach(function (tl) {
            var /** @type {?} */ elm = tl.element;
            var /** @type {?} */ preProps = getOrSetAsInMap(preStyleMap, elm, {});
            tl.preStyleProps.forEach(function (prop) { return preProps[prop] = true; });
            var /** @type {?} */ postProps = getOrSetAsInMap(postStyleMap, elm, {});
            tl.postStyleProps.forEach(function (prop) { return postProps[prop] = true; });
            if (elm !== element) {
                queriedElements.add(elm);
            }
        });
        var /** @type {?} */ queriedElementsList = iteratorToArray(queriedElements.values());
        return createTransitionInstruction(element, this._triggerName, currentState, nextState, nextState === 'void', currentStateStyles, nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap);
    };
    return AnimationTransitionFactory;
}());
/**
 * @param {?} matchFns
 * @param {?} currentState
 * @param {?} nextState
 * @return {?}
 */
function oneOrMoreTransitionsMatch(matchFns, currentState, nextState) {
    return matchFns.some(function (fn) { return fn(currentState, nextState); });
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * \@experimental Animation support is experimental.
 * @param {?} name
 * @param {?} ast
 * @return {?}
 */
function buildTrigger(name, ast) {
    return new AnimationTrigger(name, ast);
}
/**
 * \@experimental Animation support is experimental.
 */
var AnimationTrigger = (function () {
    /**
     * @param {?} name
     * @param {?} ast
     */
    function AnimationTrigger(name, ast) {
        var _this = this;
        this.name = name;
        this.ast = ast;
        this.transitionFactories = [];
        this.states = {};
        ast.states.forEach(function (ast) {
            var obj = _this.states[ast.name] = {};
            ast.style.styles.forEach(function (styleTuple) {
                if (typeof styleTuple == 'object') {
                    copyStyles(styleTuple, false, obj);
                }
            });
        });
        balanceProperties(this.states, 'true', '1');
        balanceProperties(this.states, 'false', '0');
        ast.transitions.forEach(function (ast) {
            _this.transitionFactories.push(new AnimationTransitionFactory(name, ast, _this.states));
        });
        this.fallbackTransition = createFallbackTransition(name, this.states);
    }
    Object.defineProperty(AnimationTrigger.prototype, "containsQueries", {
        /**
         * @return {?}
         */
        get: function () { return this.ast.queryCount > 0; },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} currentState
     * @param {?} nextState
     * @return {?}
     */
    AnimationTrigger.prototype.matchTransition = function (currentState, nextState) {
        var /** @type {?} */ entry = this.transitionFactories.find(function (f) { return f.match(currentState, nextState); });
        return entry || null;
    };
    return AnimationTrigger;
}());
/**
 * @param {?} triggerName
 * @param {?} states
 * @return {?}
 */
function createFallbackTransition(triggerName, states) {
    var /** @type {?} */ matchers = [function (fromState, toState) { return true; }];
    var /** @type {?} */ animation = new SequenceAst([]);
    var /** @type {?} */ transition = new TransitionAst(matchers, animation);
    return new AnimationTransitionFactory(triggerName, transition, states);
}
/**
 * @param {?} obj
 * @param {?} key1
 * @param {?} key2
 * @return {?}
 */
function balanceProperties(obj, key1, key2) {
    if (obj.hasOwnProperty(key1)) {
        if (!obj.hasOwnProperty(key2)) {
            obj[key2] = obj[key1];
        }
    }
    else if (obj.hasOwnProperty(key2)) {
        obj[key1] = obj[key2];
    }
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();
var TimelineAnimationEngine = (function () {
    /**
     * @param {?} _driver
     * @param {?} _normalizer
     */
    function TimelineAnimationEngine(_driver, _normalizer) {
        this._driver = _driver;
        this._normalizer = _normalizer;
        this._animations = {};
        this._playersById = {};
        this.players = [];
    }
    /**
     * @param {?} id
     * @param {?} metadata
     * @return {?}
     */
    TimelineAnimationEngine.prototype.register = function (id, metadata) {
        var /** @type {?} */ errors = [];
        var /** @type {?} */ ast = buildAnimationAst(metadata, errors);
        if (errors.length) {
            throw new Error("Unable to build the animation due to the following errors: " + errors.join("\n"));
        }
        else {
            this._animations[id] = ast;
        }
    };
    /**
     * @param {?} i
     * @param {?} preStyles
     * @param {?=} postStyles
     * @return {?}
     */
    TimelineAnimationEngine.prototype._buildPlayer = function (i, preStyles, postStyles) {
        var /** @type {?} */ element = i.element;
        var /** @type {?} */ keyframes = normalizeKeyframes(this._driver, this._normalizer, element, i.keyframes, preStyles, postStyles);
        return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, []);
    };
    /**
     * @param {?} id
     * @param {?} element
     * @param {?=} options
     * @return {?}
     */
    TimelineAnimationEngine.prototype.create = function (id, element, options) {
        var _this = this;
        if (options === void 0) { options = {}; }
        var /** @type {?} */ errors = [];
        var /** @type {?} */ ast = this._animations[id];
        var /** @type {?} */ instructions;
        var /** @type {?} */ autoStylesMap = new Map();
        if (ast) {
            instructions = buildAnimationTimelines(this._driver, element, ast, {}, {}, options, EMPTY_INSTRUCTION_MAP, errors);
            instructions.forEach(function (inst) {
                var /** @type {?} */ styles = getOrSetAsInMap(autoStylesMap, inst.element, {});
                inst.postStyleProps.forEach(function (prop) { return styles[prop] = null; });
            });
        }
        else {
            errors.push('The requested animation doesn\'t exist or has already been destroyed');
            instructions = [];
        }
        if (errors.length) {
            throw new Error("Unable to create the animation due to the following errors: " + errors.join("\n"));
        }
        autoStylesMap.forEach(function (styles, element) {
            Object.keys(styles).forEach(function (prop) { styles[prop] = _this._driver.computeStyle(element, prop, __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"]); });
        });
        var /** @type {?} */ players = instructions.map(function (i) {
            var /** @type {?} */ styles = autoStylesMap.get(i.element);
            return _this._buildPlayer(i, {}, styles);
        });
        var /** @type {?} */ player = optimizeGroupPlayer(players);
        this._playersById[id] = player;
        player.onDestroy(function () { return _this.destroy(id); });
        this.players.push(player);
        return player;
    };
    /**
     * @param {?} id
     * @return {?}
     */
    TimelineAnimationEngine.prototype.destroy = function (id) {
        var /** @type {?} */ player = this._getPlayer(id);
        player.destroy();
        delete this._playersById[id];
        var /** @type {?} */ index = this.players.indexOf(player);
        if (index >= 0) {
            this.players.splice(index, 1);
        }
    };
    /**
     * @param {?} id
     * @return {?}
     */
    TimelineAnimationEngine.prototype._getPlayer = function (id) {
        var /** @type {?} */ player = this._playersById[id];
        if (!player) {
            throw new Error("Unable to find the timeline player referenced by " + id);
        }
        return player;
    };
    /**
     * @param {?} id
     * @param {?} element
     * @param {?} eventName
     * @param {?} callback
     * @return {?}
     */
    TimelineAnimationEngine.prototype.listen = function (id, element, eventName, callback) {
        // triggerName, fromState, toState are all ignored for timeline animations
        var /** @type {?} */ baseEvent = makeAnimationEvent(element, '', '', '');
        listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback);
        return function () { };
    };
    /**
     * @param {?} id
     * @param {?} element
     * @param {?} command
     * @param {?} args
     * @return {?}
     */
    TimelineAnimationEngine.prototype.command = function (id, element, command, args) {
        if (command == 'register') {
            this.register(id, /** @type {?} */ (args[0]));
            return;
        }
        if (command == 'create') {
            var /** @type {?} */ options = ((args[0] || {}));
            this.create(id, element, options);
            return;
        }
        var /** @type {?} */ player = this._getPlayer(id);
        switch (command) {
            case 'play':
                player.play();
                break;
            case 'pause':
                player.pause();
                break;
            case 'reset':
                player.reset();
                break;
            case 'restart':
                player.restart();
                break;
            case 'finish':
                player.finish();
                break;
            case 'init':
                player.init();
                break;
            case 'setPosition':
                player.setPosition(parseFloat(/** @type {?} */ (args[0])));
                break;
            case 'destroy':
                this.destroy(id);
                break;
        }
    };
    return TimelineAnimationEngine;
}());
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var EMPTY_PLAYER_ARRAY = [];
var NULL_REMOVAL_STATE = {
    namespaceId: '',
    setForRemoval: null,
    hasAnimation: false,
    removedBeforeQueried: false
};
var NULL_REMOVED_QUERIED_STATE = {
    namespaceId: '',
    setForRemoval: null,
    hasAnimation: false,
    removedBeforeQueried: true
};
var REMOVAL_FLAG = '__ng_removed';
var StateValue = (function () {
    /**
     * @param {?} input
     */
    function StateValue(input) {
        var isObj = input && input.hasOwnProperty('value');
        var value = isObj ? input['value'] : input;
        this.value = normalizeTriggerValue(value);
        if (isObj) {
            var options = copyObj(input);
            delete options['value'];
            this.options = options;
        }
        else {
            this.options = {};
        }
        if (!this.options.params) {
            this.options.params = {};
        }
    }
    /**
     * @param {?} options
     * @return {?}
     */
    StateValue.prototype.absorbOptions = function (options) {
        var /** @type {?} */ newParams = options.params;
        if (newParams) {
            var /** @type {?} */ oldParams_2 = ((this.options.params));
            Object.keys(newParams).forEach(function (prop) {
                if (oldParams_2[prop] == null) {
                    oldParams_2[prop] = newParams[prop];
                }
            });
        }
    };
    return StateValue;
}());
var VOID_VALUE = 'void';
var DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);
var DELETED_STATE_VALUE = new StateValue('DELETED');
var AnimationTransitionNamespace = (function () {
    /**
     * @param {?} id
     * @param {?} hostElement
     * @param {?} _engine
     */
    function AnimationTransitionNamespace(id, hostElement, _engine) {
        this.id = id;
        this.hostElement = hostElement;
        this._engine = _engine;
        this.players = [];
        this._triggers = {};
        this._queue = [];
        this._elementListeners = new Map();
        this._hostClassName = 'ng-tns-' + id;
        addClass(hostElement, this._hostClassName);
    }
    /**
     * @param {?} element
     * @param {?} name
     * @param {?} phase
     * @param {?} callback
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.listen = function (element, name, phase, callback) {
        var _this = this;
        if (!this._triggers.hasOwnProperty(name)) {
            throw new Error("Unable to listen on the animation trigger event \"" + phase + "\" because the animation trigger \"" + name + "\" doesn't exist!");
        }
        if (phase == null || phase.length == 0) {
            throw new Error("Unable to listen on the animation trigger \"" + name + "\" because the provided event is undefined!");
        }
        if (!isTriggerEventValid(phase)) {
            throw new Error("The provided animation trigger event \"" + phase + "\" for the animation trigger \"" + name + "\" is not supported!");
        }
        var /** @type {?} */ listeners = getOrSetAsInMap(this._elementListeners, element, []);
        var /** @type {?} */ data = { name: name, phase: phase, callback: callback };
        listeners.push(data);
        var /** @type {?} */ triggersWithStates = getOrSetAsInMap(this._engine.statesByElement, element, {});
        if (!triggersWithStates.hasOwnProperty(name)) {
            addClass(element, NG_TRIGGER_CLASSNAME);
            addClass(element, NG_TRIGGER_CLASSNAME + '-' + name);
            triggersWithStates[name] = null;
        }
        return function () {
            // the event listener is removed AFTER the flush has occurred such
            // that leave animations callbacks can fire (otherwise if the node
            // is removed in between then the listeners would be deregistered)
            _this._engine.afterFlush(function () {
                var /** @type {?} */ index = listeners.indexOf(data);
                if (index >= 0) {
                    listeners.splice(index, 1);
                }
                if (!_this._triggers[name]) {
                    delete triggersWithStates[name];
                }
            });
        };
    };
    /**
     * @param {?} name
     * @param {?} ast
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.register = function (name, ast) {
        if (this._triggers[name]) {
            // throw
            return false;
        }
        else {
            this._triggers[name] = ast;
            return true;
        }
    };
    /**
     * @param {?} name
     * @return {?}
     */
    AnimationTransitionNamespace.prototype._getTrigger = function (name) {
        var /** @type {?} */ trigger = this._triggers[name];
        if (!trigger) {
            throw new Error("The provided animation trigger \"" + name + "\" has not been registered!");
        }
        return trigger;
    };
    /**
     * @param {?} element
     * @param {?} triggerName
     * @param {?} value
     * @param {?=} defaultToFallback
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.trigger = function (element, triggerName, value, defaultToFallback) {
        var _this = this;
        if (defaultToFallback === void 0) { defaultToFallback = true; }
        var /** @type {?} */ trigger = this._getTrigger(triggerName);
        var /** @type {?} */ player = new TransitionAnimationPlayer(this.id, triggerName, element);
        var /** @type {?} */ triggersWithStates = this._engine.statesByElement.get(element);
        if (!triggersWithStates) {
            addClass(element, NG_TRIGGER_CLASSNAME);
            addClass(element, NG_TRIGGER_CLASSNAME + '-' + triggerName);
            this._engine.statesByElement.set(element, triggersWithStates = {});
        }
        var /** @type {?} */ fromState = triggersWithStates[triggerName];
        var /** @type {?} */ toState = new StateValue(value);
        var /** @type {?} */ isObj = value && value.hasOwnProperty('value');
        if (!isObj && fromState) {
            toState.absorbOptions(fromState.options);
        }
        triggersWithStates[triggerName] = toState;
        if (!fromState) {
            fromState = DEFAULT_STATE_VALUE;
        }
        else if (fromState === DELETED_STATE_VALUE) {
            return player;
        }
        var /** @type {?} */ playersOnElement = getOrSetAsInMap(this._engine.playersByElement, element, []);
        playersOnElement.forEach(function (player) {
            // only remove the player if it is queued on the EXACT same trigger/namespace
            // we only also deal with queued players here because if the animation has
            // started then we want to keep the player alive until the flush happens
            // (which is where the previousPlayers are passed into the new palyer)
            if (player.namespaceId == _this.id && player.triggerName == triggerName && player.queued) {
                player.destroy();
            }
        });
        var /** @type {?} */ transition = trigger.matchTransition(fromState.value, toState.value);
        var /** @type {?} */ isFallbackTransition = false;
        if (!transition) {
            if (!defaultToFallback)
                return;
            transition = trigger.fallbackTransition;
            isFallbackTransition = true;
        }
        this._engine.totalQueuedPlayers++;
        this._queue.push({ element: element, triggerName: triggerName, transition: transition, fromState: fromState, toState: toState, player: player, isFallbackTransition: isFallbackTransition });
        if (!isFallbackTransition) {
            addClass(element, NG_ANIMATING_CLASSNAME);
        }
        player.onDone(function () {
            removeClass(element, NG_ANIMATING_CLASSNAME);
            var /** @type {?} */ index = _this.players.indexOf(player);
            if (index >= 0) {
                _this.players.splice(index, 1);
            }
            var /** @type {?} */ players = _this._engine.playersByElement.get(element);
            if (players) {
                var /** @type {?} */ index_1 = players.indexOf(player);
                if (index_1 >= 0) {
                    players.splice(index_1, 1);
                }
            }
        });
        this.players.push(player);
        playersOnElement.push(player);
        return player;
    };
    /**
     * @param {?} name
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.deregister = function (name) {
        var _this = this;
        delete this._triggers[name];
        this._engine.statesByElement.forEach(function (stateMap, element) { delete stateMap[name]; });
        this._elementListeners.forEach(function (listeners, element) {
            _this._elementListeners.set(element, listeners.filter(function (entry) { return entry.name != name; }));
        });
    };
    /**
     * @param {?} element
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.clearElementCache = function (element) {
        this._engine.statesByElement.delete(element);
        this._elementListeners.delete(element);
        var /** @type {?} */ elementPlayers = this._engine.playersByElement.get(element);
        if (elementPlayers) {
            elementPlayers.forEach(function (player) { return player.destroy(); });
            this._engine.playersByElement.delete(element);
        }
    };
    /**
     * @param {?} rootElement
     * @param {?} context
     * @param {?=} animate
     * @return {?}
     */
    AnimationTransitionNamespace.prototype._destroyInnerNodes = function (rootElement, context, animate) {
        var _this = this;
        if (animate === void 0) { animate = false; }
        this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true).forEach(function (elm) {
            if (animate && containsClass(elm, _this._hostClassName)) {
                var /** @type {?} */ innerNs = _this._engine.namespacesByHostElement.get(elm);
                // special case for a host element with animations on the same element
                if (innerNs) {
                    innerNs.removeNode(elm, context, true);
                }
                _this.removeNode(elm, context, true);
            }
            else {
                _this.clearElementCache(elm);
            }
        });
    };
    /**
     * @param {?} element
     * @param {?} context
     * @param {?=} doNotRecurse
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.removeNode = function (element, context, doNotRecurse) {
        var _this = this;
        var /** @type {?} */ engine = this._engine;
        if (!doNotRecurse && element.childElementCount) {
            this._destroyInnerNodes(element, context, true);
        }
        var /** @type {?} */ triggerStates = engine.statesByElement.get(element);
        if (triggerStates) {
            var /** @type {?} */ players_1 = [];
            Object.keys(triggerStates).forEach(function (triggerName) {
                // this check is here in the event that an element is removed
                // twice (both on the host level and the component level)
                if (_this._triggers[triggerName]) {
                    var /** @type {?} */ player = _this.trigger(element, triggerName, VOID_VALUE, false);
                    if (player) {
                        players_1.push(player);
                    }
                }
            });
            if (players_1.length) {
                engine.markElementAsRemoved(this.id, element, true, context);
                optimizeGroupPlayer(players_1).onDone(function () { return engine.processLeaveNode(element); });
                return;
            }
        }
        // find the player that is animating and make sure that the
        // removal is delayed until that player has completed
        var /** @type {?} */ containsPotentialParentTransition = false;
        if (engine.totalAnimations) {
            var /** @type {?} */ currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : [];
            // when this `if statement` does not continue forward it means that
            // a previous animation query has selected the current element and
            // is animating it. In this situation want to continue fowards and
            // allow the element to be queued up for animation later.
            if (currentPlayers && currentPlayers.length) {
                containsPotentialParentTransition = true;
            }
            else {
                var /** @type {?} */ parent = element;
                while (parent = parent.parentNode) {
                    var /** @type {?} */ triggers = engine.statesByElement.get(parent);
                    if (triggers) {
                        containsPotentialParentTransition = true;
                        break;
                    }
                }
            }
        }
        // at this stage we know that the element will either get removed
        // during flush or will be picked up by a parent query. Either way
        // we need to fire the listeners for this element when it DOES get
        // removed (once the query parent animation is done or after flush)
        var /** @type {?} */ listeners = this._elementListeners.get(element);
        if (listeners) {
            var /** @type {?} */ visitedTriggers_1 = new Set();
            listeners.forEach(function (listener) {
                var /** @type {?} */ triggerName = listener.name;
                if (visitedTriggers_1.has(triggerName))
                    return;
                visitedTriggers_1.add(triggerName);
                var /** @type {?} */ trigger = _this._triggers[triggerName];
                var /** @type {?} */ transition = trigger.fallbackTransition;
                var /** @type {?} */ elementStates = ((engine.statesByElement.get(element)));
                var /** @type {?} */ fromState = elementStates[triggerName] || DEFAULT_STATE_VALUE;
                var /** @type {?} */ toState = new StateValue(VOID_VALUE);
                var /** @type {?} */ player = new TransitionAnimationPlayer(_this.id, triggerName, element);
                _this._engine.totalQueuedPlayers++;
                _this._queue.push({
                    element: element,
                    triggerName: triggerName,
                    transition: transition,
                    fromState: fromState,
                    toState: toState,
                    player: player,
                    isFallbackTransition: true
                });
            });
        }
        // whether or not a parent has an animation we need to delay the deferral of the leave
        // operation until we have more information (which we do after flush() has been called)
        if (containsPotentialParentTransition) {
            engine.markElementAsRemoved(this.id, element, false, context);
        }
        else {
            // we do this after the flush has occurred such
            // that the callbacks can be fired
            engine.afterFlush(function () { return _this.clearElementCache(element); });
            engine.destroyInnerAnimations(element);
            engine._onRemovalComplete(element, context);
        }
    };
    /**
     * @param {?} element
     * @param {?} parent
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.insertNode = function (element, parent) { addClass(element, this._hostClassName); };
    /**
     * @param {?} microtaskId
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.drainQueuedTransitions = function (microtaskId) {
        var _this = this;
        var /** @type {?} */ instructions = [];
        this._queue.forEach(function (entry) {
            var /** @type {?} */ player = entry.player;
            if (player.destroyed)
                return;
            var /** @type {?} */ element = entry.element;
            var /** @type {?} */ listeners = _this._elementListeners.get(element);
            if (listeners) {
                listeners.forEach(function (listener) {
                    if (listener.name == entry.triggerName) {
                        var /** @type {?} */ baseEvent = makeAnimationEvent(element, entry.triggerName, entry.fromState.value, entry.toState.value);
                        ((baseEvent))['_data'] = microtaskId;
                        listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);
                    }
                });
            }
            if (player.markedForDestroy) {
                _this._engine.afterFlush(function () {
                    // now we can destroy the element properly since the event listeners have
                    // been bound to the player
                    player.destroy();
                });
            }
            else {
                instructions.push(entry);
            }
        });
        this._queue = [];
        return instructions.sort(function (a, b) {
            // if depCount == 0 them move to front
            // otherwise if a contains b then move back
            var /** @type {?} */ d0 = a.transition.ast.depCount;
            var /** @type {?} */ d1 = b.transition.ast.depCount;
            if (d0 == 0 || d1 == 0) {
                return d0 - d1;
            }
            return _this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;
        });
    };
    /**
     * @param {?} context
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.destroy = function (context) {
        this.players.forEach(function (p) { return p.destroy(); });
        this._destroyInnerNodes(this.hostElement, context);
    };
    /**
     * @param {?} element
     * @return {?}
     */
    AnimationTransitionNamespace.prototype.elementContainsData = function (element) {
        var /** @type {?} */ containsData = false;
        if (this._elementListeners.has(element))
            containsData = true;
        containsData =
            (this._queue.find(function (entry) { return entry.element === element; }) ? true : false) || containsData;
        return containsData;
    };
    return AnimationTransitionNamespace;
}());
var TransitionAnimationEngine = (function () {
    /**
     * @param {?} driver
     * @param {?} _normalizer
     */
    function TransitionAnimationEngine(driver, _normalizer) {
        this.driver = driver;
        this._normalizer = _normalizer;
        this.players = [];
        this.newHostElements = new Map();
        this.playersByElement = new Map();
        this.playersByQueriedElement = new Map();
        this.statesByElement = new Map();
        this.totalAnimations = 0;
        this.totalQueuedPlayers = 0;
        this._namespaceLookup = {};
        this._namespaceList = [];
        this._flushFns = [];
        this._whenQuietFns = [];
        this.namespacesByHostElement = new Map();
        this.collectedEnterElements = [];
        this.collectedLeaveElements = [];
        this.onRemovalComplete = function (element, context) { };
    }
    /**
     * @param {?} element
     * @param {?} context
     * @return {?}
     */
    TransitionAnimationEngine.prototype._onRemovalComplete = function (element, context) { this.onRemovalComplete(element, context); };
    Object.defineProperty(TransitionAnimationEngine.prototype, "queuedPlayers", {
        /**
         * @return {?}
         */
        get: function () {
            var /** @type {?} */ players = [];
            this._namespaceList.forEach(function (ns) {
                ns.players.forEach(function (player) {
                    if (player.queued) {
                        players.push(player);
                    }
                });
            });
            return players;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} namespaceId
     * @param {?} hostElement
     * @return {?}
     */
    TransitionAnimationEngine.prototype.createNamespace = function (namespaceId, hostElement) {
        var /** @type {?} */ ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);
        if (hostElement.parentNode) {
            this._balanceNamespaceList(ns, hostElement);
        }
        else {
            // defer this later until flush during when the host element has
            // been inserted so that we know exactly where to place it in
            // the namespace list
            this.newHostElements.set(hostElement, ns);
            // given that this host element is apart of the animation code, it
            // may or may not be inserted by a parent node that is an of an
            // animation renderer type. If this happens then we can still have
            // access to this item when we query for :enter nodes. If the parent
            // is a renderer then the set data-structure will normalize the entry
            this.collectEnterElement(hostElement);
        }
        return this._namespaceLookup[namespaceId] = ns;
    };
    /**
     * @param {?} ns
     * @param {?} hostElement
     * @return {?}
     */
    TransitionAnimationEngine.prototype._balanceNamespaceList = function (ns, hostElement) {
        var /** @type {?} */ limit = this._namespaceList.length - 1;
        if (limit >= 0) {
            var /** @type {?} */ found = false;
            for (var /** @type {?} */ i = limit; i >= 0; i--) {
                var /** @type {?} */ nextNamespace = this._namespaceList[i];
                if (this.driver.containsElement(nextNamespace.hostElement, hostElement)) {
                    this._namespaceList.splice(i + 1, 0, ns);
                    found = true;
                    break;
                }
            }
            if (!found) {
                this._namespaceList.splice(0, 0, ns);
            }
        }
        else {
            this._namespaceList.push(ns);
        }
        this.namespacesByHostElement.set(hostElement, ns);
        return ns;
    };
    /**
     * @param {?} namespaceId
     * @param {?} hostElement
     * @return {?}
     */
    TransitionAnimationEngine.prototype.register = function (namespaceId, hostElement) {
        var /** @type {?} */ ns = this._namespaceLookup[namespaceId];
        if (!ns) {
            ns = this.createNamespace(namespaceId, hostElement);
        }
        return ns;
    };
    /**
     * @param {?} namespaceId
     * @param {?} name
     * @param {?} trigger
     * @return {?}
     */
    TransitionAnimationEngine.prototype.registerTrigger = function (namespaceId, name, trigger) {
        var /** @type {?} */ ns = this._namespaceLookup[namespaceId];
        if (ns && ns.register(name, trigger)) {
            this.totalAnimations++;
        }
    };
    /**
     * @param {?} namespaceId
     * @param {?} context
     * @return {?}
     */
    TransitionAnimationEngine.prototype.destroy = function (namespaceId, context) {
        var _this = this;
        if (!namespaceId)
            return;
        var /** @type {?} */ ns = this._fetchNamespace(namespaceId);
        this.afterFlush(function () {
            _this.namespacesByHostElement.delete(ns.hostElement);
            delete _this._namespaceLookup[namespaceId];
            var /** @type {?} */ index = _this._namespaceList.indexOf(ns);
            if (index >= 0) {
                _this._namespaceList.splice(index, 1);
            }
        });
        this.afterFlushAnimationsDone(function () { return ns.destroy(context); });
    };
    /**
     * @param {?} id
     * @return {?}
     */
    TransitionAnimationEngine.prototype._fetchNamespace = function (id) { return this._namespaceLookup[id]; };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} name
     * @param {?} value
     * @return {?}
     */
    TransitionAnimationEngine.prototype.trigger = function (namespaceId, element, name, value) {
        if (isElementNode(element)) {
            this._fetchNamespace(namespaceId).trigger(element, name, value);
            return true;
        }
        return false;
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} parent
     * @param {?} insertBefore
     * @return {?}
     */
    TransitionAnimationEngine.prototype.insertNode = function (namespaceId, element, parent, insertBefore) {
        if (!isElementNode(element))
            return;
        // special case for when an element is removed and reinserted (move operation)
        // when this occurs we do not want to use the element for deletion later
        var /** @type {?} */ details = (element[REMOVAL_FLAG]);
        if (details && details.setForRemoval) {
            details.setForRemoval = false;
        }
        // in the event that the namespaceId is blank then the caller
        // code does not contain any animation code in it, but it is
        // just being called so that the node is marked as being inserted
        if (namespaceId) {
            this._fetchNamespace(namespaceId).insertNode(element, parent);
        }
        // only *directives and host elements are inserted before
        if (insertBefore) {
            this.collectEnterElement(element);
        }
    };
    /**
     * @param {?} element
     * @return {?}
     */
    TransitionAnimationEngine.prototype.collectEnterElement = function (element) { this.collectedEnterElements.push(element); };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} context
     * @param {?=} doNotRecurse
     * @return {?}
     */
    TransitionAnimationEngine.prototype.removeNode = function (namespaceId, element, context, doNotRecurse) {
        if (!isElementNode(element)) {
            this._onRemovalComplete(element, context);
            return;
        }
        var /** @type {?} */ ns = namespaceId ? this._fetchNamespace(namespaceId) : null;
        if (ns) {
            ns.removeNode(element, context, doNotRecurse);
        }
        else {
            this.markElementAsRemoved(namespaceId, element, false, context);
        }
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?=} hasAnimation
     * @param {?=} context
     * @return {?}
     */
    TransitionAnimationEngine.prototype.markElementAsRemoved = function (namespaceId, element, hasAnimation, context) {
        this.collectedLeaveElements.push(element);
        element[REMOVAL_FLAG] = {
            namespaceId: namespaceId,
            setForRemoval: context, hasAnimation: hasAnimation,
            removedBeforeQueried: false
        };
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} name
     * @param {?} phase
     * @param {?} callback
     * @return {?}
     */
    TransitionAnimationEngine.prototype.listen = function (namespaceId, element, name, phase, callback) {
        if (isElementNode(element)) {
            return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);
        }
        return function () { };
    };
    /**
     * @param {?} entry
     * @param {?} subTimelines
     * @return {?}
     */
    TransitionAnimationEngine.prototype._buildInstruction = function (entry, subTimelines) {
        return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, entry.toState.options, subTimelines);
    };
    /**
     * @param {?} containerElement
     * @return {?}
     */
    TransitionAnimationEngine.prototype.destroyInnerAnimations = function (containerElement) {
        var _this = this;
        var /** @type {?} */ elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);
        elements.forEach(function (element) {
            var /** @type {?} */ players = _this.playersByElement.get(element);
            if (players) {
                players.forEach(function (player) {
                    // special case for when an element is set for destruction, but hasn't started.
                    // in this situation we want to delay the destruction until the flush occurs
                    // so that any event listeners attached to the player are triggered.
                    if (player.queued) {
                        player.markedForDestroy = true;
                    }
                    else {
                        player.destroy();
                    }
                });
            }
            var /** @type {?} */ stateMap = _this.statesByElement.get(element);
            if (stateMap) {
                Object.keys(stateMap).forEach(function (triggerName) { return stateMap[triggerName] = DELETED_STATE_VALUE; });
            }
        });
        if (this.playersByQueriedElement.size == 0)
            return;
        elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);
        if (elements.length) {
            elements.forEach(function (element) {
                var /** @type {?} */ players = _this.playersByQueriedElement.get(element);
                if (players) {
                    players.forEach(function (player) { return player.finish(); });
                }
            });
        }
    };
    /**
     * @return {?}
     */
    TransitionAnimationEngine.prototype.whenRenderingDone = function () {
        var _this = this;
        return new Promise(function (resolve) {
            if (_this.players.length) {
                return optimizeGroupPlayer(_this.players).onDone(function () { return resolve(); });
            }
            else {
                resolve();
            }
        });
    };
    /**
     * @param {?} element
     * @return {?}
     */
    TransitionAnimationEngine.prototype.processLeaveNode = function (element) {
        var /** @type {?} */ details = (element[REMOVAL_FLAG]);
        if (details && details.setForRemoval) {
            // this will prevent it from removing it twice
            element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;
            if (details.namespaceId) {
                this.destroyInnerAnimations(element);
                var /** @type {?} */ ns = this._fetchNamespace(details.namespaceId);
                if (ns) {
                    ns.clearElementCache(element);
                }
            }
            this._onRemovalComplete(element, details.setForRemoval);
        }
    };
    /**
     * @param {?=} microtaskId
     * @return {?}
     */
    TransitionAnimationEngine.prototype.flush = function (microtaskId) {
        var _this = this;
        if (microtaskId === void 0) { microtaskId = -1; }
        var /** @type {?} */ players = [];
        if (this.newHostElements.size) {
            this.newHostElements.forEach(function (ns, element) { return _this._balanceNamespaceList(ns, element); });
            this.newHostElements.clear();
        }
        if (this._namespaceList.length &&
            (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {
            players = this._flushAnimations(microtaskId);
        }
        else {
            for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {
                var /** @type {?} */ element = this.collectedLeaveElements[i];
                this.processLeaveNode(element);
            }
        }
        this.totalQueuedPlayers = 0;
        this.collectedEnterElements.length = 0;
        this.collectedLeaveElements.length = 0;
        this._flushFns.forEach(function (fn) { return fn(); });
        this._flushFns = [];
        if (this._whenQuietFns.length) {
            // we move these over to a variable so that
            // if any new callbacks are registered in another
            // flush they do not populate the existing set
            var /** @type {?} */ quietFns_1 = this._whenQuietFns;
            this._whenQuietFns = [];
            if (players.length) {
                optimizeGroupPlayer(players).onDone(function () { quietFns_1.forEach(function (fn) { return fn(); }); });
            }
            else {
                quietFns_1.forEach(function (fn) { return fn(); });
            }
        }
    };
    /**
     * @param {?} microtaskId
     * @return {?}
     */
    TransitionAnimationEngine.prototype._flushAnimations = function (microtaskId) {
        var _this = this;
        var /** @type {?} */ subTimelines = new ElementInstructionMap();
        var /** @type {?} */ skippedPlayers = [];
        var /** @type {?} */ skippedPlayersMap = new Map();
        var /** @type {?} */ queuedInstructions = [];
        var /** @type {?} */ queriedElements = new Map();
        var /** @type {?} */ allPreStyleElements = new Map();
        var /** @type {?} */ allPostStyleElements = new Map();
        var /** @type {?} */ bodyNode = getBodyNode();
        var /** @type {?} */ allEnterNodes = this.collectedEnterElements.length ?
            this.collectedEnterElements.filter(createIsRootFilterFn(this.collectedEnterElements)) :
            [];
        // this must occur before the instructions are built below such that
        // the :enter queries match the elements (since the timeline queries
        // are fired during instruction building).
        for (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) {
            addClass(allEnterNodes[i], ENTER_CLASSNAME);
        }
        var /** @type {?} */ allLeaveNodes = [];
        var /** @type {?} */ leaveNodesWithoutAnimations = [];
        for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {
            var /** @type {?} */ element = this.collectedLeaveElements[i];
            var /** @type {?} */ details = (element[REMOVAL_FLAG]);
            if (details && details.setForRemoval) {
                addClass(element, LEAVE_CLASSNAME);
                allLeaveNodes.push(element);
                if (!details.hasAnimation) {
                    leaveNodesWithoutAnimations.push(element);
                }
            }
        }
        for (var /** @type {?} */ i = this._namespaceList.length - 1; i >= 0; i--) {
            var /** @type {?} */ ns = this._namespaceList[i];
            ns.drainQueuedTransitions(microtaskId).forEach(function (entry) {
                var /** @type {?} */ player = entry.player;
                var /** @type {?} */ element = entry.element;
                if (!bodyNode || !_this.driver.containsElement(bodyNode, element)) {
                    player.destroy();
                    return;
                }
                var /** @type {?} */ instruction = _this._buildInstruction(entry, subTimelines);
                if (!instruction)
                    return;
                // if a unmatched transition is queued to go then it SHOULD NOT render
                // an animation and cancel the previously running animations.
                if (entry.isFallbackTransition) {
                    player.onStart(function () { return eraseStyles(element, instruction.fromStyles); });
                    player.onDestroy(function () { return setStyles(element, instruction.toStyles); });
                    skippedPlayers.push(player);
                    return;
                }
                // this means that if a parent animation uses this animation as a sub trigger
                // then it will instruct the timeline builder to not add a player delay, but
                // instead stretch the first keyframe gap up until the animation starts. The
                // reason this is important is to prevent extra initialization styles from being
                // required by the user in the animation.
                instruction.timelines.forEach(function (tl) { return tl.stretchStartingKeyframe = true; });
                subTimelines.append(element, instruction.timelines);
                var /** @type {?} */ tuple = { instruction: instruction, player: player, element: element };
                queuedInstructions.push(tuple);
                instruction.queriedElements.forEach(function (element) { return getOrSetAsInMap(queriedElements, element, []).push(player); });
                instruction.preStyleProps.forEach(function (stringMap, element) {
                    var /** @type {?} */ props = Object.keys(stringMap);
                    if (props.length) {
                        var /** @type {?} */ setVal_1 = ((allPreStyleElements.get(element)));
                        if (!setVal_1) {
                            allPreStyleElements.set(element, setVal_1 = new Set());
                        }
                        props.forEach(function (prop) { return setVal_1.add(prop); });
                    }
                });
                instruction.postStyleProps.forEach(function (stringMap, element) {
                    var /** @type {?} */ props = Object.keys(stringMap);
                    var /** @type {?} */ setVal = ((allPostStyleElements.get(element)));
                    if (!setVal) {
                        allPostStyleElements.set(element, setVal = new Set());
                    }
                    props.forEach(function (prop) { return setVal.add(prop); });
                });
            });
        }
        // these can only be detected here since we have a map of all the elements
        // that have animations attached to them...
        var /** @type {?} */ enterNodesWithoutAnimations = [];
        for (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) {
            var /** @type {?} */ element = allEnterNodes[i];
            if (!subTimelines.has(element)) {
                enterNodesWithoutAnimations.push(element);
            }
        }
        var /** @type {?} */ allPreviousPlayersMap = new Map();
        var /** @type {?} */ sortedParentElements = [];
        queuedInstructions.forEach(function (entry) {
            var /** @type {?} */ element = entry.element;
            if (subTimelines.has(element)) {
                sortedParentElements.unshift(element);
                _this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);
            }
        });
        skippedPlayers.forEach(function (player) {
            var /** @type {?} */ element = player.element;
            var /** @type {?} */ previousPlayers = _this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);
            previousPlayers.forEach(function (prevPlayer) { getOrSetAsInMap(allPreviousPlayersMap, element, []).push(prevPlayer); });
        });
        allPreviousPlayersMap.forEach(function (players) { return players.forEach(function (player) { return player.destroy(); }); });
        // PRE STAGE: fill the ! styles
        var /** @type {?} */ preStylesMap = allPreStyleElements.size ?
            cloakAndComputeStyles(this.driver, enterNodesWithoutAnimations, allPreStyleElements, __WEBPACK_IMPORTED_MODULE_1__angular_animations__["ɵPRE_STYLE"]) :
            new Map();
        // POST STAGE: fill the * styles
        var /** @type {?} */ postStylesMap = cloakAndComputeStyles(this.driver, leaveNodesWithoutAnimations, allPostStyleElements, __WEBPACK_IMPORTED_MODULE_1__angular_animations__["AUTO_STYLE"]);
        var /** @type {?} */ rootPlayers = [];
        var /** @type {?} */ subPlayers = [];
        queuedInstructions.forEach(function (entry) {
            var element = entry.element, player = entry.player, instruction = entry.instruction;
            // this means that it was never consumed by a parent animation which
            // means that it is independent and therefore should be set for animation
            if (subTimelines.has(element)) {
                var /** @type {?} */ innerPlayer = _this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap);
                player.setRealPlayer(innerPlayer);
                var /** @type {?} */ parentHasPriority = null;
                for (var /** @type {?} */ i = 0; i < sortedParentElements.length; i++) {
                    var /** @type {?} */ parent = sortedParentElements[i];
                    if (parent === element)
                        break;
                    if (_this.driver.containsElement(parent, element)) {
                        parentHasPriority = parent;
                        break;
                    }
                }
                if (parentHasPriority) {
                    var /** @type {?} */ parentPlayers = _this.playersByElement.get(parentHasPriority);
                    if (parentPlayers && parentPlayers.length) {
                        player.parentPlayer = optimizeGroupPlayer(parentPlayers);
                    }
                    skippedPlayers.push(player);
                }
                else {
                    rootPlayers.push(player);
                }
            }
            else {
                eraseStyles(element, instruction.fromStyles);
                player.onDestroy(function () { return setStyles(element, instruction.toStyles); });
                subPlayers.push(player);
            }
        });
        subPlayers.forEach(function (player) {
            var /** @type {?} */ playersForElement = skippedPlayersMap.get(player.element);
            if (playersForElement && playersForElement.length) {
                var /** @type {?} */ innerPlayer = optimizeGroupPlayer(playersForElement);
                player.setRealPlayer(innerPlayer);
            }
        });
        // the reason why we don't actually play the animation is
        // because all that a skipped player is designed to do is to
        // fire the start/done transition callback events
        skippedPlayers.forEach(function (player) {
            if (player.parentPlayer) {
                player.parentPlayer.onDestroy(function () { return player.destroy(); });
            }
            else {
                player.destroy();
            }
        });
        // run through all of the queued removals and see if they
        // were picked up by a query. If not then perform the removal
        // operation right away unless a parent animation is ongoing.
        for (var /** @type {?} */ i = 0; i < allLeaveNodes.length; i++) {
            var /** @type {?} */ element = allLeaveNodes[i];
            var /** @type {?} */ details = (element[REMOVAL_FLAG]);
            // this means the element has a removal animation that is being
            // taken care of and therefore the inner elements will hang around
            // until that animation is over (or the parent queried animation)
            if (details && details.hasAnimation)
                continue;
            var /** @type {?} */ players = [];
            // if this element is queried or if it contains queried children
            // then we want for the element not to be removed from the page
            // until the queried animations have finished
            if (queriedElements.size) {
                var /** @type {?} */ queriedPlayerResults = queriedElements.get(element);
                if (queriedPlayerResults && queriedPlayerResults.length) {
                    players.push.apply(players, queriedPlayerResults);
                }
                var /** @type {?} */ queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);
                for (var /** @type {?} */ j = 0; j < queriedInnerElements.length; j++) {
                    var /** @type {?} */ queriedPlayers = queriedElements.get(queriedInnerElements[j]);
                    if (queriedPlayers && queriedPlayers.length) {
                        players.push.apply(players, queriedPlayers);
                    }
                }
            }
            if (players.length) {
                removeNodesAfterAnimationDone(this, element, players);
            }
            else {
                this.processLeaveNode(element);
            }
        }
        rootPlayers.forEach(function (player) {
            _this.players.push(player);
            player.onDone(function () {
                player.destroy();
                var /** @type {?} */ index = _this.players.indexOf(player);
                _this.players.splice(index, 1);
            });
            player.play();
        });
        allEnterNodes.forEach(function (element) { return removeClass(element, ENTER_CLASSNAME); });
        return rootPlayers;
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @return {?}
     */
    TransitionAnimationEngine.prototype.elementContainsData = function (namespaceId, element) {
        var /** @type {?} */ containsData = false;
        var /** @type {?} */ details = (element[REMOVAL_FLAG]);
        if (details && details.setForRemoval)
            containsData = true;
        if (this.playersByElement.has(element))
            containsData = true;
        if (this.playersByQueriedElement.has(element))
            containsData = true;
        if (this.statesByElement.has(element))
            containsData = true;
        return this._fetchNamespace(namespaceId).elementContainsData(element) || containsData;
    };
    /**
     * @param {?} callback
     * @return {?}
     */
    TransitionAnimationEngine.prototype.afterFlush = function (callback) { this._flushFns.push(callback); };
    /**
     * @param {?} callback
     * @return {?}
     */
    TransitionAnimationEngine.prototype.afterFlushAnimationsDone = function (callback) { this._whenQuietFns.push(callback); };
    /**
     * @param {?} element
     * @param {?} isQueriedElement
     * @param {?=} namespaceId
     * @param {?=} triggerName
     * @param {?=} toStateValue
     * @return {?}
     */
    TransitionAnimationEngine.prototype._getPreviousPlayers = function (element, isQueriedElement, namespaceId, triggerName, toStateValue) {
        var /** @type {?} */ players = [];
        if (isQueriedElement) {
            var /** @type {?} */ queriedElementPlayers = this.playersByQueriedElement.get(element);
            if (queriedElementPlayers) {
                players = queriedElementPlayers;
            }
        }
        else {
            var /** @type {?} */ elementPlayers = this.playersByElement.get(element);
            if (elementPlayers) {
                var /** @type {?} */ isRemovalAnimation_1 = !toStateValue || toStateValue == VOID_VALUE;
                elementPlayers.forEach(function (player) {
                    if (player.queued)
                        return;
                    if (!isRemovalAnimation_1 && player.triggerName != triggerName)
                        return;
                    players.push(player);
                });
            }
        }
        if (namespaceId || triggerName) {
            players = players.filter(function (player) {
                if (namespaceId && namespaceId != player.namespaceId)
                    return false;
                if (triggerName && triggerName != player.triggerName)
                    return false;
                return true;
            });
        }
        return players;
    };
    /**
     * @param {?} namespaceId
     * @param {?} instruction
     * @param {?} allPreviousPlayersMap
     * @return {?}
     */
    TransitionAnimationEngine.prototype._beforeAnimationBuild = function (namespaceId, instruction, allPreviousPlayersMap) {
        var _this = this;
        // it's important to do this step before destroying the players
        // so that the onDone callback below won't fire before this
        eraseStyles(instruction.element, instruction.fromStyles);
        var /** @type {?} */ triggerName = instruction.triggerName;
        var /** @type {?} */ rootElement = instruction.element;
        // when a removal animation occurs, ALL previous players are collected
        // and destroyed (even if they are outside of the current namespace)
        var /** @type {?} */ targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId;
        var /** @type {?} */ targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName;
        instruction.timelines.map(function (timelineInstruction) {
            var /** @type {?} */ element = timelineInstruction.element;
            var /** @type {?} */ isQueriedElement = element !== rootElement;
            var /** @type {?} */ players = getOrSetAsInMap(allPreviousPlayersMap, element, []);
            var /** @type {?} */ previousPlayers = _this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);
            previousPlayers.forEach(function (player) {
                var /** @type {?} */ realPlayer = (player.getRealPlayer());
                if (realPlayer.beforeDestroy) {
                    realPlayer.beforeDestroy();
                }
                players.push(player);
            });
        });
    };
    /**
     * @param {?} namespaceId
     * @param {?} instruction
     * @param {?} allPreviousPlayersMap
     * @param {?} skippedPlayersMap
     * @param {?} preStylesMap
     * @param {?} postStylesMap
     * @return {?}
     */
    TransitionAnimationEngine.prototype._buildAnimation = function (namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) {
        var _this = this;
        var /** @type {?} */ triggerName = instruction.triggerName;
        var /** @type {?} */ rootElement = instruction.element;
        // we first run this so that the previous animation player
        // data can be passed into the successive animation players
        var /** @type {?} */ allQueriedPlayers = [];
        var /** @type {?} */ allConsumedElements = new Set();
        var /** @type {?} */ allSubElements = new Set();
        var /** @type {?} */ allNewPlayers = instruction.timelines.map(function (timelineInstruction) {
            var /** @type {?} */ element = timelineInstruction.element;
            // FIXME (matsko): make sure to-be-removed animations are removed properly
            var /** @type {?} */ details = element[REMOVAL_FLAG];
            if (details && details.removedBeforeQueried)
                return new __WEBPACK_IMPORTED_MODULE_1__angular_animations__["NoopAnimationPlayer"]();
            var /** @type {?} */ isQueriedElement = element !== rootElement;
            var /** @type {?} */ previousPlayers = EMPTY_PLAYER_ARRAY;
            if (!allConsumedElements.has(element)) {
                allConsumedElements.add(element);
                var /** @type {?} */ _previousPlayers = allPreviousPlayersMap.get(element);
                if (_previousPlayers) {
                    previousPlayers = _previousPlayers.map(function (p) { return p.getRealPlayer(); });
                }
            }
            var /** @type {?} */ preStyles = preStylesMap.get(element);
            var /** @type {?} */ postStyles = postStylesMap.get(element);
            var /** @type {?} */ keyframes = normalizeKeyframes(_this.driver, _this._normalizer, element, timelineInstruction.keyframes, preStyles, postStyles);
            var /** @type {?} */ player = _this._buildPlayer(timelineInstruction, keyframes, previousPlayers);
            // this means that this particular player belongs to a sub trigger. It is
            // important that we match this player up with the corresponding (@trigger.listener)
            if (timelineInstruction.subTimeline && skippedPlayersMap) {
                allSubElements.add(element);
            }
            if (isQueriedElement) {
                var /** @type {?} */ wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);
                wrappedPlayer.setRealPlayer(player);
                allQueriedPlayers.push(wrappedPlayer);
            }
            return player;
        });
        allQueriedPlayers.forEach(function (player) {
            getOrSetAsInMap(_this.playersByQueriedElement, player.element, []).push(player);
            player.onDone(function () { return deleteOrUnsetInMap(_this.playersByQueriedElement, player.element, player); });
        });
        allConsumedElements.forEach(function (element) { return addClass(element, NG_ANIMATING_CLASSNAME); });
        var /** @type {?} */ player = optimizeGroupPlayer(allNewPlayers);
        player.onDestroy(function () {
            allConsumedElements.forEach(function (element) { return removeClass(element, NG_ANIMATING_CLASSNAME); });
            setStyles(rootElement, instruction.toStyles);
        });
        // this basically makes all of the callbacks for sub element animations
        // be dependent on the upper players for when they finish
        allSubElements.forEach(function (element) { getOrSetAsInMap(skippedPlayersMap, element, []).push(player); });
        return player;
    };
    /**
     * @param {?} instruction
     * @param {?} keyframes
     * @param {?} previousPlayers
     * @return {?}
     */
    TransitionAnimationEngine.prototype._buildPlayer = function (instruction, keyframes, previousPlayers) {
        if (keyframes.length > 0) {
            return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers);
        }
        // special case for when an empty transition|definition is provided
        // ... there is no point in rendering an empty animation
        return new __WEBPACK_IMPORTED_MODULE_1__angular_animations__["NoopAnimationPlayer"]();
    };
    return TransitionAnimationEngine;
}());
var TransitionAnimationPlayer = (function () {
    /**
     * @param {?} namespaceId
     * @param {?} triggerName
     * @param {?} element
     */
    function TransitionAnimationPlayer(namespaceId, triggerName, element) {
        this.namespaceId = namespaceId;
        this.triggerName = triggerName;
        this.element = element;
        this._player = new __WEBPACK_IMPORTED_MODULE_1__angular_animations__["NoopAnimationPlayer"]();
        this._containsRealPlayer = false;
        this._queuedCallbacks = {};
        this._destroyed = false;
        this.markedForDestroy = false;
    }
    Object.defineProperty(TransitionAnimationPlayer.prototype, "queued", {
        /**
         * @return {?}
         */
        get: function () { return this._containsRealPlayer == false; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TransitionAnimationPlayer.prototype, "destroyed", {
        /**
         * @return {?}
         */
        get: function () { return this._destroyed; },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} player
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.setRealPlayer = function (player) {
        var _this = this;
        if (this._containsRealPlayer)
            return;
        this._player = player;
        Object.keys(this._queuedCallbacks).forEach(function (phase) {
            _this._queuedCallbacks[phase].forEach(function (callback) { return listenOnPlayer(player, phase, undefined, callback); });
        });
        this._queuedCallbacks = {};
        this._containsRealPlayer = true;
    };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.getRealPlayer = function () { return this._player; };
    /**
     * @param {?} name
     * @param {?} callback
     * @return {?}
     */
    TransitionAnimationPlayer.prototype._queueEvent = function (name, callback) {
        getOrSetAsInMap(this._queuedCallbacks, name, []).push(callback);
    };
    /**
     * @param {?} fn
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.onDone = function (fn) {
        if (this.queued) {
            this._queueEvent('done', fn);
        }
        this._player.onDone(fn);
    };
    /**
     * @param {?} fn
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.onStart = function (fn) {
        if (this.queued) {
            this._queueEvent('start', fn);
        }
        this._player.onStart(fn);
    };
    /**
     * @param {?} fn
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.onDestroy = function (fn) {
        if (this.queued) {
            this._queueEvent('destroy', fn);
        }
        this._player.onDestroy(fn);
    };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.init = function () { this._player.init(); };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.hasStarted = function () { return this.queued ? false : this._player.hasStarted(); };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.play = function () { !this.queued && this._player.play(); };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.pause = function () { !this.queued && this._player.pause(); };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.restart = function () { !this.queued && this._player.restart(); };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.finish = function () { this._player.finish(); };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.destroy = function () {
        this._destroyed = true;
        this._player.destroy();
    };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.reset = function () { !this.queued && this._player.reset(); };
    /**
     * @param {?} p
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.setPosition = function (p) {
        if (!this.queued) {
            this._player.setPosition(p);
        }
    };
    /**
     * @return {?}
     */
    TransitionAnimationPlayer.prototype.getPosition = function () { return this.queued ? 0 : this._player.getPosition(); };
    Object.defineProperty(TransitionAnimationPlayer.prototype, "totalTime", {
        /**
         * @return {?}
         */
        get: function () { return this._player.totalTime; },
        enumerable: true,
        configurable: true
    });
    return TransitionAnimationPlayer;
}());
/**
 * @param {?} map
 * @param {?} key
 * @param {?} value
 * @return {?}
 */
function deleteOrUnsetInMap(map, key, value) {
    var /** @type {?} */ currentValues;
    if (map instanceof Map) {
        currentValues = map.get(key);
        if (currentValues) {
            if (currentValues.length) {
                var /** @type {?} */ index = currentValues.indexOf(value);
                currentValues.splice(index, 1);
            }
            if (currentValues.length == 0) {
                map.delete(key);
            }
        }
    }
    else {
        currentValues = map[key];
        if (currentValues) {
            if (currentValues.length) {
                var /** @type {?} */ index = currentValues.indexOf(value);
                currentValues.splice(index, 1);
            }
            if (currentValues.length == 0) {
                delete map[key];
            }
        }
    }
    return currentValues;
}
/**
 * @param {?} value
 * @return {?}
 */
function normalizeTriggerValue(value) {
    switch (typeof value) {
        case 'boolean':
            return value ? '1' : '0';
        default:
            return value != null ? value.toString() : null;
    }
}
/**
 * @param {?} node
 * @return {?}
 */
function isElementNode(node) {
    return node && node['nodeType'] === 1;
}
/**
 * @param {?} eventName
 * @return {?}
 */
function isTriggerEventValid(eventName) {
    return eventName == 'start' || eventName == 'done';
}
/**
 * @param {?} element
 * @param {?=} value
 * @return {?}
 */
function cloakElement(element, value) {
    var /** @type {?} */ oldValue = element.style.display;
    element.style.display = value != null ? value : 'none';
    return oldValue;
}
/**
 * @param {?} driver
 * @param {?} elements
 * @param {?} elementPropsMap
 * @param {?} defaultStyle
 * @return {?}
 */
function cloakAndComputeStyles(driver, elements, elementPropsMap, defaultStyle) {
    var /** @type {?} */ cloakVals = elements.map(function (element) { return cloakElement(element); });
    var /** @type {?} */ valuesMap = new Map();
    elementPropsMap.forEach(function (props, element) {
        var /** @type {?} */ styles = {};
        props.forEach(function (prop) {
            var /** @type {?} */ value = styles[prop] = driver.computeStyle(element, prop, defaultStyle);
            // there is no easy way to detect this because a sub element could be removed
            // by a parent animation element being detached.
            if (!value || value.length == 0) {
                element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;
            }
        });
        valuesMap.set(element, styles);
    });
    elements.forEach(function (element, i) { return cloakElement(element, cloakVals[i]); });
    return valuesMap;
}
/**
 * @param {?} nodes
 * @return {?}
 */
function createIsRootFilterFn(nodes) {
    var /** @type {?} */ nodeSet = new Set(nodes);
    var /** @type {?} */ knownRootContainer = new Set();
    var /** @type {?} */ isRoot;
    isRoot = function (node) {
        if (!node)
            return true;
        if (nodeSet.has(node.parentNode))
            return false;
        if (knownRootContainer.has(node.parentNode))
            return true;
        if (isRoot(node.parentNode)) {
            knownRootContainer.add(node);
            return true;
        }
        return false;
    };
    return isRoot;
}
var CLASSES_CACHE_KEY = '$$classes';
/**
 * @param {?} element
 * @param {?} className
 * @return {?}
 */
function containsClass(element, className) {
    if (element.classList) {
        return element.classList.contains(className);
    }
    else {
        var /** @type {?} */ classes = element[CLASSES_CACHE_KEY];
        return classes && classes[className];
    }
}
/**
 * @param {?} element
 * @param {?} className
 * @return {?}
 */
function addClass(element, className) {
    if (element.classList) {
        element.classList.add(className);
    }
    else {
        var /** @type {?} */ classes = element[CLASSES_CACHE_KEY];
        if (!classes) {
            classes = element[CLASSES_CACHE_KEY] = {};
        }
        classes[className] = true;
    }
}
/**
 * @param {?} element
 * @param {?} className
 * @return {?}
 */
function removeClass(element, className) {
    if (element.classList) {
        element.classList.remove(className);
    }
    else {
        var /** @type {?} */ classes = element[CLASSES_CACHE_KEY];
        if (classes) {
            delete classes[className];
        }
    }
}
/**
 * @return {?}
 */
function getBodyNode() {
    if (typeof document != 'undefined') {
        return document.body;
    }
    return null;
}
/**
 * @param {?} engine
 * @param {?} element
 * @param {?} players
 * @return {?}
 */
function removeNodesAfterAnimationDone(engine, element, players) {
    optimizeGroupPlayer(players).onDone(function () { return engine.processLeaveNode(element); });
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var AnimationEngine = (function () {
    /**
     * @param {?} driver
     * @param {?} normalizer
     */
    function AnimationEngine(driver, normalizer) {
        var _this = this;
        this._triggerCache = {};
        this.onRemovalComplete = function (element, context) { };
        this._transitionEngine = new TransitionAnimationEngine(driver, normalizer);
        this._timelineEngine = new TimelineAnimationEngine(driver, normalizer);
        this._transitionEngine.onRemovalComplete =
            function (element, context) { _this.onRemovalComplete(element, context); };
    }
    /**
     * @param {?} componentId
     * @param {?} namespaceId
     * @param {?} hostElement
     * @param {?} name
     * @param {?} metadata
     * @return {?}
     */
    AnimationEngine.prototype.registerTrigger = function (componentId, namespaceId, hostElement, name, metadata) {
        var /** @type {?} */ cacheKey = componentId + '-' + name;
        var /** @type {?} */ trigger = this._triggerCache[cacheKey];
        if (!trigger) {
            var /** @type {?} */ errors = [];
            var /** @type {?} */ ast = (buildAnimationAst(/** @type {?} */ (metadata), errors));
            if (errors.length) {
                throw new Error("The animation trigger \"" + name + "\" has failed to build due to the following errors:\n - " + errors.join("\n - "));
            }
            trigger = buildTrigger(name, ast);
            this._triggerCache[cacheKey] = trigger;
        }
        this._transitionEngine.registerTrigger(namespaceId, name, trigger);
    };
    /**
     * @param {?} namespaceId
     * @param {?} hostElement
     * @return {?}
     */
    AnimationEngine.prototype.register = function (namespaceId, hostElement) {
        this._transitionEngine.register(namespaceId, hostElement);
    };
    /**
     * @param {?} namespaceId
     * @param {?} context
     * @return {?}
     */
    AnimationEngine.prototype.destroy = function (namespaceId, context) {
        this._transitionEngine.destroy(namespaceId, context);
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} parent
     * @param {?} insertBefore
     * @return {?}
     */
    AnimationEngine.prototype.onInsert = function (namespaceId, element, parent, insertBefore) {
        this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} context
     * @return {?}
     */
    AnimationEngine.prototype.onRemove = function (namespaceId, element, context) {
        this._transitionEngine.removeNode(namespaceId, element, context);
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} property
     * @param {?} value
     * @return {?}
     */
    AnimationEngine.prototype.setProperty = function (namespaceId, element, property, value) {
        // @@property
        if (property.charAt(0) == '@') {
            var _a = parseTimelineCommand(property), id = _a[0], action = _a[1];
            var /** @type {?} */ args = (value);
            this._timelineEngine.command(id, element, action, args);
            return false;
        }
        return this._transitionEngine.trigger(namespaceId, element, property, value);
    };
    /**
     * @param {?} namespaceId
     * @param {?} element
     * @param {?} eventName
     * @param {?} eventPhase
     * @param {?} callback
     * @return {?}
     */
    AnimationEngine.prototype.listen = function (namespaceId, element, eventName, eventPhase, callback) {
        // @@listen
        if (eventName.charAt(0) == '@') {
            var _a = parseTimelineCommand(eventName), id = _a[0], action = _a[1];
            return this._timelineEngine.listen(id, element, action, callback);
        }
        return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);
    };
    /**
     * @param {?=} microtaskId
     * @return {?}
     */
    AnimationEngine.prototype.flush = function (microtaskId) {
        if (microtaskId === void 0) { microtaskId = -1; }
        this._transitionEngine.flush(microtaskId);
    };
    Object.defineProperty(AnimationEngine.prototype, "players", {
        /**
         * @return {?}
         */
        get: function () {
            return ((this._transitionEngine.players))
                .concat(/** @type {?} */ (this._timelineEngine.players));
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    AnimationEngine.prototype.whenRenderingDone = function () { return this._transitionEngine.whenRenderingDone(); };
    return AnimationEngine;
}());
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var WebAnimationsPlayer = (function () {
    /**
     * @param {?} element
     * @param {?} keyframes
     * @param {?} options
     * @param {?=} previousPlayers
     */
    function WebAnimationsPlayer(element, keyframes, options, previousPlayers) {
        if (previousPlayers === void 0) { previousPlayers = []; }
        var _this = this;
        this.element = element;
        this.keyframes = keyframes;
        this.options = options;
        this.previousPlayers = previousPlayers;
        this._onDoneFns = [];
        this._onStartFns = [];
        this._onDestroyFns = [];
        this._initialized = false;
        this._finished = false;
        this._started = false;
        this._destroyed = false;
        this.time = 0;
        this.parentPlayer = null;
        this.currentSnapshot = {};
        this._duration = options['duration'];
        this._delay = options['delay'] || 0;
        this.time = this._duration + this._delay;
        this.previousStyles = {};
        previousPlayers.forEach(function (player) {
            var styles = player.currentSnapshot;
            Object.keys(styles).forEach(function (prop) { return _this.previousStyles[prop] = styles[prop]; });
        });
    }
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype._onFinish = function () {
        if (!this._finished) {
            this._finished = true;
            this._onDoneFns.forEach(function (fn) { return fn(); });
            this._onDoneFns = [];
        }
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.init = function () {
        this._buildPlayer();
        this._preparePlayerBeforeStart();
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype._buildPlayer = function () {
        var _this = this;
        if (this._initialized)
            return;
        this._initialized = true;
        var /** @type {?} */ keyframes = this.keyframes.map(function (styles) { return copyStyles(styles, false); });
        var /** @type {?} */ previousStyleProps = Object.keys(this.previousStyles);
        if (previousStyleProps.length) {
            var /** @type {?} */ startingKeyframe_1 = keyframes[0];
            var /** @type {?} */ missingStyleProps_1 = [];
            previousStyleProps.forEach(function (prop) {
                if (!startingKeyframe_1.hasOwnProperty(prop)) {
                    missingStyleProps_1.push(prop);
                }
                startingKeyframe_1[prop] = _this.previousStyles[prop];
            });
            if (missingStyleProps_1.length) {
                var /** @type {?} */ self_1 = this;
                var _loop_1 = function () {
                    var /** @type {?} */ kf = keyframes[i];
                    missingStyleProps_1.forEach(function (prop) {
                        kf[prop] = _computeStyle(self_1.element, prop);
                    });
                };
                // tslint:disable-next-line
                for (var /** @type {?} */ i = 1; i < keyframes.length; i++) {
                    _loop_1();
                }
            }
        }
        this._player = this._triggerWebAnimation(this.element, keyframes, this.options);
        this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : {};
        this._player.addEventListener('finish', function () { return _this._onFinish(); });
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype._preparePlayerBeforeStart = function () {
        // this is required so that the player doesn't start to animate right away
        if (this._delay) {
            this._resetDomPlayerState();
        }
        else {
            this._player.pause();
        }
    };
    /**
     * \@internal
     * @param {?} element
     * @param {?} keyframes
     * @param {?} options
     * @return {?}
     */
    WebAnimationsPlayer.prototype._triggerWebAnimation = function (element, keyframes, options) {
        // jscompiler doesn't seem to know animate is a native property because it's not fully
        // supported yet across common browsers (we polyfill it for Edge/Safari) [CL #143630929]
        return (element['animate'](keyframes, options));
    };
    Object.defineProperty(WebAnimationsPlayer.prototype, "domPlayer", {
        /**
         * @return {?}
         */
        get: function () { return this._player; },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} fn
     * @return {?}
     */
    WebAnimationsPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); };
    /**
     * @param {?} fn
     * @return {?}
     */
    WebAnimationsPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); };
    /**
     * @param {?} fn
     * @return {?}
     */
    WebAnimationsPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.play = function () {
        this._buildPlayer();
        if (!this.hasStarted()) {
            this._onStartFns.forEach(function (fn) { return fn(); });
            this._onStartFns = [];
            this._started = true;
        }
        this._player.play();
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.pause = function () {
        this.init();
        this._player.pause();
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.finish = function () {
        this.init();
        this._onFinish();
        this._player.finish();
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.reset = function () {
        this._resetDomPlayerState();
        this._destroyed = false;
        this._finished = false;
        this._started = false;
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype._resetDomPlayerState = function () {
        if (this._player) {
            this._player.cancel();
        }
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.restart = function () {
        this.reset();
        this.play();
    };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.hasStarted = function () { return this._started; };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.destroy = function () {
        if (!this._destroyed) {
            this._resetDomPlayerState();
            this._onFinish();
            this._destroyed = true;
            this._onDestroyFns.forEach(function (fn) { return fn(); });
            this._onDestroyFns = [];
        }
    };
    /**
     * @param {?} p
     * @return {?}
     */
    WebAnimationsPlayer.prototype.setPosition = function (p) { this._player.currentTime = p * this.time; };
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.getPosition = function () { return this._player.currentTime / this.time; };
    Object.defineProperty(WebAnimationsPlayer.prototype, "totalTime", {
        /**
         * @return {?}
         */
        get: function () { return this._delay + this._duration; },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    WebAnimationsPlayer.prototype.beforeDestroy = function () {
        var _this = this;
        var /** @type {?} */ styles = {};
        if (this.hasStarted()) {
            Object.keys(this._finalKeyframe).forEach(function (prop) {
                if (prop != 'offset') {
                    styles[prop] =
                        _this._finished ? _this._finalKeyframe[prop] : _computeStyle(_this.element, prop);
                }
            });
        }
        this.currentSnapshot = styles;
    };
    return WebAnimationsPlayer;
}());
/**
 * @param {?} element
 * @param {?} prop
 * @return {?}
 */
function _computeStyle(element, prop) {
    return ((window.getComputedStyle(element)))[prop];
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var WebAnimationsDriver = (function () {
    function WebAnimationsDriver() {
    }
    /**
     * @param {?} element
     * @param {?} selector
     * @return {?}
     */
    WebAnimationsDriver.prototype.matchesElement = function (element, selector) {
        return matchesElement(element, selector);
    };
    /**
     * @param {?} elm1
     * @param {?} elm2
     * @return {?}
     */
    WebAnimationsDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };
    /**
     * @param {?} element
     * @param {?} selector
     * @param {?} multi
     * @return {?}
     */
    WebAnimationsDriver.prototype.query = function (element, selector, multi) {
        return invokeQuery(element, selector, multi);
    };
    /**
     * @param {?} element
     * @param {?} prop
     * @param {?=} defaultValue
     * @return {?}
     */
    WebAnimationsDriver.prototype.computeStyle = function (element, prop, defaultValue) {
        return (((window.getComputedStyle(element)))[prop]);
    };
    /**
     * @param {?} element
     * @param {?} keyframes
     * @param {?} duration
     * @param {?} delay
     * @param {?} easing
     * @param {?=} previousPlayers
     * @return {?}
     */
    WebAnimationsDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) {
        if (previousPlayers === void 0) { previousPlayers = []; }
        var /** @type {?} */ fill = delay == 0 ? 'both' : 'forwards';
        var /** @type {?} */ playerOptions = { duration: duration, delay: delay, fill: fill };
        // we check for this to avoid having a null|undefined value be present
        // for the easing (which results in an error for certain browsers #9752)
        if (easing) {
            playerOptions['easing'] = easing;
        }
        var /** @type {?} */ previousWebAnimationPlayers = (previousPlayers.filter(function (player) { return player instanceof WebAnimationsPlayer; }));
        return new WebAnimationsPlayer(element, keyframes, playerOptions, previousWebAnimationPlayers);
    };
    return WebAnimationsDriver;
}());
/**
 * @return {?}
 */
function supportsWebAnimations() {
    return typeof Element !== 'undefined' && typeof ((Element)).prototype['animate'] === 'function';
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @module
 * @description
 * Entry point for all animation APIs of the animation browser package.
 */
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @module
 * @description
 * Entry point for all public APIs of the animation package.
 */
/**
 * Generated bundle index. Do not edit.
 */

//# sourceMappingURL=browser.es5.js.map


/***/ }),
/* 533 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BrowserAnimationsModule; });
/* unused harmony export NoopAnimationsModule */
/* unused harmony export ɵBrowserAnimationBuilder */
/* unused harmony export ɵBrowserAnimationFactory */
/* unused harmony export ɵAnimationRenderer */
/* unused harmony export ɵAnimationRendererFactory */
/* unused harmony export ɵa */
/* unused harmony export ɵf */
/* unused harmony export ɵg */
/* unused harmony export ɵb */
/* unused harmony export ɵd */
/* unused harmony export ɵe */
/* unused harmony export ɵc */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__ = __webpack_require__(251);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_animations__ = __webpack_require__(526);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__ = __webpack_require__(532);

/**
 * @license Angular v4.2.5
 * (c) 2010-2017 Google, Inc. https://angular.io/
 * License: MIT
 */




/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var BrowserAnimationBuilder = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](BrowserAnimationBuilder, _super);
    /**
     * @param {?} rootRenderer
     */
    function BrowserAnimationBuilder(rootRenderer) {
        var _this = _super.call(this) || this;
        _this._nextAnimationId = 0;
        var typeData = {
            id: '0',
            encapsulation: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ViewEncapsulation"].None,
            styles: [],
            data: { animation: [] }
        };
        _this._renderer = rootRenderer.createRenderer(document.body, typeData);
        return _this;
    }
    /**
     * @param {?} animation
     * @return {?}
     */
    BrowserAnimationBuilder.prototype.build = function (animation) {
        var /** @type {?} */ id = this._nextAnimationId.toString();
        this._nextAnimationId++;
        var /** @type {?} */ entry = Array.isArray(animation) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__angular_animations__["sequence"])(animation) : animation;
        issueAnimationCommand(this._renderer, null, id, 'register', [entry]);
        return new BrowserAnimationFactory(id, this._renderer);
    };
    return BrowserAnimationBuilder;
}(__WEBPACK_IMPORTED_MODULE_3__angular_animations__["AnimationBuilder"]));
BrowserAnimationBuilder.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Injectable"] },
];
/**
 * @nocollapse
 */
BrowserAnimationBuilder.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["RendererFactory2"], },
]; };
var BrowserAnimationFactory = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](BrowserAnimationFactory, _super);
    /**
     * @param {?} _id
     * @param {?} _renderer
     */
    function BrowserAnimationFactory(_id, _renderer) {
        var _this = _super.call(this) || this;
        _this._id = _id;
        _this._renderer = _renderer;
        return _this;
    }
    /**
     * @param {?} element
     * @param {?=} options
     * @return {?}
     */
    BrowserAnimationFactory.prototype.create = function (element, options) {
        return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);
    };
    return BrowserAnimationFactory;
}(__WEBPACK_IMPORTED_MODULE_3__angular_animations__["AnimationFactory"]));
var RendererAnimationPlayer = (function () {
    /**
     * @param {?} id
     * @param {?} element
     * @param {?} options
     * @param {?} _renderer
     */
    function RendererAnimationPlayer(id, element, options, _renderer) {
        this.id = id;
        this.element = element;
        this._renderer = _renderer;
        this.parentPlayer = null;
        this._started = false;
        this.totalTime = 0;
        this._command('create', options);
    }
    /**
     * @param {?} eventName
     * @param {?} callback
     * @return {?}
     */
    RendererAnimationPlayer.prototype._listen = function (eventName, callback) {
        return this._renderer.listen(this.element, "@@" + this.id + ":" + eventName, callback);
    };
    /**
     * @param {?} command
     * @param {...?} args
     * @return {?}
     */
    RendererAnimationPlayer.prototype._command = function (command) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        return issueAnimationCommand(this._renderer, this.element, this.id, command, args);
    };
    /**
     * @param {?} fn
     * @return {?}
     */
    RendererAnimationPlayer.prototype.onDone = function (fn) { this._listen('done', fn); };
    /**
     * @param {?} fn
     * @return {?}
     */
    RendererAnimationPlayer.prototype.onStart = function (fn) { this._listen('start', fn); };
    /**
     * @param {?} fn
     * @return {?}
     */
    RendererAnimationPlayer.prototype.onDestroy = function (fn) { this._listen('destroy', fn); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.init = function () { this._command('init'); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.hasStarted = function () { return this._started; };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.play = function () {
        this._command('play');
        this._started = true;
    };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.pause = function () { this._command('pause'); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.restart = function () { this._command('restart'); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.finish = function () { this._command('finish'); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.destroy = function () { this._command('destroy'); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.reset = function () { this._command('reset'); };
    /**
     * @param {?} p
     * @return {?}
     */
    RendererAnimationPlayer.prototype.setPosition = function (p) { this._command('setPosition', p); };
    /**
     * @return {?}
     */
    RendererAnimationPlayer.prototype.getPosition = function () { return 0; };
    return RendererAnimationPlayer;
}());
/**
 * @param {?} renderer
 * @param {?} element
 * @param {?} id
 * @param {?} command
 * @param {?} args
 * @return {?}
 */
function issueAnimationCommand(renderer, element, id, command, args) {
    return renderer.setProperty(element, "@@" + id + ":" + command, args);
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var AnimationRendererFactory = (function () {
    /**
     * @param {?} delegate
     * @param {?} engine
     * @param {?} _zone
     */
    function AnimationRendererFactory(delegate, engine, _zone) {
        this.delegate = delegate;
        this.engine = engine;
        this._zone = _zone;
        this._currentId = 0;
        this._microtaskId = 1;
        this._animationCallbacksBuffer = [];
        this._rendererCache = new Map();
        engine.onRemovalComplete = function (element, delegate) {
            // Note: if an component element has a leave animation, and the component
            // a host leave animation, the view engine will call `removeChild` for the parent
            // component renderer as well as for the child component renderer.
            // Therefore, we need to check if we already removed the element.
            if (delegate && delegate.parentNode(element)) {
                delegate.removeChild(element.parentNode, element);
            }
        };
    }
    /**
     * @param {?} hostElement
     * @param {?} type
     * @return {?}
     */
    AnimationRendererFactory.prototype.createRenderer = function (hostElement, type) {
        var _this = this;
        var /** @type {?} */ EMPTY_NAMESPACE_ID = '';
        // cache the delegates to find out which cached delegate can
        // be used by which cached renderer
        var /** @type {?} */ delegate = this.delegate.createRenderer(hostElement, type);
        if (!hostElement || !type || !type.data || !type.data['animation']) {
            var /** @type {?} */ renderer = this._rendererCache.get(delegate);
            if (!renderer) {
                renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine);
                // only cache this result when the base renderer is used
                this._rendererCache.set(delegate, renderer);
            }
            return renderer;
        }
        var /** @type {?} */ componentId = type.id;
        var /** @type {?} */ namespaceId = type.id + '-' + this._currentId;
        this._currentId++;
        this.engine.register(namespaceId, hostElement);
        var /** @type {?} */ animationTriggers = (type.data['animation']);
        animationTriggers.forEach(function (trigger) { return _this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger); });
        return new AnimationRenderer(this, namespaceId, delegate, this.engine);
    };
    /**
     * @return {?}
     */
    AnimationRendererFactory.prototype.begin = function () {
        if (this.delegate.begin) {
            this.delegate.begin();
        }
    };
    /**
     * @return {?}
     */
    AnimationRendererFactory.prototype._scheduleCountTask = function () {
        var _this = this;
        Zone.current.scheduleMicroTask('incremenet the animation microtask', function () { return _this._microtaskId++; });
    };
    /**
     * @param {?} count
     * @param {?} fn
     * @param {?} data
     * @return {?}
     */
    AnimationRendererFactory.prototype.scheduleListenerCallback = function (count, fn, data) {
        var _this = this;
        if (count >= 0 && count < this._microtaskId) {
            this._zone.run(function () { return fn(data); });
            return;
        }
        if (this._animationCallbacksBuffer.length == 0) {
            Promise.resolve(null).then(function () {
                _this._zone.run(function () {
                    _this._animationCallbacksBuffer.forEach(function (tuple) {
                        var fn = tuple[0], data = tuple[1];
                        fn(data);
                    });
                    _this._animationCallbacksBuffer = [];
                });
            });
        }
        this._animationCallbacksBuffer.push([fn, data]);
    };
    /**
     * @return {?}
     */
    AnimationRendererFactory.prototype.end = function () {
        var _this = this;
        this._zone.runOutsideAngular(function () {
            _this._scheduleCountTask();
            _this.engine.flush(_this._microtaskId);
        });
        if (this.delegate.end) {
            this.delegate.end();
        }
    };
    /**
     * @return {?}
     */
    AnimationRendererFactory.prototype.whenRenderingDone = function () { return this.engine.whenRenderingDone(); };
    return AnimationRendererFactory;
}());
AnimationRendererFactory.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Injectable"] },
];
/**
 * @nocollapse
 */
AnimationRendererFactory.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["RendererFactory2"], },
    { type: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["a" /* ɵAnimationEngine */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["NgZone"], },
]; };
var BaseAnimationRenderer = (function () {
    /**
     * @param {?} namespaceId
     * @param {?} delegate
     * @param {?} engine
     */
    function BaseAnimationRenderer(namespaceId, delegate, engine) {
        this.namespaceId = namespaceId;
        this.delegate = delegate;
        this.engine = engine;
        this.destroyNode = this.delegate.destroyNode ? function (n) { return delegate.destroyNode(n); } : null;
    }
    Object.defineProperty(BaseAnimationRenderer.prototype, "data", {
        /**
         * @return {?}
         */
        get: function () { return this.delegate.data; },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    BaseAnimationRenderer.prototype.destroy = function () {
        this.engine.destroy(this.namespaceId, this.delegate);
        this.delegate.destroy();
    };
    /**
     * @param {?} name
     * @param {?=} namespace
     * @return {?}
     */
    BaseAnimationRenderer.prototype.createElement = function (name, namespace) {
        return this.delegate.createElement(name, namespace);
    };
    /**
     * @param {?} value
     * @return {?}
     */
    BaseAnimationRenderer.prototype.createComment = function (value) { return this.delegate.createComment(value); };
    /**
     * @param {?} value
     * @return {?}
     */
    BaseAnimationRenderer.prototype.createText = function (value) { return this.delegate.createText(value); };
    /**
     * @param {?} parent
     * @param {?} newChild
     * @return {?}
     */
    BaseAnimationRenderer.prototype.appendChild = function (parent, newChild) {
        this.delegate.appendChild(parent, newChild);
        this.engine.onInsert(this.namespaceId, newChild, parent, false);
    };
    /**
     * @param {?} parent
     * @param {?} newChild
     * @param {?} refChild
     * @return {?}
     */
    BaseAnimationRenderer.prototype.insertBefore = function (parent, newChild, refChild) {
        this.delegate.insertBefore(parent, newChild, refChild);
        this.engine.onInsert(this.namespaceId, newChild, parent, true);
    };
    /**
     * @param {?} parent
     * @param {?} oldChild
     * @return {?}
     */
    BaseAnimationRenderer.prototype.removeChild = function (parent, oldChild) {
        this.engine.onRemove(this.namespaceId, oldChild, this.delegate);
    };
    /**
     * @param {?} selectorOrNode
     * @return {?}
     */
    BaseAnimationRenderer.prototype.selectRootElement = function (selectorOrNode) { return this.delegate.selectRootElement(selectorOrNode); };
    /**
     * @param {?} node
     * @return {?}
     */
    BaseAnimationRenderer.prototype.parentNode = function (node) { return this.delegate.parentNode(node); };
    /**
     * @param {?} node
     * @return {?}
     */
    BaseAnimationRenderer.prototype.nextSibling = function (node) { return this.delegate.nextSibling(node); };
    /**
     * @param {?} el
     * @param {?} name
     * @param {?} value
     * @param {?=} namespace
     * @return {?}
     */
    BaseAnimationRenderer.prototype.setAttribute = function (el, name, value, namespace) {
        this.delegate.setAttribute(el, name, value, namespace);
    };
    /**
     * @param {?} el
     * @param {?} name
     * @param {?=} namespace
     * @return {?}
     */
    BaseAnimationRenderer.prototype.removeAttribute = function (el, name, namespace) {
        this.delegate.removeAttribute(el, name, namespace);
    };
    /**
     * @param {?} el
     * @param {?} name
     * @return {?}
     */
    BaseAnimationRenderer.prototype.addClass = function (el, name) { this.delegate.addClass(el, name); };
    /**
     * @param {?} el
     * @param {?} name
     * @return {?}
     */
    BaseAnimationRenderer.prototype.removeClass = function (el, name) { this.delegate.removeClass(el, name); };
    /**
     * @param {?} el
     * @param {?} style
     * @param {?} value
     * @param {?=} flags
     * @return {?}
     */
    BaseAnimationRenderer.prototype.setStyle = function (el, style, value, flags) {
        this.delegate.setStyle(el, style, value, flags);
    };
    /**
     * @param {?} el
     * @param {?} style
     * @param {?=} flags
     * @return {?}
     */
    BaseAnimationRenderer.prototype.removeStyle = function (el, style, flags) {
        this.delegate.removeStyle(el, style, flags);
    };
    /**
     * @param {?} el
     * @param {?} name
     * @param {?} value
     * @return {?}
     */
    BaseAnimationRenderer.prototype.setProperty = function (el, name, value) {
        this.delegate.setProperty(el, name, value);
    };
    /**
     * @param {?} node
     * @param {?} value
     * @return {?}
     */
    BaseAnimationRenderer.prototype.setValue = function (node, value) { this.delegate.setValue(node, value); };
    /**
     * @param {?} target
     * @param {?} eventName
     * @param {?} callback
     * @return {?}
     */
    BaseAnimationRenderer.prototype.listen = function (target, eventName, callback) {
        return this.delegate.listen(target, eventName, callback);
    };
    return BaseAnimationRenderer;
}());
var AnimationRenderer = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](AnimationRenderer, _super);
    /**
     * @param {?} factory
     * @param {?} namespaceId
     * @param {?} delegate
     * @param {?} engine
     */
    function AnimationRenderer(factory, namespaceId, delegate, engine) {
        var _this = _super.call(this, namespaceId, delegate, engine) || this;
        _this.factory = factory;
        _this.namespaceId = namespaceId;
        return _this;
    }
    /**
     * @param {?} el
     * @param {?} name
     * @param {?} value
     * @return {?}
     */
    AnimationRenderer.prototype.setProperty = function (el, name, value) {
        if (name.charAt(0) == '@') {
            name = name.substr(1);
            this.engine.setProperty(this.namespaceId, el, name, value);
        }
        else {
            this.delegate.setProperty(el, name, value);
        }
    };
    /**
     * @param {?} target
     * @param {?} eventName
     * @param {?} callback
     * @return {?}
     */
    AnimationRenderer.prototype.listen = function (target, eventName, callback) {
        var _this = this;
        if (eventName.charAt(0) == '@') {
            var /** @type {?} */ element = resolveElementFromTarget(target);
            var /** @type {?} */ name = eventName.substr(1);
            var /** @type {?} */ phase = '';
            if (name.charAt(0) != '@') {
                _a = parseTriggerCallbackName(name), name = _a[0], phase = _a[1];
            }
            return this.engine.listen(this.namespaceId, element, name, phase, function (event) {
                var /** @type {?} */ countId = ((event))['_data'] || -1;
                _this.factory.scheduleListenerCallback(countId, callback, event);
            });
        }
        return this.delegate.listen(target, eventName, callback);
        var _a;
    };
    return AnimationRenderer;
}(BaseAnimationRenderer));
/**
 * @param {?} target
 * @return {?}
 */
function resolveElementFromTarget(target) {
    switch (target) {
        case 'body':
            return document.body;
        case 'document':
            return document;
        case 'window':
            return window;
        default:
            return target;
    }
}
/**
 * @param {?} triggerName
 * @return {?}
 */
function parseTriggerCallbackName(triggerName) {
    var /** @type {?} */ dotIndex = triggerName.indexOf('.');
    var /** @type {?} */ trigger = triggerName.substring(0, dotIndex);
    var /** @type {?} */ phase = triggerName.substr(dotIndex + 1);
    return [trigger, phase];
}
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var InjectableAnimationEngine = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](InjectableAnimationEngine, _super);
    /**
     * @param {?} driver
     * @param {?} normalizer
     */
    function InjectableAnimationEngine(driver, normalizer) {
        return _super.call(this, driver, normalizer) || this;
    }
    return InjectableAnimationEngine;
}(__WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["a" /* ɵAnimationEngine */]));
InjectableAnimationEngine.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Injectable"] },
];
/**
 * @nocollapse
 */
InjectableAnimationEngine.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["b" /* AnimationDriver */], },
    { type: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["c" /* ɵAnimationStyleNormalizer */], },
]; };
/**
 * @return {?}
 */
function instantiateSupportedAnimationDriver() {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["d" /* ɵsupportsWebAnimations */])()) {
        return new __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["e" /* ɵWebAnimationsDriver */]();
    }
    return new __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["f" /* ɵNoopAnimationDriver */]();
}
/**
 * @return {?}
 */
function instantiateDefaultStyleNormalizer() {
    return new __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["g" /* ɵWebAnimationsStyleNormalizer */]();
}
/**
 * @param {?} renderer
 * @param {?} engine
 * @param {?} zone
 * @return {?}
 */
function instantiateRendererFactory(renderer, engine, zone) {
    return new AnimationRendererFactory(renderer, engine, zone);
}
var SHARED_ANIMATION_PROVIDERS = [
    { provide: __WEBPACK_IMPORTED_MODULE_3__angular_animations__["AnimationBuilder"], useClass: BrowserAnimationBuilder },
    { provide: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["c" /* ɵAnimationStyleNormalizer */], useFactory: instantiateDefaultStyleNormalizer },
    { provide: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["a" /* ɵAnimationEngine */], useClass: InjectableAnimationEngine }, {
        provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["RendererFactory2"],
        useFactory: instantiateRendererFactory,
        deps: [__WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__["ɵDomRendererFactory2"], __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["a" /* ɵAnimationEngine */], __WEBPACK_IMPORTED_MODULE_1__angular_core__["NgZone"]]
    }
];
/**
 * Separate providers from the actual module so that we can do a local modification in Google3 to
 * include them in the BrowserModule.
 */
var BROWSER_ANIMATIONS_PROVIDERS = [
    { provide: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["b" /* AnimationDriver */], useFactory: instantiateSupportedAnimationDriver }
].concat(SHARED_ANIMATION_PROVIDERS);
/**
 * Separate providers from the actual module so that we can do a local modification in Google3 to
 * include them in the BrowserTestingModule.
 */
var BROWSER_NOOP_ANIMATIONS_PROVIDERS = [{ provide: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["b" /* AnimationDriver */], useClass: __WEBPACK_IMPORTED_MODULE_4__angular_animations_browser__["f" /* ɵNoopAnimationDriver */] }].concat(SHARED_ANIMATION_PROVIDERS);
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * \@experimental Animation support is experimental.
 */
var BrowserAnimationsModule = (function () {
    function BrowserAnimationsModule() {
    }
    return BrowserAnimationsModule;
}());
BrowserAnimationsModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["NgModule"], args: [{
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__["BrowserModule"]],
                providers: BROWSER_ANIMATIONS_PROVIDERS,
            },] },
];
/**
 * @nocollapse
 */
BrowserAnimationsModule.ctorParameters = function () { return []; };
/**
 * \@experimental Animation support is experimental.
 */
var NoopAnimationsModule = (function () {
    function NoopAnimationsModule() {
    }
    return NoopAnimationsModule;
}());
NoopAnimationsModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["NgModule"], args: [{
                imports: [__WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__["BrowserModule"]],
                providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,
            },] },
];
/**
 * @nocollapse
 */
NoopAnimationsModule.ctorParameters = function () { return []; };
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @module
 * @description
 * Entry point for all animation APIs of the animation browser package.
 */
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @module
 * @description
 * Entry point for all public APIs of the animation package.
 */
/**
 * Generated bundle index. Do not edit.
 */

//# sourceMappingURL=animations.es5.js.map


/***/ }),
/* 534 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export KForOfContext */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return KForOf; });
/* unused harmony export getTypeNameForDebugging */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* tslint:disable:directive-class-suffix directive-selector */

/**
 * @hidden
 */
var KForOfContext = (function () {
    function KForOfContext($implicit, kForOf, index, count) {
        this.$implicit = $implicit;
        this.kForOf = kForOf;
        this.index = index;
        this.count = count;
    }
    Object.defineProperty(KForOfContext.prototype, "first", {
        get: function () { return this.index === 0; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(KForOfContext.prototype, "last", {
        get: function () { return this.index === this.count - 1; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(KForOfContext.prototype, "even", {
        get: function () { return this.index % 2 === 0; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(KForOfContext.prototype, "odd", {
        get: function () { return !this.even; },
        enumerable: true,
        configurable: true
    });
    return KForOfContext;
}());

/**
 * @hidden
 */
var KForOf = (function () {
    function KForOf(_viewContainer, _template, _differs) {
        this._viewContainer = _viewContainer;
        this._template = _template;
        this._differs = _differs;
        this._differ = null;
    }
    Object.defineProperty(KForOf.prototype, "kForTemplate", {
        set: function (value) {
            if (value) {
                this._template = value;
            }
        },
        enumerable: true,
        configurable: true
    });
    KForOf.prototype.ngOnChanges = function (changes) {
        if ('kForOf' in changes) {
            var value = changes.kForOf.currentValue;
            if (this._differ || !value) {
                return;
            }
            try {
                this._differ = this._differs.find(value).create(this.kForTrackBy);
            }
            catch (e) {
                throw new Error("Cannot find a differ supporting object '" + value + "' of type '" + getTypeNameForDebugging(value) + "'.");
            }
        }
    };
    KForOf.prototype.ngDoCheck = function () {
        if (this._differ) {
            var changes = this._differ.diff(this.kForOf);
            if (changes) {
                this._applyChanges(changes);
            }
        }
    };
    KForOf.prototype._applyChanges = function (changes) {
        var viewContainerLength = this._viewContainer.length;
        var dataLength = this.kForOf.length;
        var tuples = {};
        changes.forEachOperation(function (record, _, currentIndex) {
            if (currentIndex !== null) {
                tuples[currentIndex] = record.item;
            }
        });
        for (var i = viewContainerLength; i < dataLength; i++) {
            this._viewContainer.createEmbeddedView(this._template, new KForOfContext(null, this.kForOf, -1, -1), i);
        }
        for (var i = this._viewContainer.length; i > dataLength; i--) {
            this._viewContainer.remove(i);
        }
        for (var i = 0; i < this._viewContainer.length; i++) {
            var view = this._viewContainer.get(i);
            view.context.index = i;
            view.context.count = length;
            view.context.$implicit = tuples[i] || null;
        }
    };
    return KForOf;
}());

KForOf.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{ selector: '[kFor][kForOf]' },] },
];
/** @nocollapse */
KForOf.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewContainerRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["TemplateRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["IterableDiffers"], },
]; };
KForOf.propDecorators = {
    'kForOf': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'kForTrackBy': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'kForTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};
/**
 * @hidden
 */
function getTypeNameForDebugging(type) {
    return type.name || typeof type;
}


/***/ }),
/* 535 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HeaderComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_bus_view_service__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(14);






/**
 * @hidden
 */
var HeaderComponent = (function () {
    function HeaderComponent(bus, localization) {
        this.bus = bus;
        this.localization = localization;
        this.navigate = true;
        this.todayIsInRange = true;
        this.min = new Date(__WEBPACK_IMPORTED_MODULE_4__defaults__["d" /* MIN_DATE */]);
        this.max = new Date(__WEBPACK_IMPORTED_MODULE_4__defaults__["e" /* MAX_DATE */]);
        this.today = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    Object.defineProperty(HeaderComponent.prototype, "getComponentClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    HeaderComponent.prototype.ngOnChanges = function (_) {
        var service = this.bus.service(this.activeView);
        if (!service) {
            return;
        }
        this.todayIsInRange = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["i" /* isInRange */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["r" /* getToday */])(), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(this.min), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__progress_kendo_date_math__["d" /* getDate */])(this.max));
        this.todayMessage = this.localization.get('today');
        this.navigate = this.bus.canMoveUp(this.activeView);
        this.title = this.currentDate ? service.title(this.currentDate) : '';
    };
    HeaderComponent.prototype.handleTodayClick = function () {
        if (!this.todayIsInRange) {
            return;
        }
        this.bus.moveToBottom(this.activeView);
        this.today.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["l" /* dateInRange */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["r" /* getToday */])(), this.min, this.max));
    };
    HeaderComponent.prototype.handleNavigation = function () {
        if (!this.navigate) {
            return;
        }
        this.bus.moveUp(this.activeView);
    };
    return HeaderComponent;
}());

HeaderComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: 'kendo-calendar-header',
                template: "\n    <span class=\"k-button k-bare k-title\" [class.k-state-disabled]=\"!navigate\" (click)=\"handleNavigation()\">\n        {{title}}\n    </span>\n    <span class=\"k-today\" [class.k-state-disabled]=\"!todayIsInRange\" (click)=\"handleTodayClick()\">\n        {{todayMessage}}\n    </span>\n  "
            },] },
];
/** @nocollapse */
HeaderComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__services_bus_view_service__["a" /* BusViewService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
HeaderComponent.propDecorators = {
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'currentDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'today': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'getComponentClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-calendar-header",] },],
};


/***/ }),
/* 536 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(255);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoCalendarLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 537 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollSyncService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_observable_merge__ = __webpack_require__(104);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_add_observable_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_add_observable_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_bufferCount__ = __webpack_require__(242);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_bufferCount___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_bufferCount__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dom_service__ = __webpack_require__(86);






//const isUserScrolling = (xs: ScrollEvent[]): boolean => xs[0].target === xs[1].target;
var divideByMagnitude = function (magnitude) { return function (x) { return Math.floor(x / magnitude); }; };
var powerByMagnitude = function (magnitude) { return function (x) { return x * magnitude; }; };
/**
 * @hidden
 */
var ScrollSyncService = (function () {
    function ScrollSyncService(dom, zone) {
        this.dom = dom;
        this.zone = zone;
    }
    ScrollSyncService.prototype.configure = function (activeView) {
        var magnitude = Math.max(this.dom.viewHeight(activeView) / this.dom.navigationItemHeight, 1);
        this.divideByMagnitude = divideByMagnitude(magnitude);
        this.powerByMagnitude = powerByMagnitude(magnitude);
    };
    ScrollSyncService.prototype.sync = function (navigator, view) {
        var _this = this;
        this.unsubscribe();
        if (!navigator || !view) {
            return;
        }
        this.navigator = navigator;
        this.view = view;
        this.zone.runOutsideAngular(function () {
            var navScrolled, monthScrolled;
            _this.navSubscription = navigator.scroll$()
                .subscribe(function (e) {
                if (monthScrolled) {
                    monthScrolled = false;
                    return;
                }
                navScrolled = true;
                _this.scrollSiblingOf(e.target);
            });
            _this.viewSubscription = view.scroll$()
                .subscribe(function (e) {
                if (navScrolled) {
                    navScrolled = false;
                    return;
                }
                monthScrolled = true;
                _this.scrollSiblingOf(e.target);
            });
            /*this.subscription = Observable
                .merge(navigator.scroll$(), view.scroll$())
                .bufferCount(2)
                .filter(xs => isUserScrolling(xs))
                .map(xs => ({ target: xs[0].target }))
                .subscribe(({ target }) => this.scrollSiblingOf(target));*/
        });
    };
    ScrollSyncService.prototype.scrollSiblingOf = function (scrolledElement) {
        var component = this.siblingComponent(scrolledElement);
        var scrollTop = this.calculateScroll(component, scrolledElement.scrollTop);
        component.scrollTo(scrollTop);
    };
    ScrollSyncService.prototype.siblingComponent = function (scrollableElement) {
        return this.navigator.container.nativeElement === scrollableElement ? this.view : this.navigator;
    };
    ScrollSyncService.prototype.calculateScroll = function (component, scrollTop) {
        var modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;
        return modifier(scrollTop);
    };
    ScrollSyncService.prototype.destroy = function () {
        this.unsubscribe();
    };
    ScrollSyncService.prototype.unsubscribe = function () {
        if (this.navSubscription) {
            this.navSubscription.unsubscribe();
        }
        if (this.viewSubscription) {
            this.viewSubscription.unsubscribe();
        }
    };
    return ScrollSyncService;
}());

ScrollSyncService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ScrollSyncService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_5__dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 538 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ViewComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_view_enum__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_bus_view_service__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(14);
/* tslint:disable:component-selector-name  component-selector */






/**
 * @hidden
 */
var ViewComponent = (function () {
    function ViewComponent(bus, intl) {
        this.bus = bus;
        this.intl = intl;
        this.isActive = true;
        this.change = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.colSpan = 0;
        this.today = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["r" /* getToday */])();
    }
    Object.defineProperty(ViewComponent.prototype, "weekNumber", {
        get: function () {
            return this.showWeekNumbers && this.activeView === __WEBPACK_IMPORTED_MODULE_1__models_view_enum__["a" /* CalendarViewEnum */].month;
        },
        set: function (showWeekNumbers) {
            this.showWeekNumbers = showWeekNumbers;
        },
        enumerable: true,
        configurable: true
    });
    ViewComponent.prototype.ngOnChanges = function (_) {
        this.service = this.bus.service(this.activeView);
        if (!this.service) {
            return;
        }
        this.colSpan = this.service.rowLength(this.weekNumber);
        this.title = this.service.title(this.viewDate);
        var time = this.selectedDate || this.today;
        var viewDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["q" /* setTime */])(this.viewDate, time);
        this.data = this.service.data({
            cellUID: this.cellUID,
            focusedDate: this.focusedDate,
            isActiveView: !this.bus.canMoveDown(this.activeView),
            max: this.max,
            min: this.min,
            selectedDate: this.selectedDate,
            viewDate: viewDate
        });
    };
    ViewComponent.prototype.handleClick = function (ctx) {
        this.change.emit(ctx.value);
    };
    ViewComponent.prototype.firstDate = function (rowCtx) {
        var ctx = this.firstWeekDateContext(rowCtx);
        return ctx ? ctx.value : null;
    };
    ViewComponent.prototype.getWeekNumber = function (date) {
        if (!this.weekNumber) {
            return null;
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["x" /* weekInYear */])(date, this.intl.firstDay());
    };
    ViewComponent.prototype.getWeekNumberContext = function (rowCtx) {
        var ctx = this.firstWeekDateContext(rowCtx);
        if (!this.weekNumber || !ctx) {
            return null;
        }
        var weekNumber = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["x" /* weekInYear */])(ctx.value, this.intl.firstDay()).toString();
        return {
            formattedValue: weekNumber,
            id: null,
            isFocused: false,
            isSelected: false,
            isWeekend: false,
            title: weekNumber,
            value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["a" /* cloneDate */])(ctx.value)
        };
    };
    ViewComponent.prototype.getStyles = function (context) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["s" /* stringifyClassObject */])({
            'k-state-focused': this.isActive && context.isFocused,
            'k-state-selected': context.isSelected,
            'k-today': __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__progress_kendo_date_math__["b" /* isEqual */])(context.value, this.today),
            'k-weekend': context.isWeekend
        });
    };
    ViewComponent.prototype.firstWeekDateContext = function (rowCtx) {
        if (!this.weekNumber) {
            return null;
        }
        var idx = 0;
        var ctx = rowCtx[idx];
        while (!ctx && idx < rowCtx.length) {
            ctx = rowCtx[++idx];
        }
        return ctx;
    };
    return ViewComponent;
}());

ViewComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: '[kendoCalendarView]',
                template: "\n    <ng-template #emptyCell><td>&nbsp;</td></ng-template>\n    <tr role=\"row\"><th scope=\"col\" [colSpan]=\"colSpan\">{{title}}</th></tr>\n    <tr *kFor=\"let row of data\" role=\"row\">\n        <ng-template [ngIf]=\"weekNumber\">\n            <td class=\"k-alt\" *ngIf=\"firstDate(row); else emptyCell\">\n                <ng-template [ngIf]=\"!weekNumberTemplateRef\">\n                    {{getWeekNumber(firstDate(row))}}\n                </ng-template>\n                <ng-template\n                    [ngIf]=\"weekNumberTemplateRef\"\n                    [ngTemplateOutlet]=\"weekNumberTemplateRef\"\n                    [ngTemplateOutletContext]=\"{\n                        $implicit: firstDate(row),\n                        cellContext: getWeekNumberContext(row)\n                    }\"\n                ></ng-template>\n            </td>\n        </ng-template>\n        <ng-template kFor [kForOf]=\"row\" let-cell>\n            <td *ngIf=\"cell; else emptyCell\"\n                role=\"gridcell\" [attr.id]=\"cell.id\" [attr.aria-selected]=\"cell.isSelected\"\n                [ngClass]=\"getStyles(cell)\" [title]=\"cell.title\" (click)=\"handleClick(cell)\"\n            >\n                <span class=\"k-link\">\n                    <ng-template [ngIf]=\"!templateRef\">{{cell.formattedValue}}</ng-template>\n                    <ng-template\n                        [ngIf]=\"templateRef\"\n                        [ngTemplateOutlet]=\"templateRef\"\n                        [ngTemplateOutletContext]=\"{ $implicit: cell.value, cellContext: cell }\"\n                    ></ng-template>\n                </span>\n            </td>\n        </ng-template>\n    </tr>\n  "
            },] },
];
/** @nocollapse */
ViewComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__services_bus_view_service__["a" /* BusViewService */], },
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };
ViewComponent.propDecorators = {
    'isActive': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'cellUID': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'focusedDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selectedDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'viewDate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'weekNumber': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'viewIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'templateRef': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'weekNumberTemplateRef': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'change': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
};


/***/ }),
/* 539 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Arrow; });
/**
 * @hidden
 */
var Arrow;
(function (Arrow) {
    Arrow[Arrow["Up"] = 0] = "Up";
    Arrow[Arrow["Down"] = 1] = "Down";
    Arrow[Arrow["None"] = 2] = "None";
})(Arrow || (Arrow = {}));


/***/ }),
/* 540 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Keys; });
/**
 * @hidden
 */
var Keys;
(function (Keys) {
    Keys[Keys["backspace"] = 8] = "backspace";
    Keys[Keys["tab"] = 9] = "tab";
    Keys[Keys["enter"] = 13] = "enter";
    Keys[Keys["shift"] = 16] = "shift";
    Keys[Keys["ctrl"] = 17] = "ctrl";
    Keys[Keys["alt"] = 18] = "alt";
    Keys[Keys["space"] = 32] = "space";
    Keys[Keys["page up"] = 33] = "page up";
    Keys[Keys["page down"] = 34] = "page down";
    Keys[Keys["end"] = 35] = "end";
    Keys[Keys["home"] = 36] = "home";
    Keys[Keys["left"] = 37] = "left";
    Keys[Keys["up"] = 38] = "up";
    Keys[Keys["right"] = 39] = "right";
    Keys[Keys["down"] = 40] = "down";
    Keys[Keys["delete"] = 46] = "delete";
})(Keys || (Keys = {}));


/***/ }),
/* 541 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(266);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoDateInputLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 542 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateInputsModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__calendar_calendar_module__ = __webpack_require__(153);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dateinput_dateinput_module__ = __webpack_require__(113);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__datepicker_datepicker_module__ = __webpack_require__(268);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__timepicker_timepicker_module__ = __webpack_require__(277);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_intl__ = __webpack_require__(12);






var COMPONENT_MODULES = [
    __WEBPACK_IMPORTED_MODULE_1__calendar_calendar_module__["a" /* CalendarModule */],
    __WEBPACK_IMPORTED_MODULE_2__dateinput_dateinput_module__["a" /* DateInputModule */],
    __WEBPACK_IMPORTED_MODULE_3__datepicker_datepicker_module__["a" /* DatePickerModule */],
    __WEBPACK_IMPORTED_MODULE_4__timepicker_timepicker_module__["a" /* TimePickerModule */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the DateInputs components.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the DateInputs module
 * import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, DateInputsModule], // import DateInputs module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var DateInputsModule = (function () {
    function DateInputsModule() {
    }
    return DateInputsModule;
}());

DateInputsModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                exports: COMPONENT_MODULES,
                imports: COMPONENT_MODULES,
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_5__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
DateInputsModule.ctorParameters = function () { return []; };


/***/ }),
/* 543 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(270);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoDatePickerLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 544 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(114);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoTimePickerLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 545 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimePickerCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(114);




/**
 * Custom component messages override default component messages.
 */
var TimePickerCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TimePickerCustomMessagesComponent, _super);
    function TimePickerCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(TimePickerCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return TimePickerCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

TimePickerCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return TimePickerCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-timepicker-messages',
                template: ""
            },] },
];
/** @nocollapse */
TimePickerCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 546 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeSelectorCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(114);




/**
 * @hidden
 *
 * Custom component messages override default component messages.
 */
var TimeSelectorCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TimeSelectorCustomMessagesComponent, _super);
    function TimeSelectorCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(TimeSelectorCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return TimeSelectorCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

TimeSelectorCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return TimeSelectorCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-timeselector-messages',
                template: ""
            },] },
];
/** @nocollapse */
TimeSelectorCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 547 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeSelectorLocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(114);




/**
 * @hidden
 */
var TimeSelectorLocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](TimeSelectorLocalizedMessagesDirective, _super);
    function TimeSelectorLocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return TimeSelectorLocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

TimeSelectorLocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return TimeSelectorLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoTimeSelectorLocalizedMessages]'
            },] },
];
/** @nocollapse */
TimeSelectorLocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 548 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeSelectorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__defaults__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__timelist_component__ = __webpack_require__(275);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__services_dom_service__ = __webpack_require__(163);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__models_time_part_default__ = __webpack_require__(162);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util__ = __webpack_require__(549);










var INTL_DATE_FORMAT = 'https://github.com/telerik/kendo-intl/blob/master/docs/date-formatting/index.md';
var formatRegExp = new RegExp(__WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].hour + "|" + __WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].minute + "|" + __WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].second + "|" + __WEBPACK_IMPORTED_MODULE_7__models_time_part_default__["a" /* TIME_PART */].dayperiod + "|literal");
var listReducer = function (state, list, idx, all) {
    if (state.length || !list.isActive) {
        return state;
    }
    return [{
            next: all[idx + 1] || list,
            prev: all[idx - 1] || list
        }];
};
var Direction;
(function (Direction) {
    Direction[Direction["Left"] = 0] = "Left";
    Direction[Direction["Right"] = 1] = "Right";
})(Direction || (Direction = {}));
/**
 * @hidden
 *
 * Represents the Kendo UI TimeSelector component for Angular.
 */
var TimeSelectorComponent = (function () {
    function TimeSelectorComponent(localization, cdr, element, intl, dom, zone) {
        this.localization = localization;
        this.cdr = cdr;
        this.element = element;
        this.intl = intl;
        this.dom = dom;
        this.zone = zone;
        /**
         * Specifies the time format used to display the time list columns.
         */
        this.format = 't';
        /**
         * Specifies the smallest valid time value.
         */
        this.min = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_4__defaults__["b" /* MIN_TIME */]);
        /**
         * Specifies the biggest valid time value.
         */
        this.max = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(__WEBPACK_IMPORTED_MODULE_4__defaults__["c" /* MAX_TIME */]);
        /**
         * Determines whether to display the **Cancel** button in the popup.
         */
        this.cancelButton = true;
        /**
         * Determines whether to display the **Now** button in the popup.
         *
         * > If the current time is out of range or the incremental step is greater than `1`, the **Now** button will be hidden.
         */
        this.nowButton = true;
        /**
         * Specifies the value of the TimeSelector component.
         */
        this.value = null;
        /**
         * Fires each time the user selects a new value.
         */
        this.valueChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //TODO: test
        /**
         * Fires each time the user cancels the selected value.
         */
        this.valueReject = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //TODO: test
        /**
         * Fires each time the user focuses the input element.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timeselector (focus)="handleFocus()"></kendo-timeselector>
         * `
         * })
         * class AppComponent {
         *   public handleFocus(): void {
         *      console.log("Component is focused");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onFocus` property.
         */
        this.onFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        /**
         * Fires each time the input element gets blurred.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timeselector (blur)="handleBlur()"></kendo-timeselector>
         * `
         * })
         * class AppComponent {
         *   public handleBlur(): void {
         *      console.log("Component is blurred");
         *   }
         * }
         * ```
         *
         * > To wire the event programmatically, use the `onBlur` property.
         */
        this.onBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"](); //tslint:disable-line:no-output-rename
        this.activeListIndex = -1;
        this.isActive = false;
        this.showNowButton = true;
        this.resolvedPromise = Promise.resolve(null);
        this._steps = {};
    }
    Object.defineProperty(TimeSelectorComponent.prototype, "steps", {
        get: function () {
            return this._steps;
        },
        /**
         * Configures the incremental steps of the TimeSelector.
         *
         * The available options are:
         * - `hour: Number`&mdash;Controls the incremental step of the hour value.
         * - `minute: Number`&mdash;Controls the incremental step of the minute value.
         * - `second: Number`&mdash;Controls the incremental step of the second value.
         *
         * @example
         * ```ts
         * _@Component({
         * selector: 'my-app',
         * template: `
         *  <kendo-timeselector format="HH:mm:ss" [steps]="steps"></kendo-timeselector>
         * `
         * })
         * class AppComponent {
         *   public steps = { hour: 2, minute: 15, second: 15 };
         * }
         * ```
         *
         * > If the incremental step is greater than `1`, the **Now** button will be hidden.
         */
        set: function (steps) {
            this._steps = steps || {};
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimeSelectorComponent.prototype, "current", {
        get: function () {
            return this._current;
        },
        set: function (value) {
            this._current = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["m" /* timeInRange */])(this.snapTime(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(value || __WEBPACK_IMPORTED_MODULE_4__defaults__["a" /* MIDNIGHT_DATE */])), this.min, this.max);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(TimeSelectorComponent.prototype, "componentClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleKeydown = function (event) {
        var keyCode = event.keyCode;
        if (keyCode === 13 && !this.hasActiveButton()) {
            this.handleAccept();
        }
        else if (keyCode === 37 || keyCode === 39) {
            this.focusList(keyCode === 37 ? Direction.Left : Direction.Right);
        }
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.ngOnInit = function () {
        this.dom.calculateHeights(this.element.nativeElement);
        this.init();
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.ngOnChanges = function (_) {
        this.init();
        this.verifyFormat();
    };
    /**
     * Focuses the TimeSelector component.
     *
     * @example
     * ```ts
     * _@Component({
     * selector: 'my-app',
     * template: `
     *  <button (click)="timeselector.focus()">Focus time picker</button>
     *  <kendo-timeselector #timeselector></kendo-timeselector>
     * `
     * })
     * class AppComponent { }
     * ```
     */
    TimeSelectorComponent.prototype.focus = function () {
        var list = this.timeLists.first;
        if (!list) {
            return;
        }
        list.focus();
    };
    /**
     * Blurs the TimeSelector component.
     */
    TimeSelectorComponent.prototype.blur = function () {
        var list = this.timeLists.first;
        if (!list) {
            return;
        }
        list.blur();
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleAccept = function () {
        this.handleChange(this.mergeValue(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(this.value || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["d" /* getDate */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["n" /* getNow */])())), this.current));
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleNow = function () {
        this.current = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["n" /* getNow */])();
        this.handleChange(this.current);
        this.cdr.markForCheck();
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleReject = function () {
        this.current = this.value;
        this.valueReject.emit();
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleFocus = function () {
        var _this = this;
        if (this.isActive) {
            return;
        }
        this.isActive = true;
        this.nextTick(function () {
            if (!_this.hasActiveComponent()) {
                return;
            }
            _this.onFocus.emit();
        });
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleListFocus = function (index) {
        this.activeListIndex = index;
        this.handleFocus();
    };
    /**
     * @hidden
     */
    TimeSelectorComponent.prototype.handleBlur = function () {
        var _this = this;
        this.activeListIndex = -1;
        this.nextTick(function () {
            if (_this.hasActiveComponent()) {
                return;
            }
            _this.isActive = false;
            _this.cdr.markForCheck();
            _this.onBlur.emit();
        });
    };
    TimeSelectorComponent.prototype.init = function (changes) {
        if (!changes || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["o" /* hasChange */])(changes, 'format')) {
            this.dateFormatParts = this.intl.splitDateFormat(this.format);
            this.mergeValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* valueMerger */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util__["b" /* generateGetters */])(this.dateFormatParts));
        }
        if (!changes || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["o" /* hasChange */])(changes, 'steps')) {
            this.snapTime = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util__["c" /* snapTime */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util__["d" /* generateSnappers */])(this.steps));
        }
        if (!changes || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["o" /* hasChange */])(changes, 'value')) {
            this.current = this.value;
        }
        this.showNowButton = !this.hasSteps() && this.nowButton && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["p" /* isInTimeRange */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__util__["n" /* getNow */])(), this.min, this.max);
    };
    TimeSelectorComponent.prototype.focusList = function (dir) {
        if (!this.timeLists.length) {
            return;
        }
        this.timeLists.reduce(listReducer, [])
            .map(function (state) { return dir === Direction.Right ? state.next : state.prev; })
            .map(function (list) { return list && list.focus(); });
    };
    TimeSelectorComponent.prototype.handleChange = function (value) {
        this.value = value;
        this.valueChange.emit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__progress_kendo_date_math__["a" /* cloneDate */])(value));
    };
    TimeSelectorComponent.prototype.hasActiveComponent = function () {
        return this.hasActiveTimeList() || this.hasActiveButton();
    };
    TimeSelectorComponent.prototype.hasActiveTimeList = function () {
        return this.timeLists.length && this.timeLists.reduce(function (isActive, list) { return isActive || list.isActive; }, false);
    };
    TimeSelectorComponent.prototype.hasActiveButton = function () {
        var _this = this;
        if (!this.accept) {
            return false;
        }
        return [this.accept, this.cancel, this.now].reduce(function (isActive, el) { return isActive || _this.dom.isActive(el); }, false);
    };
    TimeSelectorComponent.prototype.hasSteps = function () {
        var _this = this;
        var keys = Object.keys(this.steps);
        return keys.length !== keys.reduce(function (acc, k) { return acc + _this.steps[k]; }, 0);
    };
    TimeSelectorComponent.prototype.nextTick = function (f) {
        var _this = this;
        this.zone.runOutsideAngular(function () { return _this.resolvedPromise.then(function () { return f(); }); });
    };
    TimeSelectorComponent.prototype.verifyFormat = function () {
        this.dateFormatParts.forEach(function (part) {
            if (!formatRegExp.test(part.type)) {
                throw new Error("\n                    Provided format is not supported. Supported specifiers are T|t|H|h|m|s|a. See " + INTL_DATE_FORMAT + "\n                ");
            }
        });
    };
    return TimeSelectorComponent;
}());

TimeSelectorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                exportAs: 'kendo-timeselector',
                providers: [
                    __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__["a" /* LocalizationService */],
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__["b" /* L10N_PREFIX */],
                        useValue: 'kendo.timeselector'
                    }
                ],
                selector: 'kendo-timeselector',
                template: "\n        <ng-container kendoTimeSelectorLocalizedMessages\n            i18n-accept=\"kendo.timeselector.accept|The Accept button text in the timeselector component\"\n            accept=\"Set\"\n\n            i18n-acceptLabel=\"kendo.timeselector.acceptLabel|The label for the Accept button in the timeselector component\"\n            acceptLabel=\"Set time\"\n\n            i18n-cancel=\"kendo.timeselector.cancel|The Cancel button text in the timeselector component\"\n            cancel=\"Cancel\"\n\n            i18n-cancelLabel=\"kendo.timeselector.cancelLabel|The label for the Cancel button in the timeselector component\"\n            cancelLabel=\"Cancel changes\"\n\n            i18n-now=\"kendo.timeselector.now|The Now button text in the timeselector component\"\n            now=\"Now\"\n\n            i18n-nowLabel=\"kendo.timeselector.nowLabel|The label for the Now button in the timeselector component\"\n            nowLabel=\"Select now\"\n        >\n        </ng-container>\n        <div class=\"k-time-header\">\n            <span class=\"k-title\">\n                {{current | kendoDate:format }}\n            </span>\n            <button\n                #now\n                *ngIf=\"showNowButton\"\n                class=\"k-button k-bare k-time-now\"\n                [attr.title]=\"localization.get('nowLabel')\"\n                [attr.aria-label]=\"localization.get('nowLabel')\"\n                (click)=\"handleNow()\"\n                (focus)=\"handleFocus()\"\n                (blur)=\"handleBlur()\"\n            >{{localization.get('now')}}</button>\n        </div>\n        <div class=\"k-time-list-container\">\n            <span class=\"k-time-highlight\"></span>\n            <ng-template ngFor [ngForOf]=\"dateFormatParts\" let-part let-idx=\"index\">\n                <div\n                    class=\"k-time-list-wrapper\"\n                    role=\"presentation\" tabindex=\"-1\"\n                    [class.k-state-focused]=\"idx === activeListIndex\"\n                    *ngIf=\"part.type !== 'literal'\"\n                >\n                    <span class=\"k-title\">{{intl.dateFieldName(part)}}</span>\n                    <kendo-timelist\n                        [min]=\"min\"\n                        [max]=\"max\"\n                        [part]=\"part\"\n                        [step]=\"steps[part.type] || 1\"\n                        [(value)]=\"current\"\n                        (focus)=\"handleListFocus(idx)\"\n                        (blur)=\"handleBlur()\"\n                    ></kendo-timelist>\n                </div>\n                <div class=\"k-time-separator\" *ngIf=\"part.type === 'literal'\">\n                    {{part.pattern}}\n                </div>\n            </ng-template>\n        </div>\n        <div class=\"k-time-footer k-action-buttons\">\n            <button\n                #cancel\n                *ngIf=\"cancelButton\"\n                class=\"k-button k-time-cancel\"\n                [attr.title]=\"localization.get('cancelLabel')\"\n                [attr.aria-label]=\"localization.get('cancelLabel')\"\n                (click)=\"handleReject()\"\n                (focus)=\"handleFocus()\"\n                (blur)=\"handleBlur()\"\n            >{{localization.get('cancel')}}</button>\n            <button\n                #accept\n                class=\"k-time-accept k-button k-primary\"\n                [attr.title]=\"localization.get('acceptLabel')\"\n                [attr.aria-label]=\"localization.get('acceptLabel')\"\n                (click)=\"handleAccept()\"\n                (focus)=\"handleFocus()\"\n                (blur)=\"handleBlur()\"\n            >{{localization.get('accept')}}</button>\n        </div>\n    "
            },] },
];
/** @nocollapse */
TimeSelectorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_intl__["b" /* IntlService */], },
    { type: __WEBPACK_IMPORTED_MODULE_6__services_dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };
TimeSelectorComponent.propDecorators = {
    'accept': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['accept',] },],
    'cancel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['cancel',] },],
    'now': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"], args: ['now',] },],
    'timeLists': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: [__WEBPACK_IMPORTED_MODULE_5__timelist_component__["a" /* TimeListComponent */],] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'cancelButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'nowButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'steps': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'valueChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'valueReject': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'onFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['focus',] },],
    'onBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"], args: ['blur',] },],
    'componentClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-timeselector',] },],
    'handleKeydown': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['keydown', ['$event'],] },],
};


/***/ }),
/* 549 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return generateGetters; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return generateSnappers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return valueMerger; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return snapTime; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_time_part_default__ = __webpack_require__(162);


var defaultGetters = [
    { type: __WEBPACK_IMPORTED_MODULE_1__models_time_part_default__["a" /* TIME_PART */].hour, getter: function (value) { return value.getHours(); } },
    { type: __WEBPACK_IMPORTED_MODULE_1__models_time_part_default__["a" /* TIME_PART */].minute, getter: function (value) { return value.getMinutes(); } },
    { type: __WEBPACK_IMPORTED_MODULE_1__models_time_part_default__["a" /* TIME_PART */].second, getter: function (value) { return value.getSeconds(); } },
    { type: __WEBPACK_IMPORTED_MODULE_1__models_time_part_default__["a" /* TIME_PART */].millisecond, getter: function (value) { return value.getMilliseconds(); } }
];
var left = function (getter) { return function (origin, _) { return getter(origin); }; };
var right = function (getter) { return function (_, candidate) { return getter(candidate); }; };
var convertToObject = function (parts) { return parts.reduce(function (obj, p) { obj[p.type] = p.type; return obj; }, {}); };
var getterByPart = function (parts) { return function (g) { return parts[g.type] ? right(g.getter) : left(g.getter); }; };
var gettersFactory = function (getters) { return function (parts) { return (getters.map(getterByPart(convertToObject(parts)))); }; };
var snapValue = function (getter, step) { return function (date) {
    var value = getter(date);
    return value - (value % step);
}; };
var snappersFactory = function (getters) { return function (steps) { return (getters.map(function (g) {
    var step = steps[g.type];
    return step ? snapValue(g.getter, step) : g.getter;
})); }; };
/**
 * @hidden
 */
var generateGetters = gettersFactory(defaultGetters);
/**
 * @hidden
 */
var generateSnappers = snappersFactory(defaultGetters);
/**
 * @hidden
 */
var valueMerger = function (getters) { return function (origin, candidate) {
    origin.setHours.apply(origin, getters.map(function (g) { return g(origin, candidate); }));
    return origin;
}; };
/**
 * @hidden
 */
var snapTime = function (snappers) { return function (candidate) {
    var date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__progress_kendo_date_math__["a" /* cloneDate */])(candidate);
    date.setHours.apply(date, snappers.map(function (s) { return s(date); }));
    return date;
}; };


/***/ }),
/* 550 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return timeRangeValidator; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(14);

/**
 * @hidden
 */
var timeRangeValidator = function (min, max) {
    return function (control) {
        if (!min || !max || !control.value) {
            return null;
        }
        var err = {
            timeRangeError: {
                maxValue: max,
                minValue: min,
                value: control.value
            }
        };
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["p" /* isInTimeRange */])(control.value, min, max) ? null : err;
    };
};


/***/ }),
/* 551 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RowHeightService; });
/**
 * @hidden
 */
var update = function (arr, idx, value) { return (arr.slice(0, idx + 1).concat((arr.slice(idx + 1).map(function (x) { return x + value; })))); };
/**
 * @hidden
 */
var RowHeightService = (function () {
    function RowHeightService(total, rowHeight, detailRowHeight) {
        if (total === void 0) { total = 0; }
        this.total = total;
        this.rowHeight = rowHeight;
        this.detailRowHeight = detailRowHeight;
        this.offsets = [];
        this.heights = [];
        var agg = 0;
        for (var idx = 0; idx < total; idx++) {
            this.offsets.push(agg);
            agg += rowHeight;
            this.heights.push(rowHeight);
        }
    }
    RowHeightService.prototype.height = function (rowIndex) {
        return this.heights[rowIndex];
    };
    RowHeightService.prototype.expandDetail = function (rowIndex) {
        if (this.height(rowIndex) === this.rowHeight) {
            this.updateRowHeight(rowIndex, this.detailRowHeight);
        }
    };
    RowHeightService.prototype.collapseDetail = function (rowIndex) {
        if (this.height(rowIndex) > this.rowHeight) {
            this.updateRowHeight(rowIndex, this.detailRowHeight * -1);
        }
    };
    RowHeightService.prototype.index = function (position) {
        if (position < 0) {
            return undefined;
        }
        var result = this.offsets.reduce(function (prev, current, idx) {
            if (prev !== undefined) {
                return prev;
            }
            else if (current === position) {
                return idx;
            }
            else if (current > position) {
                return idx - 1;
            }
            return undefined;
        }, undefined); // tslint:disable-line:align
        return result === undefined ? this.total - 1 : result;
    };
    RowHeightService.prototype.offset = function (rowIndex) {
        return this.offsets[rowIndex];
    };
    RowHeightService.prototype.totalHeight = function () {
        return this.heights.reduce(function (prev, curr) { return prev + curr; }, 0);
    };
    RowHeightService.prototype.updateRowHeight = function (rowIndex, value) {
        this.heights[rowIndex] += value;
        this.offsets = update(this.offsets, rowIndex, value);
    };
    return RowHeightService;
}());



/***/ }),
/* 552 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export ScrollAction */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PageAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollerService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_ReplaySubject__ = __webpack_require__(103);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_ReplaySubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_ReplaySubject__);


var normalize = function (x) { return Math.max(x, 0); };
/**
 * @hidden
 */
var ScrollAction = (function () {
    function ScrollAction(offset) {
        this.offset = offset;
    }
    return ScrollAction;
}());

/**
 * @hidden
 */
var PageAction = (function () {
    function PageAction(skip) {
        this.skip = skip;
    }
    return PageAction;
}());

/**
 * @hidden
 */
var ScrollerService = (function () {
    function ScrollerService(scrollObservable) {
        this.scrollObservable = scrollObservable;
        this.firstLoaded = 0;
        this.bottomOffset = 0;
        this.topOffset = 0;
    }
    ScrollerService.prototype.create = function (rowHeightService, skip, take, total, topOffset, bottomOffset) {
        var _this = this;
        if (topOffset === void 0) { topOffset = 0; }
        if (bottomOffset === void 0) { bottomOffset = 0; }
        this.rowHeightService = rowHeightService;
        this.firstLoaded = skip;
        this.lastLoaded = skip + take;
        this.take = take;
        this.total = total;
        this.lastScrollTop = 0;
        this.topOffset = topOffset;
        this.bottomOffset = bottomOffset;
        var subject = new __WEBPACK_IMPORTED_MODULE_1_rxjs_ReplaySubject__["ReplaySubject"](2);
        var offsetBufferRows = this.rowsForHeight(topOffset);
        var skipWithOffset = normalize(skip - offsetBufferRows);
        subject.next(new ScrollAction(this.rowOffset(skipWithOffset)));
        if (offsetBufferRows) {
            subject.next(new PageAction(skipWithOffset));
        }
        __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"].create(function (observer) {
            _this.unsubscribe();
            _this.scrollSubscription = _this.scrollObservable.subscribe(function (x) { return _this.onScroll(x, observer); });
        }).subscribe(function (x) { return subject.next(x); });
        return subject;
    };
    ScrollerService.prototype.destroy = function () {
        this.unsubscribe();
    };
    ScrollerService.prototype.onScroll = function (_a, observer) {
        var scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight;
        if (this.lastScrollTop === scrollTop) {
            return;
        }
        var up = this.lastScrollTop >= scrollTop;
        this.lastScrollTop = scrollTop;
        var firstItemIndex = this.rowHeightService.index(normalize(scrollTop - this.topOffset));
        var lastItemIndex = this.rowHeightService.index(normalize(scrollTop + offsetHeight - this.bottomOffset));
        if (!up && lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {
            this.firstLoaded = firstItemIndex;
            observer.next(new ScrollAction(this.rowOffset(firstItemIndex)));
            this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);
            observer.next(new PageAction(this.firstLoaded));
        }
        if (up && firstItemIndex <= this.firstLoaded) {
            var nonVisibleBuffer = Math.floor(this.take * 0.3);
            this.firstLoaded = normalize(firstItemIndex - nonVisibleBuffer);
            observer.next(new ScrollAction(this.rowOffset(this.firstLoaded)));
            this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);
            observer.next(new PageAction(this.firstLoaded));
        }
    };
    ScrollerService.prototype.rowOffset = function (index) {
        return this.rowHeightService.offset(index) + this.topOffset;
    };
    ScrollerService.prototype.rowsForHeight = function (height) {
        return Math.ceil(height / this.rowHeightService.height(0));
    };
    ScrollerService.prototype.unsubscribe = function () {
        if (this.scrollSubscription) {
            this.scrollSubscription.unsubscribe();
            this.scrollSubscription = undefined;
        }
    };
    return ScrollerService;
}());



/***/ }),
/* 553 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RemoveTagEvent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__preventable_event__ = __webpack_require__(60);


/**
 * Fires when a tag is about to the removed. If you cancel the event, the removal is prevented.
 *
 * Arguments for the `remove` event:
 */
var RemoveTagEvent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](RemoveTagEvent, _super);
    /**
     * Constructs the event arguments for the `remove` event.
     * @param dataItem - The dataItem(s) that will be removed.
     */
    function RemoveTagEvent(dataItem) {
        var _this = _super.call(this) || this;
        _this.dataItem = dataItem;
        return _this;
    }
    return RemoveTagEvent;
}(__WEBPACK_IMPORTED_MODULE_1__preventable_event__["a" /* PreventableEvent */]));



/***/ }),
/* 554 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export DropDownsModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autocomplete_module__ = __webpack_require__(280);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__combobox_module__ = __webpack_require__(282);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__dropdownlist_module__ = __webpack_require__(284);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__multiselect_module__ = __webpack_require__(287);





/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the DropDowns components.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the DropDowns module
 * import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, DropDownsModule], // import DropDowns module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var DropDownsModule = (function () {
    function DropDownsModule() {
    }
    return DropDownsModule;
}());

DropDownsModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                exports: [__WEBPACK_IMPORTED_MODULE_1__autocomplete_module__["a" /* AutoCompleteModule */], __WEBPACK_IMPORTED_MODULE_2__combobox_module__["a" /* ComboBoxModule */], __WEBPACK_IMPORTED_MODULE_3__dropdownlist_module__["a" /* DropDownListModule */], __WEBPACK_IMPORTED_MODULE_4__multiselect_module__["a" /* MultiSelectModule */]]
            },] },
];
/** @nocollapse */
DropDownsModule.ctorParameters = function () { return []; };


/***/ }),
/* 555 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MultiselectMessages; });
/**
 * @hidden
 */
/* tslint:disable:max-line-length */
/* tslint:disable:variable-name */
var MultiselectMessages = {
    'array': 'Expected initial values of array type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#value-selection',
    'object': 'Expected initial values of Object type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#value-selection',
    'primitive': 'Expected initial values of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#value-selection'
};


/***/ }),
/* 556 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__autocomplete_component__ = __webpack_require__(279);
/* unused harmony reexport AutoCompleteComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combobox_component__ = __webpack_require__(281);
/* unused harmony reexport ComboBoxComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dropdownlist_component__ = __webpack_require__(283);
/* unused harmony reexport DropDownListComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__multiselect_component__ = __webpack_require__(166);
/* unused harmony reexport MultiSelectComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__taglist_component__ = __webpack_require__(290);
/* unused harmony reexport TagListComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__templates_item_template_directive__ = __webpack_require__(65);
/* unused harmony reexport ItemTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__templates_header_template_directive__ = __webpack_require__(64);
/* unused harmony reexport HeaderTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__templates_footer_template_directive__ = __webpack_require__(63);
/* unused harmony reexport FooterTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__templates_value_template_directive__ = __webpack_require__(167);
/* unused harmony reexport ValueTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__templates_template_context_directive__ = __webpack_require__(293);
/* unused harmony reexport TemplateContextDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__selectable_directive__ = __webpack_require__(288);
/* unused harmony reexport SelectableDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__summary_tag_directive__ = __webpack_require__(289);
/* unused harmony reexport SummaryTagDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__dropdowns_module__ = __webpack_require__(554);
/* unused harmony reexport DropDownsModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__multiselect_module__ = __webpack_require__(287);
/* unused harmony reexport MultiSelectModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__shared_module__ = __webpack_require__(88);
/* unused harmony reexport SharedModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__autocomplete_module__ = __webpack_require__(280);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_15__autocomplete_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__combobox_module__ = __webpack_require__(282);
/* unused harmony reexport ComboBoxModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__dropdownlist_module__ = __webpack_require__(284);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_17__dropdownlist_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__shared_directives_module__ = __webpack_require__(62);
/* unused harmony reexport SharedDirectivesModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__list_component__ = __webpack_require__(286);
/* unused harmony reexport ListComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__progress_kendo_angular_popup__ = __webpack_require__(28);
/* unused harmony reexport PopupComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__progress_kendo_angular_resize_sensor__ = __webpack_require__(72);
/* unused harmony reexport ResizeSensorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__common_preventable_event__ = __webpack_require__(60);
/* unused harmony reexport PreventableEvent */

























/***/ }),
/* 557 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExcelExportModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__excel_export_component__ = __webpack_require__(296);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_column_component__ = __webpack_require__(295);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_column_group_component__ = __webpack_require__(294);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_footer_template_directive__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__columns_group_footer_template_directive__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__columns_group_header_template_directive__ = __webpack_require__(170);







var declarations = [
    __WEBPACK_IMPORTED_MODULE_1__excel_export_component__["a" /* ExcelExportComponent */],
    __WEBPACK_IMPORTED_MODULE_2__columns_column_component__["a" /* ColumnComponent */],
    __WEBPACK_IMPORTED_MODULE_3__columns_column_group_component__["a" /* ColumnGroupComponent */],
    __WEBPACK_IMPORTED_MODULE_4__columns_footer_template_directive__["a" /* FooterTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_5__columns_group_footer_template_directive__["a" /* GroupFooterTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_6__columns_group_header_template_directive__["a" /* GroupHeaderTemplateDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the ExcelExport component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the ExcelExportModule module
 * import { ExcelExportModule } from '@progress/kendo-angular-excel-export';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, ExcelExportModule], // import ExcelExportModule module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var ExcelExportModule = (function () {
    function ExcelExportModule() {
    }
    return ExcelExportModule;
}());

ExcelExportModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [declarations],
                exports: [declarations]
            },] },
];
/** @nocollapse */
ExcelExportModule.ctorParameters = function () { return []; };


/***/ }),
/* 558 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return toExporterColumns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return destroyColumns; });
/* unused harmony export ExporterColumn */
/* tslint:disable align */
/* tslint:disable:no-use-before-declare */
var compileTemplate = function (templateRef, context, updateContext) {
    var embeddedView = templateRef.createEmbeddedView(context);
    var result = function (data) {
        updateContext(context, data);
        embeddedView.detectChanges();
        return embeddedView.rootNodes.reduce(function (content, rootNode) {
            return content + rootNode.textContent;
        }, '').trim();
    };
    result.destroy = function () {
        embeddedView.destroy();
        embeddedView = null;
    };
    return result;
};
var updateGroupHeaderContext = function (context, data) {
    context.$implicit = context.group = data;
    context.field = data.field;
    context.value = data.value;
    context.aggregates = data.aggregates;
};
var updateGroupFooterContext = function (context, data) {
    context.group = data.group;
    context.$implicit = context.aggregates = data;
};
var updateFooterContext = function (_context, _data) { }; /* tslint:disable-line no-empty */
/**
 * @hidden
 */
/* tslint:disable-line no-empty */ var toExporterColumns = function (sourceColumns) {
    var exporterColumns = [];
    var columnIndex = 0;
    var addColumns = function (columns, result, level) {
        columns.forEach(function (column) {
            if (column.level === level) {
                var exporterColumn = new ExporterColumn(column, columnIndex);
                result.push(exporterColumn);
                if (column.children && column.children.length > 1) {
                    var children = exporterColumn.columns = [];
                    addColumns(column.children, children, level + 1);
                }
                else {
                    columnIndex++;
                }
            }
        });
    };
    addColumns(sourceColumns, exporterColumns, 0);
    return exporterColumns;
};
/**
 * @hidden
 */
var destroyColumns = function (columns) {
    if (columns) {
        columns.forEach(function (column) {
            column.destroy();
        });
    }
};
/**
 * @hidden
 */
var ExporterColumn = (function () {
    function ExporterColumn(column, columnIndex) {
        this.title = column.title;
        this.field = column.field;
        this.hidden = column.hidden;
        this.locked = column.locked;
        this.width = column.width;
        this.headerCellOptions = column.headerCellOptions;
        this.cellOptions = column.cellOptions;
        this.groupHeaderCellOptions = column.groupHeaderCellOptions;
        this.groupFooterCellOptions = column.groupFooterCellOptions;
        this.footerCellOptions = column.footerCellOptions;
        if (column.footerTemplate) {
            this.footerTemplate = compileTemplate(column.footerTemplate.templateRef, {
                $implicit: column,
                column: column,
                columnIndex: columnIndex
            }, updateFooterContext);
        }
        if (column.groupFooterTemplate) {
            this.groupFooterTemplate = compileTemplate(column.groupFooterTemplate.templateRef, {
                column: column,
                field: column.field
            }, updateGroupFooterContext);
        }
        if (column.groupHeaderTemplate) {
            this.groupHeaderTemplate = compileTemplate(column.groupHeaderTemplate.templateRef, {}, updateGroupHeaderContext);
        }
    }
    ExporterColumn.prototype.destroy = function () {
        if (this.footerTemplate) {
            this.footerTemplate.destroy();
        }
        if (this.groupFooterTemplate) {
            this.groupFooterTemplate.destroy();
        }
        if (this.groupHeaderTemplate) {
            this.groupHeaderTemplate.destroy();
        }
        destroyColumns(this.columns);
    };
    return ExporterColumn;
}());



/***/ }),
/* 559 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColumnHandleDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_delay__ = __webpack_require__(146);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_delay___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_delay__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_do__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_do__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_switchMap__ = __webpack_require__(106);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_switchMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_switchMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_takeUntil__ = __webpack_require__(107);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_takeUntil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_operator_takeUntil__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_take__ = __webpack_require__(81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_take___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rxjs_add_operator_take__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__columns_column_common__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__common_draggable_directive__ = __webpack_require__(119);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__column_resizing_service__ = __webpack_require__(171);














/**
 * @hidden
 */
var fromPercentage = function (value, percent) {
    var sign = percent < 0 ? -1 : 1;
    return Math.ceil((Math.abs(percent) / 100) * value) * sign;
};
/**
 * @hidden
 */
var toPercentage = function (value, whole) { return (value / whole) * 100; };
/**
 * @hidden
 */
var headerWidth = function (handle) { return handle.nativeElement.parentElement.offsetWidth; };
/**
 * @hidden
 */
var allLeafColumns = function (columns) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__columns_column_common__["a" /* expandColumns */])(columns)
    .filter(function (c) { return !c.isColumnGroup; }); };
/**
 * @hidden
 */
var stopPropagation = function (_a) {
    var event = _a.originalEvent;
    event.stopPropagation();
    event.preventDefault();
};
/**
 * @hidden
 */
var createMoveStream = function (service, draggable) { return function (mouseDown) {
    return draggable.kendo.drag
        .takeUntil(draggable.kendo.release
        .do(function (_) { return service.end(); }))
        .map(function (_a) {
        var pageX = _a.pageX;
        return ({
            originalX: mouseDown.pageX,
            pageX: pageX
        });
    });
}; };
/**
 * @hidden
 */
var preventOnDblClick = function (release) { return function (mouseDown) {
    return __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].of(mouseDown).delay(150).takeUntil(release);
}; };
/**
 * @hidden
 */
var isInSpanColumn = function (column) { return !!(column.parent && column.parent.isSpanColumn); };
/**
 * @hidden
 *
 * Calculates the column index. If the column is stated in `SpanColumn`,
 * the index for all child columns is equal to the index of the first child.
 */
var indexOf = function (target, list) {
    var index = 0;
    var ignore = 0;
    var skip = 0;
    while (index < list.length) {
        var current = list[index];
        var isParentSpanColumn = isInSpanColumn(current);
        if (current === target) {
            break;
        }
        if ((ignore-- <= 0) && isParentSpanColumn) {
            ignore = current.parent.childColumns.length - 1;
            skip += ignore;
        }
        index++;
    }
    return index - skip;
};
/**
 * @hidden
 */
var ColumnHandleDirective = (function () {
    function ColumnHandleDirective(draggable, element, service, zone, cdr) {
        this.draggable = draggable;
        this.element = element;
        this.service = service;
        this.zone = zone;
        this.cdr = cdr;
        this.columns = [];
        this.subscriptions = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subscription__["Subscription"]();
    }
    Object.defineProperty(ColumnHandleDirective.prototype, "visible", {
        get: function () {
            return this.column.resizable ? 'block' : 'none';
        },
        enumerable: true,
        configurable: true
    });
    ColumnHandleDirective.prototype.autoFit = function () {
        var _this = this;
        var allLeafs = allLeafColumns(this.columns);
        var currentLeafs = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__columns_column_common__["d" /* leafColumns */])([this.column]).filter(function (column) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__utils__["g" /* isTruthy */])(column.resizable); });
        var columnInfo = currentLeafs.map(function (column) {
            var isParentSpan = isInSpanColumn(column);
            var isLastInSpan = isParentSpan ? column.parent.childColumns.last === column : false;
            var index = indexOf(column, allLeafs);
            return {
                column: column,
                headerIndex: _this.columnsForLevel(column.level).indexOf(column),
                index: index,
                isLastInSpan: isLastInSpan,
                isParentSpan: isParentSpan,
                level: column.level
            };
        });
        currentLeafs.forEach(function (column) { return column.width = 0; });
        this.service.measureColumns(columnInfo);
    };
    ColumnHandleDirective.prototype.ngOnInit = function () {
        var _this = this;
        var service = this.service.changes
            .filter(function () { return _this.column.resizable; })
            .filter(function (e) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__utils__["b" /* isPresent */])(e.columns.find(function (column) { return column === _this.column; })); });
        this.subscriptions.add(service.filter(function (e) { return e.type === 'start'; })
            .subscribe(this.initState.bind(this)));
        this.subscriptions.add(service.filter(function (e) { return e.type === 'resizeColumn'; })
            .subscribe(this.resize.bind(this)));
        this.subscriptions.add(this.service.changes
            .filter(function (e) { return e.type === 'start'; })
            .filter(this.shouldUpdate.bind(this))
            .take(1) //on first resize only
            .subscribe(this.initColumnWidth.bind(this)));
        this.subscriptions.add(this.zone.runOutsideAngular(function () {
            return _this.draggable.kendo.press
                .do(stopPropagation)
                .do(function (_) { return _this.service.start(_this.column); })
                .switchMap(preventOnDblClick(_this.draggable.kendo.release))
                .switchMap(createMoveStream(_this.service, _this.draggable))
                .subscribe(function (_a) {
                var pageX = _a.pageX, originalX = _a.originalX;
                var delta = pageX - originalX;
                var percent = toPercentage(delta, _this.originalWidth);
                _this.service.resizeColumns(percent);
            });
        }));
        this.subscriptions.add(service.filter(function (e) { return e.type === 'autoFitComplete'; })
            .subscribe(this.sizeToFit.bind(this)));
        this.subscriptions.add(service.filter(function (e) { return e.type === 'triggerAutoFit'; })
            .subscribe(this.autoFit.bind(this)));
    };
    ColumnHandleDirective.prototype.ngOnDestroy = function () {
        if (this.subscriptions) {
            this.subscriptions.unsubscribe();
        }
    };
    ColumnHandleDirective.prototype.shouldUpdate = function () {
        return !allLeafColumns(this.columns)
            .map(function (column) { return column.width; })
            .some(__WEBPACK_IMPORTED_MODULE_10__utils__["o" /* isBlank */]);
    };
    ColumnHandleDirective.prototype.initColumnWidth = function () {
        this.column.width = headerWidth(this.element);
    };
    ColumnHandleDirective.prototype.initState = function () {
        this.originalWidth = headerWidth(this.element);
        this.service.resizedColumn({
            column: this.column,
            oldWidth: this.originalWidth
        });
    };
    ColumnHandleDirective.prototype.resize = function (_a) {
        var deltaPercent = _a.deltaPercent;
        var delta = fromPercentage(this.originalWidth, deltaPercent);
        var newWidth = Math.max(this.originalWidth + delta, this.column.minResizableWidth);
        var tableDelta = newWidth > this.column.minResizableWidth ?
            delta : this.column.minResizableWidth - this.originalWidth;
        this.updateWidth(this.column, newWidth);
        this.service.resizeTable(tableDelta);
    };
    ColumnHandleDirective.prototype.sizeToFit = function (_a) {
        var columns = _a.columns, widths = _a.widths;
        var index = columns.indexOf(this.column);
        var width = Math.max.apply(Math, widths.map(function (w) { return w[index]; })) + 1; //add 1px for IE
        var tableDelta = width - this.originalWidth;
        this.updateWidth(this.column, width);
        this.service.resizeTable(tableDelta);
    };
    ColumnHandleDirective.prototype.updateWidth = function (column, width) {
        column.width = width;
        this.cdr.markForCheck(); //force CD cycle
    };
    ColumnHandleDirective.prototype.columnsForLevel = function (level) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__columns_column_common__["c" /* columnsToRender */])(this.columns ? this.columns.filter(function (column) { return column.level === level; }) : []);
    };
    return ColumnHandleDirective;
}());

ColumnHandleDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridColumnHandle]'
            },] },
];
/** @nocollapse */
ColumnHandleDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_12__common_draggable_directive__["a" /* DraggableDirective */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Host"] },] },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_13__column_resizing_service__["a" /* ColumnResizingService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
]; };
ColumnHandleDirective.propDecorators = {
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'visible': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.display',] },],
    'autoFit': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['dblclick',] },],
};


/***/ }),
/* 560 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TableDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_bufferCount__ = __webpack_require__(242);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_bufferCount___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_bufferCount__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_switchMap__ = __webpack_require__(106);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_switchMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_switchMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_do__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_do___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_do__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__columns_column_common__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__column_resizing_service__ = __webpack_require__(171);









/**
 * @hidden
 */
var columnsToResize = function (_a) {
    var columns = _a.columns;
    return Math.max(1, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__columns_column_common__["f" /* resizableColumns */])(columns).length - 1);
};
/**
 * @hidden
 */
var row = function (selector) { return function (element) { return element.querySelector(selector); }; };
/**
 * @hidden
 */
var headerRow = function (index) { return function (element) { return element.querySelectorAll('thead>tr')[index]; }; };
/**
 * @hidden
 */
var cell = function (index, selector) {
    if (selector === void 0) { selector = 'td'; }
    return function (element) {
        return element.querySelectorAll(selector + ":not(.k-group-cell):not(.k-hierarchy-cell)")[index];
    };
};
/**
 * @hidden
 */
var offsetWidth = function (element) { return element.offsetWidth; };
/**
 * @hidden
 */
var pipe = function () {
    var fns = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        fns[_i] = arguments[_i];
    }
    return function (data) { return fns.reduce(function (state, fn) { return state ? fn(state) : 0; }, data); };
};
/**
 * @hidden
 */
var TableDirective = (function () {
    function TableDirective(element, renderer, service, zone, cdr) {
        this.element = element;
        this.renderer = renderer;
        this.service = service;
        this.zone = zone;
        this.cdr = cdr;
        this.locked = false;
        this.firstResize = false;
    }
    Object.defineProperty(TableDirective.prototype, "minWidth", {
        get: function () {
            return this.firstResize ? 0 : null;
        },
        enumerable: true,
        configurable: true
    });
    TableDirective.prototype.ngOnInit = function () {
        var _this = this;
        var obs = this.service
            .changes
            .filter(function (e) { return _this.locked === e.locked; });
        this.subscription = obs
            .filter(function (e) { return e.type === 'start'; })
            .do(this.initState.bind(this))
            .map(columnsToResize)
            .switchMap(function (take) {
            return obs
                .filter(function (e) { return e.type === 'resizeTable'; })
                .map(function (e) { return e.delta; })
                .bufferCount(take);
        })
            .subscribe(this.resize.bind(this));
        this.autoFitSubscription = this.service
            .registerTable(this.autoFitObservable.bind(this));
    };
    TableDirective.prototype.ngOnDestroy = function () {
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
        this.autoFitSubscription();
    };
    TableDirective.prototype.initState = function () {
        this.firstResize = true;
        this.originalWidth = offsetWidth(this.element.nativeElement);
    };
    TableDirective.prototype.resize = function (deltas) {
        var delta = deltas.reduce(function (sum, item) { return sum + item; }, 0);
        this.updateWidth(this.originalWidth + delta);
    };
    TableDirective.prototype.updateWidth = function (width) {
        this.renderer.setStyle(this.element.nativeElement, 'width', width + 'px');
        this.cdr.detectChanges(); //force CD cycle
    };
    TableDirective.prototype.autoFitObservable = function (columnInfo) {
        var _this = this;
        return __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].create(function (observer) {
            _this.zone.runOutsideAngular(function () {
                _this.renderer.addClass(_this.element.nativeElement, 'k-autofitting');
                _this.cdr.detectChanges(); //force CD cycle
                var widths = columnInfo.map(_this.measureColumn.bind(_this));
                _this.renderer.removeClass(_this.element.nativeElement, 'k-autofitting');
                observer.next(widths);
            });
        });
    };
    TableDirective.prototype.measureColumn = function (info) {
        var dom = this.element.nativeElement;
        var header = pipe(headerRow(info.level), cell(info.headerIndex, 'th'), offsetWidth)(dom);
        var data = 0;
        if (!info.isParentSpan || (info.isParentSpan && info.isLastInSpan)) {
            data = pipe(row('tbody>tr:not(.k-grouping-row)'), cell(info.index), offsetWidth)(dom);
        }
        var footer = pipe(row('tfoot>tr'), cell(info.index), offsetWidth)(dom);
        return Math.max(header, data, footer);
    };
    return TableDirective;
}());

TableDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: 'table' // tslint:disable-line:directive-selector
            },] },
];
/** @nocollapse */
TableDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_8__column_resizing_service__["a" /* ColumnResizingService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectorRef"], },
]; };
TableDirective.propDecorators = {
    'locked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'minWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.min-width',] },],
};


/***/ }),
/* 561 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CheckboxColumnComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__column_base__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rendering_cell_template_directive__ = __webpack_require__(68);




/**
 * Represents the selection checkbox column of the Grid.
 *
 * If the column is defined empty, it renders a default checkbox for row selection.
 *
 * You can also define the content of the column inside an `<ng-template>` tag. The template context
 * is set to the current data item and the following additional fields are passed:
 * - `columnIndex`&mdash;The current column index.
 * - `rowIndex`&mdash;The current row index. If inside a new item row, it will be `-1`.
 * - `dataItem`&mdash;The current data item.
 * - `column`&mdash;The current column instance.
 * - `isNew`&mdash;The state of the current item.
 *
 * The template has to contain [`SelectionCheckboxDirective`]({% slug api_grid_selectioncheckboxdirective %}).
 *
 * @example
 * ```ts-preview
 *
 * _@Component({
 *    selector: 'my-app',
 *    template: `
 *        <kendo-grid [data]="gridData" [selectable]="{enabled: true, checkboxOnly: true}">
 *          <kendo-grid-column field="ProductID" title="Product ID" width="120">
 *          </kendo-grid-column>
 *          <kendo-grid-column field="ProductName" title="Product Name">
 *          </kendo-grid-column>
 *          <kendo-grid-checkbox-column title="Default checkbox">
 *          </kendo-grid-checkbox-column>
 *          <kendo-grid-checkbox-column title="Custom checkbox">
 *            <ng-template kendoGridCellTemplate let-idx="rowIndex">
 *              Select row <input [kendoGridSelectionCheckbox]="idx" />
 *            </ng-template>
 *          </kendo-grid-checkbox-column>
 *        </kendo-grid>
 *    `
 * })
 *
 * class AppComponent {
 *    public gridData: any[];
 *
 *    constructor() {
 *        this.gridData = products;
 *    }
 * }
 *
 * const products = [{
 *    "ProductID": 1,
 *    "ProductName": "Chai",
 *    "UnitPrice": 18.0000,
 *    "Discontinued": true
 *  }, {
 *    "ProductID": 2,
 *    "ProductName": "Chang",
 *    "UnitPrice": 19.0000,
 *    "Discontinued": false
 *  }
 * ];
 *
 * ```
 */
var CheckboxColumnComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](CheckboxColumnComponent, _super);
    function CheckboxColumnComponent(parent) {
        var _this = _super.call(this, parent) || this;
        _this.parent = parent;
        /*
         * @hidden
         */
        _this.isCheckboxColumn = true;
        return _this;
    }
    Object.defineProperty(CheckboxColumnComponent.prototype, "templateRef", {
        get: function () {
            return this.template ? this.template.templateRef : undefined;
        },
        enumerable: true,
        configurable: true
    });
    return CheckboxColumnComponent;
}(__WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */]));

CheckboxColumnComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return CheckboxColumnComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-grid-checkbox-column',
                template: ""
            },] },
];
/** @nocollapse */
CheckboxColumnComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__column_base__["a" /* ColumnBase */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["SkipSelf"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Host"] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Optional"] },] },
]; };
CheckboxColumnComponent.propDecorators = {
    'showSelectAll': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'template': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ContentChild"], args: [__WEBPACK_IMPORTED_MODULE_3__rendering_cell_template_directive__["a" /* CellTemplateDirective */],] },],
};


/***/ }),
/* 562 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalize; });
/**
 * @hidden
 */
var DEFAULTS = {
    allowUnsort: true,
    mode: 'single'
};
/**
 * @hidden
 */
var normalize = function () {
    var settings = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        settings[_i] = arguments[_i];
    }
    return Object.assign.apply(Object, [{}, DEFAULTS].concat(settings));
};


/***/ }),
/* 563 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ZoneAwareEventEmitter; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);


/**
 * @hidden
 */
var ZoneAwareEventEmitter = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ZoneAwareEventEmitter, _super);
    function ZoneAwareEventEmitter(ngZone, isAsync) {
        if (isAsync === void 0) { isAsync = false; }
        var _this = _super.call(this, isAsync) || this;
        _this.ngZone = ngZone;
        return _this;
    }
    ZoneAwareEventEmitter.prototype.subscribe = function (generatorOrNext, error, complete) {
        var _this = this;
        var schedulerFn;
        var errorFn = function (_) { return null; };
        var completeFn = function () { return null; };
        if (generatorOrNext && typeof generatorOrNext === 'object') {
            schedulerFn = function (value) { _this.ngZone.run(function () { return generatorOrNext.next(value); }); };
            if (generatorOrNext.error) {
                errorFn = function (err) { _this.ngZone.run(function () { return generatorOrNext.error(err); }); };
            }
            if (generatorOrNext.complete) {
                completeFn = function () { _this.ngZone.run(function () { return generatorOrNext.complete(); }); };
            }
        }
        else {
            schedulerFn = function (value) { _this.ngZone.run(function () { return generatorOrNext(value); }); };
            if (error) {
                errorFn = function (err) { _this.ngZone.run(function () { return error(err); }); };
            }
            if (complete) {
                completeFn = function () { _this.ngZone.run(function () { return complete(); }); };
            }
        }
        return _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);
    };
    return ZoneAwareEventEmitter;
}(__WEBPACK_IMPORTED_MODULE_1__angular_core__["EventEmitter"]));



/***/ }),
/* 564 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cloneFilters; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return diffFilters; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__ = __webpack_require__(75);


var areDifferent = function (a, b) {
    return a.field !== b.field || a.operator !== b.operator || a.value !== b.value;
};
var isChanged = function (a, b) {
    if (a.length !== b.length) {
        return true;
    }
    for (var idx = 0, len = a.length; idx < len; idx++) {
        var prev = a[idx];
        var curr = b[idx];
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["c" /* isCompositeFilterDescriptor */])(prev)) {
            // tslint:disable-next-line:no-use-before-declare
            if (diffFilters(prev, curr[idx])) {
                return true;
            }
        }
        else if (areDifferent(prev, curr)) {
            return true;
        }
    }
    return false;
};
var cloneFilter = function (_a) {
    var field = _a.field, ignoreCase = _a.ignoreCase, operator = _a.operator, value = _a.value;
    return ({
        field: field,
        ignoreCase: ignoreCase,
        operator: operator,
        value: value
    });
};
/**
 * @hidden
 */
var cloneFilters = function (_a) {
    var filters = _a.filters, logic = _a.logic;
    return ({
        filters: filters.map(function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["c" /* isCompositeFilterDescriptor */])(x) ? cloneFilters(x) : cloneFilter(x); }),
        logic: logic
    });
};
/**
 * @hidden
 */
var diffFilters = function (a, b) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isPresent */])(a) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isPresent */])(b)) {
        return true;
    }
    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isPresent */])(a) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isPresent */])(b)) {
        return true;
    }
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isPresent */])(a) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* isPresent */])(b) && isChanged(a.filters, b.filters);
};


/***/ }),
/* 565 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DataResultIterator; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DataCollection; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_symbol_iterator__ = __webpack_require__(112);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_symbol_iterator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_symbol_iterator__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data_iterators__ = __webpack_require__(566);
/* tslint:disable:use-life-cycle-interface */


/**
 * @hidden
 */
var DataResultIterator = (function () {
    function DataResultIterator(source, skip, groupFooters) {
        if (skip === void 0) { skip = 0; }
        if (groupFooters === void 0) { groupFooters = false; }
        this.source = source;
        this.skip = skip;
        this.groupFooters = groupFooters;
        this.source = this.source ? this.source : [];
        this.isObject = this.isGridDataResult(this.source);
    }
    DataResultIterator.prototype.isGridDataResult = function (source) {
        return source.total !== undefined && source.data !== undefined;
    };
    Object.defineProperty(DataResultIterator.prototype, "total", {
        get: function () {
            return this.isObject ? this.source.total : this.source.length;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataResultIterator.prototype, "data", {
        get: function () {
            return this.isObject ? this.source.data : this.source;
        },
        enumerable: true,
        configurable: true
    });
    DataResultIterator.prototype.map = function (fn) {
        return this.data.map(fn);
    };
    DataResultIterator.prototype.filter = function (fn) {
        return this.data.filter(fn);
    };
    DataResultIterator.prototype.reduce = function (fn, init) {
        return this.data.reduce(fn, init);
    };
    DataResultIterator.prototype.forEach = function (fn) {
        this.data.forEach(fn);
    };
    DataResultIterator.prototype.some = function (fn) {
        return this.data.some(fn);
    };
    DataResultIterator.prototype[__WEBPACK_IMPORTED_MODULE_0_rxjs_symbol_iterator__["$$iterator"]] = function () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__data_iterators__["a" /* getIterator */])(this.data, {
            dataIndex: this.skip,
            footers: this.groupFooters,
            groupIndex: this.skip
        });
    };
    DataResultIterator.prototype.toString = function () { return this.data.toString(); };
    return DataResultIterator;
}());

/**
 * @hidden
 */
var DataCollection = (function () {
    function DataCollection(accessor) {
        this.accessor = accessor;
    }
    Object.defineProperty(DataCollection.prototype, "total", {
        get: function () { return this.accessor().total; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataCollection.prototype, "length", {
        get: function () { return this.accessor().data.length; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataCollection.prototype, "first", {
        get: function () { return this.accessor().data[0]; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DataCollection.prototype, "last", {
        get: function () { return this.accessor().data[this.length - 1]; },
        enumerable: true,
        configurable: true
    });
    DataCollection.prototype.at = function (index) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__data_iterators__["b" /* itemAt */])(this.accessor().data, index);
    };
    DataCollection.prototype.map = function (fn) { return this.accessor().map(fn); };
    DataCollection.prototype.filter = function (fn) {
        return this.accessor().filter(fn);
    };
    DataCollection.prototype.reduce = function (fn, init) {
        return this.accessor().reduce(fn, init);
    };
    DataCollection.prototype.forEach = function (fn) {
        this.accessor().forEach(fn);
    };
    DataCollection.prototype.some = function (fn) {
        return this.accessor().some(fn);
    };
    DataCollection.prototype[__WEBPACK_IMPORTED_MODULE_0_rxjs_symbol_iterator__["$$iterator"]] = function () {
        return this.accessor()[__WEBPACK_IMPORTED_MODULE_0_rxjs_symbol_iterator__["$$iterator"]]();
    };
    DataCollection.prototype.toString = function () { return this.accessor().toString(); };
    return DataCollection;
}());



/***/ }),
/* 566 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return itemAt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getIterator; });
/* unused harmony export Iterator */
/* unused harmony export ItemIterator */
/* unused harmony export GroupIterator */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__ = __webpack_require__(112);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);

/* tslint:disable:use-life-cycle-interface */


var isGroupItem = function (source) {
    return source.items !== undefined &&
        source.field !== undefined;
};
var isVirtualGroupItem = function (source) {
    return source.offset !== undefined &&
        source.skipHeader !== undefined;
};
var flattenGroups = function (groups) { return (groups.reduce(function (acc, curr) {
    if (isGroupItem(curr)) {
        return acc.concat(flattenGroups(curr.items));
    }
    return acc.concat([curr]);
}, []) // tslint:disable-line:align
); };
/**
 * @hidden
 */
var itemAt = function (data, index) {
    var first = data[0];
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(first) && isGroupItem(first)) {
        return flattenGroups(data)[index];
    }
    return data[index];
};
/**
 * @hidden
 */
var getIterator = function (data, _a) {
    var footers = _a.footers, level = _a.level, dataIndex = _a.dataIndex, parentGroupIndex = _a.parentGroupIndex, groupIndex = _a.groupIndex;
    var first = data[0];
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(first) && isGroupItem(first)) {
        if (isVirtualGroupItem(first)) {
            groupIndex = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(first.offset) ? first.offset : groupIndex;
        }
        //tslint:disable-next-line:no-use-before-declare
        return new GroupIterator(data, footers, level, dataIndex, parentGroupIndex, groupIndex);
    }
    //tslint:disable-next-line:no-use-before-declare
    return new ItemIterator(data, dataIndex, parentGroupIndex);
};
var ArrayIterator = (function () {
    function ArrayIterator(arr, idx) {
        if (idx === void 0) { idx = 0; }
        this.arr = arr;
        this.idx = idx;
        this.arr = arr || [];
    }
    ArrayIterator.prototype[__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__["$$iterator"]] = function () {
        return this;
    };
    ArrayIterator.prototype.next = function () {
        return this.idx < this.arr.length ? {
            done: false,
            value: this.arr[this.idx++]
        } : { done: true, value: undefined };
    };
    return ArrayIterator;
}());
/**
 * @hidden
 */
var Iterator = (function () {
    function Iterator(arr, dataIndex, resultMap) {
        if (dataIndex === void 0) { dataIndex = 0; }
        if (resultMap === void 0) { resultMap = function (x) { return x; }; }
        this.dataIndex = dataIndex;
        this.resultMap = resultMap;
        var iterator = arr[__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__["$$iterator"]];
        this._innerIterator = iterator ? arr[__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__["$$iterator"]]() : new ArrayIterator(arr);
    }
    Iterator.prototype[__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__["$$iterator"]] = function () {
        return this;
    };
    Iterator.prototype.next = function () {
        return this.resultMap(this._innerIterator.next(), this.dataIndex++);
    };
    return Iterator;
}());

/**
 * @hidden
 */
var ItemIterator = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ItemIterator, _super);
    function ItemIterator(arr, dataIndex, groupIndex) {
        return _super.call(this, arr, dataIndex, function (x, idx) { return ({
            done: x.done,
            value: {
                data: x.value,
                groupIndex: groupIndex,
                index: idx,
                type: 'data'
            }
        }); }) || this;
    }
    Object.defineProperty(ItemIterator.prototype, "index", {
        /**
         * The index of the next record.
         * @readonly
         * @type {number}
         */
        get: function () {
            return this.dataIndex;
        },
        enumerable: true,
        configurable: true
    });
    return ItemIterator;
}(Iterator));

var prefix = function (s, n) {
    var p = s ? s + "_" : s;
    return "" + p + n;
};
/**
 * @hidden
 */
var GroupIterator = (function () {
    function GroupIterator(arr, outputFooters, level, dataIndex, parentIndex, groupIndex) {
        if (outputFooters === void 0) { outputFooters = false; }
        if (level === void 0) { level = 0; }
        if (dataIndex === void 0) { dataIndex = 0; }
        if (parentIndex === void 0) { parentIndex = ""; }
        if (groupIndex === void 0) { groupIndex = 0; }
        this.arr = arr;
        this.outputFooters = outputFooters;
        this.level = level;
        this.dataIndex = dataIndex;
        this.parentIndex = parentIndex;
        this.groupIndex = groupIndex;
        this.currentGroupIndex = "";
        this.arr = arr || [];
        this._iterator = new Iterator(this.arr, this.dataIndex);
    }
    GroupIterator.prototype[__WEBPACK_IMPORTED_MODULE_1_rxjs_symbol_iterator__["$$iterator"]] = function () {
        return this;
    };
    GroupIterator.prototype.nextGroupItem = function () {
        this.current = this._iterator.next().value;
        this._innerIterator = null;
        if (this.current) {
            this.currentGroupIndex = prefix(this.parentIndex, this.groupIndex++);
            return {
                done: false,
                value: {
                    data: this.current,
                    index: this.currentGroupIndex,
                    level: this.level,
                    type: 'group'
                }
            };
        }
        else {
            this.current = null;
            return { done: true, value: undefined };
        }
    };
    GroupIterator.prototype.footerItem = function () {
        if (this.current) {
            var group = this.current;
            this.current = null;
            return {
                done: false,
                value: {
                    data: group,
                    groupIndex: this.currentGroupIndex,
                    level: this.level,
                    type: 'footer'
                }
            };
        }
        else {
            this.current = null;
            return { done: true, value: undefined };
        }
    };
    GroupIterator.prototype.innerIterator = function (group) {
        if (!this._innerIterator) {
            this._innerIterator = getIterator(group.items, {
                dataIndex: this.dataIndex,
                footers: this.outputFooters,
                level: this.level + 1,
                parentGroupIndex: this.currentGroupIndex
            });
        }
        return this._innerIterator;
    };
    GroupIterator.prototype.nextDataItem = function (group) {
        var iterator = this.innerIterator(group);
        var result = iterator.next();
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(result.value) && !result.done && result.value.type === "data") {
            this.dataIndex = result.value.index + 1;
        }
        return !result.done ? result : undefined;
    };
    GroupIterator.prototype.next = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(this.current)) {
            return this.nextGroupItem();
        }
        var item = this.nextDataItem(this.current);
        return item ? item : (this.outputFooters ? this.footerItem() : this.nextGroupItem());
    };
    Object.defineProperty(GroupIterator.prototype, "index", {
        /**
         * The index of the last iterated data record.
         * @readonly
         * @type {number}
         */
        get: function () {
            return this.dataIndex + 1;
        },
        enumerable: true,
        configurable: true
    });
    return GroupIterator;
}());



/***/ }),
/* 567 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalRowEditService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__local_edit_service__ = __webpack_require__(305);


/**
 * @hidden
 */
var LocalRowEditService = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalRowEditService, _super);
    function LocalRowEditService() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    LocalRowEditService.prototype.update = function (_item) {
        this.dataChanged();
    };
    return LocalRowEditService;
}(__WEBPACK_IMPORTED_MODULE_1__local_edit_service__["a" /* LocalEditService */]));



/***/ }),
/* 568 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AddCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit_service__ = __webpack_require__(36);


/**
 * Represents the `add new item` command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`ToolbarTemplate`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When an associated button with the directive is clicked, the
 * [`add`]({% slug api_grid_gridcomponent %}#toc-add) event
 * is triggered. For more information, refer to the [editing example]({% slug editing_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *    <ng-template kendoGridToolbarTemplate>
 *       <button kendoGridAddCommand>Add new</button>
 *    </ng-template>
 * </kendo-grid>
 * ```
 */
var AddCommandDirective = (function () {
    function AddCommandDirective(editService) {
        this.editService = editService;
    }
    /**
     * @hidden
     */
    AddCommandDirective.prototype.click = function () {
        this.editService.beginAdd();
    };
    Object.defineProperty(AddCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AddCommandDirective.prototype, "commandClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return AddCommandDirective;
}());

AddCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridAddCommand]'
            },] },
];
/** @nocollapse */
AddCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__edit_service__["a" /* EditService */], },
]; };
AddCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'commandClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-add-command',] },],
};


/***/ }),
/* 569 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CancelCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__ = __webpack_require__(69);



/**
 * Represents the `cancel` command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When an associated button with the directive is clicked, the
 * [`cancel`]({% slug api_grid_gridcomponent %}#toc-cancel) event
 * is triggered. For more information, refer to the [editing example]({% slug editing_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-command-column title="command">
 *     <ng-template kendoGridCellTemplate>
 *       <button kendoGridCancelCommand>Cancel changes</button>
 *     </ng-template>
 *   </kendo-grid-command-column>
 * </kendo-grid>
 * ```
 * > When the row is not in the edit mode, the button with the `kendoGridCancelCommand` is automatically hidden.
 *
 * You can control the content of the button based on the state of the row.
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-command-column title="command">
 *     <ng-template kendoGridCellTemplate let-isNew="isNew">
 *       <button kendoGridCancelCommand>{{isNew ? 'Discard' : 'Cancel changes'}}</button>
 *     </ng-template>
 *   </kendo-grid-command-column>
 * </kendo-grid>
 * ```
 */
var CancelCommandDirective = (function () {
    function CancelCommandDirective(editService, cellContext) {
        this.editService = editService;
        this.rowIndex = cellContext.rowIndex;
    }
    /**
     * @hidden
     */
    CancelCommandDirective.prototype.click = function () {
        this.editService.endEdit(this.rowIndex);
    };
    Object.defineProperty(CancelCommandDirective.prototype, "visible", {
        /**
         * @hidden
         */
        get: function () {
            return !this.editService.isEdited(this.rowIndex) ? 'none' : '';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CancelCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CancelCommandDirective.prototype, "commandClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return CancelCommandDirective;
}());

CancelCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridCancelCommand]'
            },] },
];
/** @nocollapse */
CancelCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__edit_service__["a" /* EditService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__["a" /* CELL_CONTEXT */],] },] },
]; };
CancelCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'visible': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.display',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'commandClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-cancel-command',] },],
};


/***/ }),
/* 570 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CellCloseEvent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_preventable_event__ = __webpack_require__(120);


var CellCloseEvent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](CellCloseEvent, _super);
    function CellCloseEvent(options) {
        var _this = _super.call(this) || this;
        /**
         * @hidden
         */
        _this.action = 'cellClose';
        Object.assign(_this, options);
        return _this;
    }
    return CellCloseEvent;
}(__WEBPACK_IMPORTED_MODULE_1__common_preventable_event__["a" /* PreventableEvent */]));



/***/ }),
/* 571 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EditCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__ = __webpack_require__(69);



/**
 * Represents the `edit` command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When an associated button with the directive is clicked, the
 * [`edit`]({% slug api_grid_gridcomponent %}#toc-edit) event
 * is triggered. For more information, refer to this [editing example]({% slug editing_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-command-column title="command">
 *     <ng-template kendoGridCellTemplate>
 *       <button kendoGridEditCommand class="k-primary">Edit</button>
 *     </ng-template>
 *   </kendo-grid-command-column>
 * </kendo-grid>
 * ```
 *
 * > When the row is in the edit mode, the button with `kendoGridEditCommand` is automatically hidden.
 */
var EditCommandDirective = (function () {
    function EditCommandDirective(editService, cellContext) {
        this.editService = editService;
        this.rowIndex = cellContext.rowIndex;
    }
    /**
     * @hidden
     */
    EditCommandDirective.prototype.click = function () {
        this.editService.beginEdit(this.rowIndex);
    };
    Object.defineProperty(EditCommandDirective.prototype, "visible", {
        /**
         * @hidden
         */
        get: function () {
            return this.editService.isEdited(this.rowIndex) ? 'none' : '';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(EditCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(EditCommandDirective.prototype, "commandClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return EditCommandDirective;
}());

EditCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridEditCommand]'
            },] },
];
/** @nocollapse */
EditCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__edit_service__["a" /* EditService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__["a" /* CELL_CONTEXT */],] },] },
]; };
EditCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'visible': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.display',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'commandClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-edit-command',] },],
};


/***/ }),
/* 572 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RemoveCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__ = __webpack_require__(69);



/**
 * Represents the `remove` command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When an associated button with the directive is clicked, the
 * [`remove` event]({% slug api_grid_gridcomponent %}#toc-remove)
 * is triggered. For more information, refer to the [editing example]({% slug editing_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-command-column title="command">
 *     <ng-template kendoGridCellTemplate>
 *       <button kendoGridRemoveCommand>Remove row</button>
 *     </ng-template>
 *   </kendo-grid-command-column>
 * </kendo-grid>
 * ```
 * > When the row *is* in the edit mode, the button with the `kendoGridRemoveCommand` is automatically hidden.
 */
var RemoveCommandDirective = (function () {
    function RemoveCommandDirective(editService, cellContext) {
        this.editService = editService;
        this.rowIndex = cellContext.rowIndex;
    }
    /**
     * @hidden
     */
    RemoveCommandDirective.prototype.click = function () {
        this.editService.remove(this.rowIndex);
    };
    Object.defineProperty(RemoveCommandDirective.prototype, "visible", {
        /**
         * @hidden
         */
        get: function () {
            return this.editService.isEdited(this.rowIndex) ? 'none' : '';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RemoveCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RemoveCommandDirective.prototype, "commandClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return RemoveCommandDirective;
}());

RemoveCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridRemoveCommand]'
            },] },
];
/** @nocollapse */
RemoveCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__edit_service__["a" /* EditService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__["a" /* CELL_CONTEXT */],] },] },
]; };
RemoveCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'visible': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.display',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'commandClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-remove-command',] },],
};


/***/ }),
/* 573 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SaveCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__ = __webpack_require__(69);



/**
 * Represents the `save` command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When an associated button with the directive is clicked, the
 * [`save`]({% slug api_grid_gridcomponent %}#toc-save) event
 * is triggered. For more information, refer to the [editing example]({% slug editing_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-command-column title="command">
 *     <ng-template kendoGridCellTemplate>
 *       <button kendoGridSaveCommand>Save changes</button>
 *     </ng-template>
 *   </kendo-grid-command-column>
 * </kendo-grid>
 * ```
 * > When the row is not in the edit mode, the button with `kendoGridSaveCommand` is automatically hidden.
 *
 * You can control the content of the button based on the state of the row.
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-command-column title="command">
 *     <ng-template kendoGridCellTemplate let-isNew="isNew">
 *       <button kendoGridSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
 *     </ng-template>
 *   </kendo-grid-command-column>
 * </kendo-grid>
 * ```
 */
var SaveCommandDirective = (function () {
    function SaveCommandDirective(editService, cellContext) {
        this.editService = editService;
        this.rowIndex = cellContext.rowIndex;
    }
    /**
     * @hidden
     */
    SaveCommandDirective.prototype.click = function () {
        this.editService.save(this.rowIndex);
    };
    Object.defineProperty(SaveCommandDirective.prototype, "visible", {
        /**
         * @hidden
         */
        get: function () {
            return !this.editService.isEdited(this.rowIndex) ? 'none' : '';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SaveCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SaveCommandDirective.prototype, "commandClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return SaveCommandDirective;
}());

SaveCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridSaveCommand]'
            },] },
];
/** @nocollapse */
SaveCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__edit_service__["a" /* EditService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_2__rendering_common_cell_context__["a" /* CELL_CONTEXT */],] },] },
]; };
SaveCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'visible': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['style.display',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'commandClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-save-command',] },],
};


/***/ }),
/* 574 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExcelCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__excel_service__ = __webpack_require__(177);


/**
 * Represents the **Export to Excel** command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`ToolbarTemplate`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When the user clicks a button associated with the directive, the
 * [`excelExport`]({% slug api_grid_gridcomponent %}#toc-excelexport) event
 * fires. For more information, refer to article on [exporting the Grid to Excel]({% slug excelexport_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *      <ng-template kendoGridToolbarTemplate>
 *          <button kendoGridExcelCommand>Export to PDF</button>
 *      </ng-template>
 *      <kendo-grid-excel fileName="Grid.xlsx">
 *      </kendo-grid-excel>
 * </kendo-grid>
 * ```
 */
var ExcelCommandDirective = (function () {
    function ExcelCommandDirective(excelService) {
        this.excelService = excelService;
    }
    /**
     * @hidden
     */
    ExcelCommandDirective.prototype.click = function () {
        this.excelService.exportClick.emit();
    };
    Object.defineProperty(ExcelCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ExcelCommandDirective.prototype, "excelClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return ExcelCommandDirective;
}());

ExcelCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridExcelCommand]'
            },] },
];
/** @nocollapse */
ExcelCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__excel_service__["a" /* ExcelService */], },
]; };
ExcelCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'excelClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-excel',] },],
};


/***/ }),
/* 575 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ExcelExportEvent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_preventable_event__ = __webpack_require__(120);


/**
 * Arguments for the `excelExport` event.
 */
var ExcelExportEvent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](ExcelExportEvent, _super);
    function ExcelExportEvent(workbook) {
        var _this = _super.call(this) || this;
        _this.workbook = workbook;
        return _this;
    }
    return ExcelExportEvent;
}(__WEBPACK_IMPORTED_MODULE_1__common_preventable_event__["a" /* PreventableEvent */]));



/***/ }),
/* 576 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export ExcelModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__excel_component__ = __webpack_require__(310);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__excel_command_directive__ = __webpack_require__(574);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_excel_export__ = __webpack_require__(297);




var declarations = [__WEBPACK_IMPORTED_MODULE_1__excel_component__["a" /* ExcelComponent */], __WEBPACK_IMPORTED_MODULE_2__excel_command_directive__["a" /* ExcelCommandDirective */]];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Excel component of the Grid.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Grid and Excel modules
 * import { GridModule, ExcelModule } from '@progress/kendo-angular-grid';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, GridModule, ExcelModule], // import Grid and Excel modules
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var ExcelModule = (function () {
    function ExcelModule() {
    }
    return ExcelModule;
}());

ExcelModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [declarations],
                exports: [declarations, __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_excel_export__["d" /* ExcelExportModule */]]
            },] },
];
/** @nocollapse */
ExcelModule.ctorParameters = function () { return []; };


/***/ }),
/* 577 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return filterComponentFactory; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__string_filter_cell_component__ = __webpack_require__(121);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__numeric_filter_cell_component__ = __webpack_require__(180);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__boolean_filter_cell_component__ = __webpack_require__(313);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__date_filter_cell_component__ = __webpack_require__(178);




/**
 * @hidden
 *
 * > List the following components in the GridModule as `entryComponents`.
 */
var filterComponentFactory = function (type) { return ({
    "boolean": __WEBPACK_IMPORTED_MODULE_2__boolean_filter_cell_component__["a" /* BooleanFilterCellComponent */],
    "date": __WEBPACK_IMPORTED_MODULE_3__date_filter_cell_component__["a" /* DateFilterCellComponent */],
    "numeric": __WEBPACK_IMPORTED_MODULE_1__numeric_filter_cell_component__["a" /* NumericFilterCellComponent */],
    "text": __WEBPACK_IMPORTED_MODULE_0__string_filter_cell_component__["a" /* StringFilterCellComponent */]
}[type]); };


/***/ }),
/* 578 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterCellHostDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_host_directive__ = __webpack_require__(317);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__filter_cell_component_factory__ = __webpack_require__(577);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__string_filter_cell_component__ = __webpack_require__(121);






/**
 * @hidden
 */
var FilterCellHostDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](FilterCellHostDirective, _super);
    function FilterCellHostDirective(host, resolver) {
        return _super.call(this, host, resolver) || this;
    }
    FilterCellHostDirective.prototype.componentType = function () {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this.column.filter)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__filter_cell_component_factory__["a" /* filterComponentFactory */])(this.column.filter);
        }
        return __WEBPACK_IMPORTED_MODULE_5__string_filter_cell_component__["a" /* StringFilterCellComponent */];
    };
    return FilterCellHostDirective;
}(__WEBPACK_IMPORTED_MODULE_2__filter_host_directive__["a" /* FilterHostDirective */]));

FilterCellHostDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoFilterCellHost]'
            },] },
];
/** @nocollapse */
FilterCellHostDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ViewContainerRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ComponentFactoryResolver"], },
]; };


/***/ }),
/* 579 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterCellWrapperComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__filter_input_wrapper_component__ = __webpack_require__(318);





/**
 * @hidden
 */
var FilterCellWrapperComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](FilterCellWrapperComponent, _super);
    function FilterCellWrapperComponent(filterService) {
        var _this = _super.call(this, filterService) || this;
        _this.showOperators = true;
        return _this;
    }
    Object.defineProperty(FilterCellWrapperComponent.prototype, "hostClasses", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterCellWrapperComponent.prototype, "overrideBaseClasses", {
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterCellWrapperComponent.prototype, "showButton", {
        get: function () {
            var filter = this.currentFilter;
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(filter) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(filter.value);
        },
        enumerable: true,
        configurable: true
    });
    FilterCellWrapperComponent.prototype.filterChange = function (filter) {
        this.applyFilter(filter);
    };
    return FilterCellWrapperComponent;
}(__WEBPACK_IMPORTED_MODULE_4__filter_input_wrapper_component__["a" /* FilterInputWrapperComponent */]));

FilterCellWrapperComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-filter-wrapper-cell',
                template: "\n        <ng-content></ng-content>\n        <kendo-grid-filter-cell-operators\n            [showOperators]=\"showOperators\"\n            [operators]=\"operators\"\n            (clear)=\"onClear()\"\n            [showButton]=\"showButton\"\n            [(value)]=\"currentOperator\">\n        </kendo-grid-filter-cell-operators>\n    "
            },] },
];
/** @nocollapse */
FilterCellWrapperComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__filter_service__["a" /* FilterService */], },
]; };
FilterCellWrapperComponent.propDecorators = {
    'hostClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell-wrapper',] },],
    'overrideBaseClasses': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["HostBinding"], args: ['class.k-filtercell',] },],
    'showOperators': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 580 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterRowComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var FilterRowComponent = (function () {
    function FilterRowComponent() {
        this.columns = [];
        this.groups = [];
        this.filterRowClass = true;
    }
    return FilterRowComponent;
}());

FilterRowComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridFilterRow]',
                template: "\n      <th\n         [class.k-group-cell]=\"true\"\n         *ngFor=\"let g of groups\">\n      </th>\n      <th\n         [class.k-hierarchy-cell]=\"true\"\n         *ngIf=\"detailTemplate?.templateRef\">\n      </th>\n      <th *ngFor=\"let column of columns;\" kendoGridFilterCell [column]=\"column\" [filter]=\"filter\"></th>\n    "
            },] },
];
/** @nocollapse */
FilterRowComponent.ctorParameters = function () { return []; };
FilterRowComponent.propDecorators = {
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'detailTemplate': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterRowClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-filter-row',] },],
};


/***/ }),
/* 581 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateFilterMenuInputComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__single_popup_service__ = __webpack_require__(122);


/**
 * @hidden
 */
var DateFilterMenuInputComponent = (function () {
    function DateFilterMenuInputComponent(popupService) {
        this.popupService = popupService;
        this.operators = [];
    }
    DateFilterMenuInputComponent.prototype.open = function (picker) {
        this.subscription = this.popupService.onClose
            .filter(function () { return picker.isActive; })
            .subscribe(function (e) { return e.preventDefault(); });
    };
    DateFilterMenuInputComponent.prototype.ngOnDestroy = function () {
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
    };
    return DateFilterMenuInputComponent;
}());

DateFilterMenuInputComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-date-filter-menu-input',
                template: "\n        <kendo-grid-filter-menu-input-wrapper\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [defaultOperator]=\"operator\"\n            [currentFilter]=\"currentFilter\"\n            [filterService]=\"filterService\"\n            >\n            <kendo-datepicker\n                #picker\n                kendoFilterInput\n                (open)=\"open(picker)\"\n                [value]=\"currentFilter?.value\"\n                [placeholder]=\"placeholder\"\n                [formatPlaceholder]=\"formatPlaceholder\"\n                [format]=\"format\"\n                [min]=\"min\"\n                [max]=\"max\"\n                [activeView]=\"activeView\"\n                [bottomView]=\"bottomView\"\n                [topView]=\"topView\"\n                >\n            </kendo-datepicker>\n        </kendo-grid-filter-menu-input-wrapper>\n    "
            },] },
];
/** @nocollapse */
DateFilterMenuInputComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__single_popup_service__["a" /* SinglePopupService */], },
]; };
DateFilterMenuInputComponent.propDecorators = {
    'operators': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'operator': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'currentFilter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'formatPlaceholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'activeView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'bottomView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'topView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 582 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return filterMenuComponentFactory; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__string_filter_menu_component__ = __webpack_require__(123);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__numeric_filter_menu_component__ = __webpack_require__(186);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__date_filter_menu_component__ = __webpack_require__(183);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__boolean_filter_menu_component__ = __webpack_require__(182);




/**
 * @hidden
 *
 * > List the following components as `entryComponents` in the GridModule.
 */
var filterMenuComponentFactory = function (type) { return ({
    "boolean": __WEBPACK_IMPORTED_MODULE_3__boolean_filter_menu_component__["a" /* BooleanFilterMenuComponent */],
    "date": __WEBPACK_IMPORTED_MODULE_2__date_filter_menu_component__["a" /* DateFilterMenuComponent */],
    "numeric": __WEBPACK_IMPORTED_MODULE_1__numeric_filter_menu_component__["a" /* NumericFilterMenuComponent */],
    "text": __WEBPACK_IMPORTED_MODULE_0__string_filter_menu_component__["a" /* StringFilterMenuComponent */]
}[type]); };


/***/ }),
/* 583 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterMenuContainerComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);




var isNoValueOperator = function (operator) { return (operator === "isnull"
    || operator === "isnotnull"
    || operator === "isempty"
    || operator === "isnotempty"); };
var validFilters = function (_a) {
    var value = _a.value, operator = _a.operator;
    return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(value) || isNoValueOperator(operator);
};
var trimFilters = function (filter) {
    filter.filters = filter.filters.filter(validFilters);
    return filter;
};
var findParent = function (filters, field, parent) {
    return filters.reduce(function (acc, filter) {
        if (filter.filters) {
            return findParent(filter.filters, field, filter);
        }
        else if (filter.field === field) {
            return parent;
        }
        return acc;
    }, undefined); // tslint:disable-line:align
};
var parentLogicOfDefault = function (filter, field, def) {
    if (def === void 0) { def = "and"; }
    var parent = findParent(((filter || {}).filters || []), field);
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(parent) ? parent.logic : def;
};
/**
 * @hidden
 */
var FilterMenuContainerComponent = (function () {
    function FilterMenuContainerComponent(parentService, childService) {
        this.parentService = parentService;
        this.childService = childService;
        this.close = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this._templateContext = {};
    }
    Object.defineProperty(FilterMenuContainerComponent.prototype, "childFilter", {
        get: function () {
            if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(this._childFilter)) {
                this._childFilter = {
                    filters: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["c" /* filtersByField */])(this.filter, (this.column || {}).field),
                    logic: parentLogicOfDefault(this.filter, (this.column || {}).field)
                };
            }
            return this._childFilter;
        },
        enumerable: true,
        configurable: true
    });
    FilterMenuContainerComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.subscription = this.childService.changes.subscribe(function (filter) { return _this._childFilter = filter; });
    };
    FilterMenuContainerComponent.prototype.ngOnDestroy = function () {
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
    };
    Object.defineProperty(FilterMenuContainerComponent.prototype, "disabled", {
        get: function () {
            return !this.childFilter.filters.some(validFilters);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterMenuContainerComponent.prototype, "templateContext", {
        get: function () {
            this._templateContext.column = this.column;
            this._templateContext.filter = this.childFilter;
            this._templateContext.filterService = this.childService;
            // tslint:disable-next-line:no-string-literal
            this._templateContext["$implicit"] = this.childFilter;
            return this._templateContext;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FilterMenuContainerComponent.prototype, "hasTemplate", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(this.column) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(this.column.filterMenuTemplateRef);
        },
        enumerable: true,
        configurable: true
    });
    FilterMenuContainerComponent.prototype.submit = function () {
        var filter = trimFilters(this.childFilter);
        if (filter.filters.length) {
            var root = this.filter || {
                filters: [],
                logic: "and"
            };
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["d" /* removeFilter */])(root, this.column.field);
            root.filters.push(filter);
            this.parentService.filter(root);
        }
        this.close.emit();
        return false;
    };
    FilterMenuContainerComponent.prototype.reset = function () {
        var root = this.filter || {
            filters: [],
            logic: "and"
        };
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__base_filter_cell_component__["d" /* removeFilter */])(root, this.column.field);
        this.parentService.filter(root);
        this.close.emit();
    };
    return FilterMenuContainerComponent;
}());

FilterMenuContainerComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                providers: [__WEBPACK_IMPORTED_MODULE_1__filter_service__["a" /* FilterService */]],
                selector: 'kendo-grid-filter-menu-container',
                template: "\n        <form (submit)=\"submit()\" (reset)=\"reset()\"\n            class=\"k-filter-menu k-popup k-group k-reset k-state-border-up\">\n            <div class=\"k-filter-menu-container\">\n                <ng-container [ngSwitch]=\"hasTemplate\">\n                    <ng-container *ngSwitchCase=\"false\">\n                        <ng-container\n                            kendoFilterMenuHost\n                            [filterService]=\"childService\"\n                            [column]=\"column\"\n                            [filter]=\"childFilter\">\n                        </ng-container>\n                    </ng-container>\n                    <ng-container *ngSwitchCase=\"true\">\n                        <ng-template\n                            *ngIf=\"column.filterMenuTemplateRef\"\n                            [ngTemplateOutlet]=\"column.filterMenuTemplateRef\"\n                            [ngTemplateOutletContext]=\"templateContext\"\n                            >\n                        </ng-template>\n                    </ng-container>\n                </ng-container>\n                <div class=\"k-action-buttons k-button-group\">\n                    <button type=\"reset\" class=\"k-button\">Clear</button>\n                    <button class=\"k-button k-primary\" [disabled]=\"disabled\">Filter</button>\n                </div>\n            </div>\n        </form>\n    "
            },] },
];
/** @nocollapse */
FilterMenuContainerComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__filter_service__["a" /* FilterService */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["SkipSelf"] },] },
    { type: __WEBPACK_IMPORTED_MODULE_1__filter_service__["a" /* FilterService */], },
]; };
FilterMenuContainerComponent.propDecorators = {
    'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 584 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterMenuHostDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_host_directive__ = __webpack_require__(317);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__filter_menu_component_factory__ = __webpack_require__(582);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__string_filter_menu_component__ = __webpack_require__(123);






/**
 * @hidden
 */
var FilterMenuHostDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](FilterMenuHostDirective, _super);
    function FilterMenuHostDirective(host, resolver) {
        return _super.call(this, host, resolver) || this;
    }
    FilterMenuHostDirective.prototype.componentType = function () {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["b" /* isPresent */])(this.column) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["h" /* isNullOrEmptyString */])(this.column.filter)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__filter_menu_component_factory__["a" /* filterMenuComponentFactory */])(this.column.filter);
        }
        return __WEBPACK_IMPORTED_MODULE_5__string_filter_menu_component__["a" /* StringFilterMenuComponent */];
    };
    FilterMenuHostDirective.prototype.initComponent = function (ctx) {
        _super.prototype.initComponent.call(this, ctx);
        this.component.instance.filterService = this.filterService;
    };
    return FilterMenuHostDirective;
}(__WEBPACK_IMPORTED_MODULE_2__filter_host_directive__["a" /* FilterHostDirective */]));

FilterMenuHostDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                selector: '[kendoFilterMenuHost]'
            },] },
];
/** @nocollapse */
FilterMenuHostDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ViewContainerRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["ComponentFactoryResolver"], },
]; };
FilterMenuHostDirective.propDecorators = {
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 585 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterMenuInputWrapperComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_input_wrapper_component__ = __webpack_require__(318);



/**
 * @hidden
 */
var FilterMenuInputWrapperComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](FilterMenuInputWrapperComponent, _super);
    function FilterMenuInputWrapperComponent() {
        return _super.call(this, null) || this;
    }
    Object.defineProperty(FilterMenuInputWrapperComponent.prototype, "hostClasses", {
        /**
         * @hidden
         */
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    FilterMenuInputWrapperComponent.prototype.operatorChange = function (dataItem) {
        this.currentOperator = dataItem;
    };
    FilterMenuInputWrapperComponent.prototype.filterChange = function (filter) {
        this.applyFilter(filter);
    };
    Object.defineProperty(FilterMenuInputWrapperComponent.prototype, "currentFilter", {
        /**
         * The current filter for the associated column field.
         * @readonly
         * @type {FilterDescriptor}
         */
        get: function () {
            return this._currentFilter;
        },
        /**
         * The current filter for the associated column field.
         * @readonly
         * @type {FilterDescriptor}
         */
        set: function (value) {
            this._currentFilter = value;
        },
        enumerable: true,
        configurable: true
    });
    FilterMenuInputWrapperComponent.prototype.updateFilter = function (filter) {
        Object.assign(this.currentFilter, filter);
        return this.filter;
    };
    FilterMenuInputWrapperComponent.prototype.onChange = function (value) {
        this.filterChange(this.updateFilter({
            field: this.column.field,
            operator: this.currentOperator,
            value: value
        }));
    };
    return FilterMenuInputWrapperComponent;
}(__WEBPACK_IMPORTED_MODULE_2__filter_input_wrapper_component__["a" /* FilterInputWrapperComponent */]));

FilterMenuInputWrapperComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                selector: 'kendo-grid-filter-menu-input-wrapper',
                template: "\n        <kendo-dropdownlist\n            [data]=\"operators\"\n            (valueChange)=\"operatorChange($event)\"\n            [value]=\"currentOperator\"\n            [valuePrimitive]=\"true\"\n            textField=\"text\"\n            valueField=\"value\">\n        </kendo-dropdownlist>\n        <ng-content></ng-content>\n    "
            },] },
];
/** @nocollapse */
FilterMenuInputWrapperComponent.ctorParameters = function () { return []; };
FilterMenuInputWrapperComponent.propDecorators = {
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
    'currentFilter': [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Input"] },],
};


/***/ }),
/* 586 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FilterMenuComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter_service__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__single_popup_service__ = __webpack_require__(122);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_filter_cell_component__ = __webpack_require__(37);




/**
 * @hidden
 */
var FilterMenuComponent = (function () {
    function FilterMenuComponent(filterService, popupService) {
        this.filterService = filterService;
        this.popupService = popupService;
    }
    Object.defineProperty(FilterMenuComponent.prototype, "hasFilters", {
        get: function () {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__base_filter_cell_component__["c" /* filtersByField */])(this.filter, (this.column || {}).field).length > 0;
        },
        enumerable: true,
        configurable: true
    });
    FilterMenuComponent.prototype.toggle = function (anchor, template) {
        this.popupRef = this.popupService.open(anchor, template, this.popupRef);
        return false;
    };
    FilterMenuComponent.prototype.close = function () {
        this.popupService.destroy();
    };
    return FilterMenuComponent;
}());

FilterMenuComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-filter-menu',
                template: "\n        <a #anchor\n            [ngClass]=\"{'k-grid-filter':true, 'k-state-active': hasFilters}\"\n            (click)=\"toggle(anchor, template)\"\n            href=\"#\"\n            title=\"Filter\">\n            <span class=\"k-icon k-i-filter\"></span>\n        </a>\n        <ng-template #template>\n            <kendo-grid-filter-menu-container\n                [column]=\"column\"\n                [filter]=\"filter\"\n                (close)=\"close()\"\n                >\n            </kendo-grid-filter-menu-container>\n        </ng-template>\n    "
            },] },
];
/** @nocollapse */
FilterMenuComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__filter_service__["a" /* FilterService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__single_popup_service__["a" /* SinglePopupService */], },
]; };
FilterMenuComponent.propDecorators = {
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 587 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NumericFilterMenuInputComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var NumericFilterMenuInputComponent = (function () {
    function NumericFilterMenuInputComponent() {
        this.operators = [];
        /**
         * Specifies the value used to increment or decrement the component value.
         * @type {numeric}
         */
        this.step = 1;
        /**
         * Specifies whether the **Up** and **Down** spin buttons should be rendered.
         * @type {boolean}
         */
        this.spinners = true;
    }
    return NumericFilterMenuInputComponent;
}());

NumericFilterMenuInputComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-numeric-filter-menu-input',
                template: "\n        <kendo-grid-filter-menu-input-wrapper\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [defaultOperator]=\"operator\"\n            [currentFilter]=\"currentFilter\"\n            [filterService]=\"filterService\"\n            >\n            <kendo-numerictextbox\n                kendoFilterInput\n                [autoCorrect]=\"true\"\n                [value]=\"currentFilter?.value\"\n                [format]=\"format\"\n                [decimals]=\"decimals\"\n                [spinners]=\"spinners\"\n                [min]=\"min\"\n                [max]=\"max\"\n                [step]=\"step\">\n            </kendo-numerictextbox>\n        </kendo-grid-filter-menu-input-wrapper>\n    "
            },] },
];
/** @nocollapse */
NumericFilterMenuInputComponent.ctorParameters = function () { return []; };
NumericFilterMenuInputComponent.propDecorators = {
    'operators': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'operator': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'currentFilter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'step': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'spinners': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'decimals': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'format': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 588 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StringFilterMenuInputComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * @hidden
 */
var StringFilterMenuInputComponent = (function () {
    function StringFilterMenuInputComponent() {
        this.operators = [];
    }
    return StringFilterMenuInputComponent;
}());

StringFilterMenuInputComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: 'kendo-grid-string-filter-menu-input',
                template: "\n        <kendo-grid-filter-menu-input-wrapper\n            [column]=\"column\"\n            [filter]=\"filter\"\n            [operators]=\"operators\"\n            [defaultOperator]=\"operator\"\n            [currentFilter]=\"currentFilter\"\n            [filterService]=\"filterService\"\n            >\n            <input class=\"k-textbox\" kendoFilterInput [ngModel]=\"currentFilter?.value\" />\n        </kendo-grid-filter-menu-input-wrapper>\n    "
            },] },
];
/** @nocollapse */
StringFilterMenuInputComponent.ctorParameters = function () { return []; };
StringFilterMenuInputComponent.propDecorators = {
    'operators': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'operator': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'currentFilter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'filterService': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 589 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GridModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__grid_component__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rendering_list_component__ = __webpack_require__(364);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__databinding_directive__ = __webpack_require__(175);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__selection_selection_directive__ = __webpack_require__(369);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__localization_localized_messages_directive__ = __webpack_require__(594);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__localization_custom_messages_component__ = __webpack_require__(343);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__filtering_cell_row_filtering_module__ = __webpack_require__(181);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__pager_pager_module__ = __webpack_require__(353);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__grouping_group_module__ = __webpack_require__(124);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__rendering_header_header_module__ = __webpack_require__(363);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__rendering_body_module__ = __webpack_require__(357);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__rendering_footer_footer_module__ = __webpack_require__(361);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__shared_module__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__rendering_toolbar_toolbar_template_directive__ = __webpack_require__(200);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__rendering_toolbar_toolbar_component__ = __webpack_require__(366);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__progress_kendo_angular_resize_sensor__ = __webpack_require__(72);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__editing_directives_template_editing_directive__ = __webpack_require__(308);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__editing_directives_reactive_editing_directive__ = __webpack_require__(306);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__editing_directives_in_cell_editing_directive__ = __webpack_require__(304);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__grouping_group_scroll_binding_directive__ = __webpack_require__(339);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__filtering_menu_filter_menu_module__ = __webpack_require__(185);
























var exportedModules = [
    __WEBPACK_IMPORTED_MODULE_2__grid_component__["a" /* GridComponent */],
    __WEBPACK_IMPORTED_MODULE_16__rendering_toolbar_toolbar_template_directive__["a" /* ToolbarTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_17__rendering_toolbar_toolbar_component__["a" /* ToolbarComponent */],
    __WEBPACK_IMPORTED_MODULE_5__databinding_directive__["a" /* DataBindingDirective */],
    __WEBPACK_IMPORTED_MODULE_6__selection_selection_directive__["a" /* SelectionDirective */],
    __WEBPACK_IMPORTED_MODULE_8__localization_custom_messages_component__["a" /* CustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_22__grouping_group_scroll_binding_directive__["a" /* GroupBindingDirective */],
    __WEBPACK_IMPORTED_MODULE_19__editing_directives_template_editing_directive__["a" /* TemplateEditingDirective */],
    __WEBPACK_IMPORTED_MODULE_20__editing_directives_reactive_editing_directive__["a" /* ReactiveEditingDirective */],
    __WEBPACK_IMPORTED_MODULE_21__editing_directives_in_cell_editing_directive__["a" /* InCellEditingDirective */]
].concat(__WEBPACK_IMPORTED_MODULE_11__grouping_group_module__["a" /* GroupModule */].exports(), __WEBPACK_IMPORTED_MODULE_15__shared_module__["a" /* SharedModule */].exports(), __WEBPACK_IMPORTED_MODULE_13__rendering_body_module__["a" /* BodyModule */].exports(), __WEBPACK_IMPORTED_MODULE_12__rendering_header_header_module__["a" /* HeaderModule */].exports(), __WEBPACK_IMPORTED_MODULE_14__rendering_footer_footer_module__["a" /* FooterModule */].exports(), __WEBPACK_IMPORTED_MODULE_10__pager_pager_module__["a" /* PagerModule */].exports(), __WEBPACK_IMPORTED_MODULE_9__filtering_cell_row_filtering_module__["a" /* RowFilterModule */].exports(), __WEBPACK_IMPORTED_MODULE_23__filtering_menu_filter_menu_module__["a" /* FilterMenuModule */].exports());
var declarations = [
    __WEBPACK_IMPORTED_MODULE_2__grid_component__["a" /* GridComponent */],
    __WEBPACK_IMPORTED_MODULE_3__rendering_list_component__["a" /* ListComponent */],
    __WEBPACK_IMPORTED_MODULE_17__rendering_toolbar_toolbar_component__["a" /* ToolbarComponent */],
    __WEBPACK_IMPORTED_MODULE_7__localization_localized_messages_directive__["a" /* LocalizedMessagesDirective */],
    __WEBPACK_IMPORTED_MODULE_8__localization_custom_messages_component__["a" /* CustomMessagesComponent */],
    __WEBPACK_IMPORTED_MODULE_5__databinding_directive__["a" /* DataBindingDirective */],
    __WEBPACK_IMPORTED_MODULE_16__rendering_toolbar_toolbar_template_directive__["a" /* ToolbarTemplateDirective */],
    __WEBPACK_IMPORTED_MODULE_6__selection_selection_directive__["a" /* SelectionDirective */],
    __WEBPACK_IMPORTED_MODULE_19__editing_directives_template_editing_directive__["a" /* TemplateEditingDirective */],
    __WEBPACK_IMPORTED_MODULE_20__editing_directives_reactive_editing_directive__["a" /* ReactiveEditingDirective */],
    __WEBPACK_IMPORTED_MODULE_21__editing_directives_in_cell_editing_directive__["a" /* InCellEditingDirective */],
    __WEBPACK_IMPORTED_MODULE_22__grouping_group_scroll_binding_directive__["a" /* GroupBindingDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Grid component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Grid module
 * import { GridModule } from '@progress/kendo-angular-grid';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, GridModule], // import Grid module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var GridModule = (function () {
    function GridModule() {
    }
    return GridModule;
}());

GridModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [declarations],
                exports: [exportedModules],
                imports: [
                    __WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"],
                    __WEBPACK_IMPORTED_MODULE_11__grouping_group_module__["a" /* GroupModule */],
                    __WEBPACK_IMPORTED_MODULE_15__shared_module__["a" /* SharedModule */],
                    __WEBPACK_IMPORTED_MODULE_13__rendering_body_module__["a" /* BodyModule */],
                    __WEBPACK_IMPORTED_MODULE_12__rendering_header_header_module__["a" /* HeaderModule */],
                    __WEBPACK_IMPORTED_MODULE_14__rendering_footer_footer_module__["a" /* FooterModule */],
                    __WEBPACK_IMPORTED_MODULE_10__pager_pager_module__["a" /* PagerModule */],
                    __WEBPACK_IMPORTED_MODULE_9__filtering_cell_row_filtering_module__["a" /* RowFilterModule */],
                    __WEBPACK_IMPORTED_MODULE_23__filtering_menu_filter_menu_module__["a" /* FilterMenuModule */],
                    __WEBPACK_IMPORTED_MODULE_18__progress_kendo_angular_resize_sensor__["b" /* ResizeSensorModule */]
                ],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
GridModule.ctorParameters = function () { return []; };


/***/ }),
/* 590 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupHeaderComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__groups_service__ = __webpack_require__(125);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_info_service__ = __webpack_require__(190);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_column_common__ = __webpack_require__(27);




/**
 * @hidden
 */
var GroupHeaderComponent = (function () {
    function GroupHeaderComponent(groupsService, groupInfoService) {
        this.groupsService = groupsService;
        this.groupInfoService = groupInfoService;
        this.skipGroupDecoration = false;
        this.hasDetails = false;
        this.columns = [];
        this.groups = [];
    }
    Object.defineProperty(GroupHeaderComponent.prototype, "groupItemClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    GroupHeaderComponent.prototype.prefixGroupCell = function (item) {
        return new Array(item.level);
    };
    GroupHeaderComponent.prototype.toggleGroup = function (item) {
        this.groupsService.toggleRow(item.index, item.data);
        return false;
    };
    GroupHeaderComponent.prototype.groupSpan = function (item) {
        var columnCount = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__columns_column_common__["e" /* columnsSpan */])(this.columns);
        if (this.skipGroupDecoration) {
            return columnCount;
        }
        var groupCount = (this.groups || []).length;
        if (this.hasDetails) {
            columnCount++;
        }
        return groupCount + columnCount - item.level;
    };
    GroupHeaderComponent.prototype.groupButtonStyles = function (groupIndex) {
        var expanded = this.groupsService.isExpanded(groupIndex);
        return { 'k-i-collapse': expanded, 'k-i-expand': !expanded, 'k-icon': true };
    };
    GroupHeaderComponent.prototype.formatForGroup = function (item) {
        return this.groupInfoService.formatForGroup(item);
    };
    GroupHeaderComponent.prototype.groupTitle = function (item) {
        return this.groupInfoService.groupTitle(item);
    };
    GroupHeaderComponent.prototype.groupHeaderTemplate = function (item) {
        return this.groupInfoService.groupHeaderTemplate(item);
    };
    return GroupHeaderComponent;
}());

GroupHeaderComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridGroupHeader]',
                template: "\n        <ng-template [ngIf]=\"!skipGroupDecoration\">\n            <td [class.k-group-cell]=\"true\" *ngFor=\"let g of prefixGroupCell(item)\"></td>\n        </ng-template>\n        <td [attr.colspan]=\"groupSpan(item)\">\n            <p class=\"k-reset\">\n                <ng-template [ngIf]=\"!skipGroupDecoration\">\n                    <a href=\"#\" tabindex=\"-1\" (click)=\"toggleGroup(item)\"\n                        [ngClass]=\"groupButtonStyles(item.index)\">\n                    </a>\n                    <ng-template [ngIf]=\"!groupHeaderTemplate(item)\">\n                    {{groupTitle(item)}}: {{item.data | valueOf:\"value\": formatForGroup(item)}}\n                    </ng-template>\n                    <ng-template\n                        [templateContext]=\"{\n                            templateRef: groupHeaderTemplate(item),\n                            group: item.data,\n                            aggregates: item.data?.aggregates,\n                            value: item.data?.value,\n                            field: item.data?.field,\n                            $implicit: item.data\n                            }\">\n                    </ng-template>\n                </ng-template>\n            </p>\n        </td>\n    "
            },] },
];
/** @nocollapse */
GroupHeaderComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__groups_service__["a" /* GroupsService */], },
    { type: __WEBPACK_IMPORTED_MODULE_2__group_info_service__["a" /* GroupInfoService */], },
]; };
GroupHeaderComponent.propDecorators = {
    'item': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'skipGroupDecoration': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'hasDetails': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'columns': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groupItemClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grouping-row',] },],
};


/***/ }),
/* 591 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupIndicatorComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__group_info_service__ = __webpack_require__(190);


/**
 * @hidden
 */
var GroupIndicatorComponent = (function () {
    function GroupIndicatorComponent(groupInfoService) {
        this.groupInfoService = groupInfoService;
        this.directionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.remove = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    Object.defineProperty(GroupIndicatorComponent.prototype, "groupIndicatorClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupIndicatorComponent.prototype, "title", {
        get: function () {
            return this.groupInfoService.groupTitle(this.group);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupIndicatorComponent.prototype, "dir", {
        get: function () {
            return this.group.dir ? this.group.dir : "asc";
        },
        enumerable: true,
        configurable: true
    });
    GroupIndicatorComponent.prototype.toggleDirection = function () {
        this.directionChange.emit({
            dir: this.dir === "asc" ? "desc" : "asc",
            field: this.group.field
        });
        return false;
    };
    GroupIndicatorComponent.prototype.removeDescriptor = function () {
        this.remove.emit({
            dir: this.group.dir,
            field: this.group.field
        });
        return false;
    };
    return GroupIndicatorComponent;
}());

GroupIndicatorComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                selector: '[kendoGroupIndicator]',
                template: "\n        <a href=\"#\" class=\"k-link\" (click)=\"toggleDirection()\">\n            <span class=\"k-icon\"\n                [class.k-i-sort-asc-sm]=\"dir === 'asc'\"\n                [class.k-i-sort-desc-sm]=\"dir === 'desc'\"></span>\n            {{title}}</a>\n        <a class=\"k-button k-button-icon k-bare\" (click)=\"removeDescriptor()\">\n            <span class=\"k-icon k-i-group-delete\"></span>\n        </a>\n    "
            },] },
];
/** @nocollapse */
GroupIndicatorComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__group_info_service__["a" /* GroupInfoService */], },
]; };
GroupIndicatorComponent.propDecorators = {
    'directionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'remove': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'group': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groupIndicatorClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-group-indicator",] },],
};


/***/ }),
/* 592 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupPanelComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__group_connection_service__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_draggable_directive__ = __webpack_require__(119);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__ = __webpack_require__(3);





/**
 * @hidden
 */
var GroupPanelComponent = (function () {
    function GroupPanelComponent(connection, draggableService, element, localization) {
        var _this = this;
        this.connection = connection;
        this.draggableService = draggableService;
        this.localization = localization;
        this.change = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.groups = [];
        this.subscription = connection
            .register(element.nativeElement)
            .subscribe(function (_a) {
            var field = _a.field, idx = _a.idx;
            return _this.insert(field, idx);
        });
    }
    Object.defineProperty(GroupPanelComponent.prototype, "groupHeaderClass", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GroupPanelComponent.prototype, "text", {
        get: function () {
            return this.emptyText ? this.emptyText : this.localization.get('groupPanelEmpty');
        },
        set: function (value) {
            this.emptyText = value;
        },
        enumerable: true,
        configurable: true
    });
    GroupPanelComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.subscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["f" /* observe */])(this.dropTargets)
            .subscribe(function (items) {
            return _this.connection.registerItems(items.map(function (x) { return x.nativeElement; }));
        }));
        this.subscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils__["f" /* observe */])(this.draggables)
            .subscribe(function (items) {
            return _this.draggableService.connect(items.toArray());
        }));
    };
    GroupPanelComponent.prototype.ngOnDestroy = function () {
        this.draggableService.unsubscribe();
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
    };
    GroupPanelComponent.prototype.directionChange = function (group) {
        var index = this.groups.findIndex(function (x) { return x.field === group.field; });
        var groups = this.groups.slice(0, index).concat([group], this.groups.slice(index + 1));
        this.change.emit(groups);
    };
    GroupPanelComponent.prototype.insert = function (field, index) {
        var groups = this.groups.filter(function (x) { return x.field !== field; });
        if (groups.length || this.groups.length === 0) {
            this.change.emit(groups.slice(0, index).concat([{ field: field }], groups.slice(index)));
        }
    };
    GroupPanelComponent.prototype.remove = function (group) {
        this.change.emit(this.groups.filter(function (x) { return x.field !== group.field; }));
    };
    return GroupPanelComponent;
}());

GroupPanelComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ChangeDetectionStrategy"].OnPush,
                providers: [__WEBPACK_IMPORTED_MODULE_1__group_connection_service__["b" /* GroupDragService */]],
                selector: 'kendo-grid-group-panel',
                template: "\n    <ng-template [ngIf]=\"groups.length === 0\">\n        {{ text }}\n    </ng-template>\n    <div *ngFor=\"let group of groups\"\n        kendoGroupIndicator\n        [kendoGridDraggable]=\"group\"\n        [group]=\"group\"\n        (directionChange)=\"directionChange($event)\"\n        (remove)=\"remove($event)\">\n    </div>\n    "
            },] },
];
/** @nocollapse */
GroupPanelComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__group_connection_service__["a" /* GroupConnectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_1__group_connection_service__["b" /* GroupDragService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };
GroupPanelComponent.propDecorators = {
    'change': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'groupHeaderClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ["class.k-grouping-header",] },],
    'text': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'groups': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'draggables': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: [__WEBPACK_IMPORTED_MODULE_2__common_draggable_directive__["a" /* DraggableDirective */],] },],
    'dropTargets': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChildren"], args: [__WEBPACK_IMPORTED_MODULE_2__common_draggable_directive__["a" /* DraggableDirective */], { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"] },] },],
};


/***/ }),
/* 593 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/* tslint:disable: object-literal-sort-keys */
var bootstrapToMedia = function (media) { return (({
    "xs": "(max-width: 576px)",
    "sm": "(min-width: 576px)",
    "md": "(min-width: 768px)",
    "lg": "(min-width: 992px)",
    "xl": "(min-width: 1200px)"
})[media] || media); };
/* tslint:enable: object-literal-sort-keys */
var browserMatchMedia = function (media) { return window.matchMedia(media).matches; };
/**
 * @hidden
 */
var ResponsiveService = (function () {
    function ResponsiveService() {
        /**
         * @hidden
         */
        this.matchMedia = browserMatchMedia;
    }
    /**
     * @hidden
     */
    ResponsiveService.prototype.matchesMedia = function (media) {
        return !media || this.matchMedia(bootstrapToMedia(media));
    };
    return ResponsiveService;
}());

ResponsiveService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ResponsiveService.ctorParameters = function () { return []; };


/***/ }),
/* 594 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(344);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoGridLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 595 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__grid_module__ = __webpack_require__(589);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__grid_module__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shared_module__ = __webpack_require__(50);
/* unused harmony reexport SharedModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__grid_component__ = __webpack_require__(34);
/* unused harmony reexport GridComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_column_component__ = __webpack_require__(49);
/* unused harmony reexport ColumnComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__columns_span_column_component__ = __webpack_require__(172);
/* unused harmony reexport SpanColumnComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__columns_column_group_component__ = __webpack_require__(90);
/* unused harmony reexport ColumnGroupComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rendering_toolbar_toolbar_component__ = __webpack_require__(366);
/* unused harmony reexport ToolbarComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__rendering_toolbar_toolbar_template_directive__ = __webpack_require__(200);
/* unused harmony reexport ToolbarTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__rendering_cell_template_directive__ = __webpack_require__(68);
/* unused harmony reexport CellTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__rendering_header_header_template_directive__ = __webpack_require__(198);
/* unused harmony reexport HeaderTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__rendering_footer_footer_template_directive__ = __webpack_require__(197);
/* unused harmony reexport FooterTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__rendering_details_detail_template_directive__ = __webpack_require__(195);
/* unused harmony reexport DetailTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__grouping_group_header_template_directive__ = __webpack_require__(189);
/* unused harmony reexport GroupHeaderTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__grouping_group_footer_template_directive__ = __webpack_require__(188);
/* unused harmony reexport GroupFooterTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__layout_resizable_directive__ = __webpack_require__(341);
/* unused harmony reexport ResizableContainerDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__rendering_common_template_context_directive__ = __webpack_require__(359);
/* unused harmony reexport TemplateContextDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__rendering_no_records_template_directive__ = __webpack_require__(199);
/* unused harmony reexport NoRecordsTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__databinding_directive__ = __webpack_require__(175);
/* unused harmony reexport DataBindingDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__selection_selection_directive__ = __webpack_require__(369);
/* unused harmony reexport SelectionDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__filtering_filter_service__ = __webpack_require__(33);
/* unused harmony reexport FilterService */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__filtering_cell_filter_cell_template_directive__ = __webpack_require__(179);
/* unused harmony reexport FilterCellTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__filtering_cell_filter_cell_component__ = __webpack_require__(315);
/* unused harmony reexport FilterCellComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__filtering_cell_string_filter_cell_component__ = __webpack_require__(121);
/* unused harmony reexport StringFilterCellComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__filtering_cell_date_filter_cell_component__ = __webpack_require__(178);
/* unused harmony reexport DateFilterCellComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__filtering_base_filter_cell_component__ = __webpack_require__(37);
/* unused harmony reexport BaseFilterCellComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__filtering_menu_filter_menu_template_directive__ = __webpack_require__(184);
/* unused harmony reexport FilterMenuTemplateDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__filtering_menu_numeric_filter_menu_component__ = __webpack_require__(186);
/* unused harmony reexport NumericFilterMenuComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__filtering_menu_string_filter_menu_component__ = __webpack_require__(123);
/* unused harmony reexport StringFilterMenuComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__filtering_menu_date_filter_menu_component__ = __webpack_require__(183);
/* unused harmony reexport DateFilterMenuComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__filtering_menu_boolean_filter_menu_component__ = __webpack_require__(182);
/* unused harmony reexport BooleanFilterMenuComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__filtering_operators_after_eq_filter_operator_component__ = __webpack_require__(321);
/* unused harmony reexport AfterEqFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__filtering_operators_after_filter_operator_component__ = __webpack_require__(322);
/* unused harmony reexport AfterFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__filtering_operators_contains_filter_operator_component__ = __webpack_require__(323);
/* unused harmony reexport ContainsFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__filtering_operators_not_contains_filter_operator_component__ = __webpack_require__(335);
/* unused harmony reexport DoesNotContainFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__filtering_operators_ends_with_filter_operator_component__ = __webpack_require__(324);
/* unused harmony reexport EndsWithFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__filtering_operators_eq_filter_operator_component__ = __webpack_require__(325);
/* unused harmony reexport EqualFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__filtering_operators_is_empty_filter_operator_component__ = __webpack_require__(328);
/* unused harmony reexport IsEmptyFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__filtering_operators_is_not_empty_filter_operator_component__ = __webpack_require__(329);
/* unused harmony reexport IsNotEmptyFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__filtering_operators_is_not_null_filter_operator_component__ = __webpack_require__(330);
/* unused harmony reexport IsNotNullFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__filtering_operators_isnull_filter_operator_component__ = __webpack_require__(331);
/* unused harmony reexport IsNullFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__filtering_operators_neq_filter_operator_component__ = __webpack_require__(334);
/* unused harmony reexport NotEqualFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__filtering_operators_starts_with_filter_operator_component__ = __webpack_require__(336);
/* unused harmony reexport StartsWithFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__filtering_cell_numeric_filter_cell_component__ = __webpack_require__(180);
/* unused harmony reexport NumericFilterCellComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__filtering_cell_autocomplete_filter_cell_component__ = __webpack_require__(312);
/* unused harmony reexport AutoCompleteFilterCellComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__filtering_operators_gt_filter_operator_component__ = __webpack_require__(326);
/* unused harmony reexport GreaterFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__filtering_operators_gte_filter_operator_component__ = __webpack_require__(327);
/* unused harmony reexport GreaterOrEqualToFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__filtering_operators_lte_filter_operator_component__ = __webpack_require__(333);
/* unused harmony reexport LessOrEqualToFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__filtering_operators_lt_filter_operator_component__ = __webpack_require__(332);
/* unused harmony reexport LessFilterOperatorComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__pager_pager_prev_buttons_component__ = __webpack_require__(350);
/* unused harmony reexport PagerPrevButtonsComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__pager_pager_next_buttons_component__ = __webpack_require__(347);
/* unused harmony reexport PagerNextButtonsComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__pager_pager_numeric_buttons_component__ = __webpack_require__(348);
/* unused harmony reexport PagerNumericButtonsComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__pager_pager_input_component__ = __webpack_require__(346);
/* unused harmony reexport PagerInputComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__pager_pager_info_component__ = __webpack_require__(345);
/* unused harmony reexport PagerInfoComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__pager_pager_page_sizes_component__ = __webpack_require__(349);
/* unused harmony reexport PagerPageSizesComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__filtering_cell_row_filtering_module__ = __webpack_require__(181);
/* unused harmony reexport RowFilterModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__filtering_menu_filter_menu_module__ = __webpack_require__(185);
/* unused harmony reexport FilterMenuModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__rendering_body_module__ = __webpack_require__(357);
/* unused harmony reexport BodyModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__grouping_group_module__ = __webpack_require__(124);
/* unused harmony reexport GroupModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__rendering_header_header_module__ = __webpack_require__(363);
/* unused harmony reexport HeaderModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__rendering_footer_footer_module__ = __webpack_require__(361);
/* unused harmony reexport FooterModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__pager_pager_module__ = __webpack_require__(353);
/* unused harmony reexport PagerModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__editing_directives_template_editing_directive__ = __webpack_require__(308);
/* unused harmony reexport TemplateEditingDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__editing_directives_reactive_editing_directive__ = __webpack_require__(306);
/* unused harmony reexport ReactiveEditingDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__editing_directives_in_cell_editing_directive__ = __webpack_require__(304);
/* unused harmony reexport InCellEditingDirective */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__rendering_common_col_group_component__ = __webpack_require__(358);
/* unused harmony reexport ColGroupComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__rendering_header_header_component__ = __webpack_require__(362);
/* unused harmony reexport HeaderComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__rendering_list_component__ = __webpack_require__(364);
/* unused harmony reexport ListComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__rendering_footer_footer_component__ = __webpack_require__(360);
/* unused harmony reexport FooterComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__rendering_table_body_component__ = __webpack_require__(365);
/* unused harmony reexport TableBodyComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__pager_pager_component__ = __webpack_require__(352);
/* unused harmony reexport PagerComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__localization_custom_messages_component__ = __webpack_require__(343);
/* unused harmony reexport CustomMessagesComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__pdf_pdf_module__ = __webpack_require__(600);
/* unused harmony reexport PDFModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__pdf_pdf_component__ = __webpack_require__(356);
/* unused harmony reexport PDFComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__pdf_pdf_margin_component__ = __webpack_require__(192);
/* unused harmony reexport PDFMarginComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__excel_excel_module__ = __webpack_require__(576);
/* unused harmony reexport ExcelModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__excel_excel_component__ = __webpack_require__(310);
/* unused harmony reexport ExcelComponent */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__grouping_group_scroll_binding_directive__ = __webpack_require__(339);
/* unused harmony reexport GroupBindingDirective */
/* unused harmony reexport slice */
/* unused harmony reexport count */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__utils__ = __webpack_require__(7);
/* unused harmony reexport Skip */
































































//Workaround for angular/angular#11889







//PDF



//Excel






/***/ }),
/* 596 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalize; });
/**
 * @hidden
 */
var normalizeSettings = function (_a) {
    var _b = _a.buttonCount, buttonCount = _b === void 0 ? 10 : _b, _c = _a.info, info = _c === void 0 ? true : _c, _d = _a.type, type = _d === void 0 ? 'numeric' : _d, _e = _a.pageSizes, pageSizes = _e === void 0 ? false : _e, _f = _a.previousNext, previousNext = _f === void 0 ? true : _f;
    return ({
        buttonCount: buttonCount,
        info: info,
        pageSizes: pageSizes === true ? [5, 10, 20] : pageSizes,
        previousNext: previousNext,
        type: type
    });
};
/**
 * @hidden
 */
var normalize = function (settings) {
    return normalizeSettings(settings === true ? {} : settings);
};


/***/ }),
/* 597 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return exportElement; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__grid_query__ = __webpack_require__(354);

var appendNodes = function (element, nodes) {
    var length = nodes.length;
    for (var idx = 0; idx < length; idx++) {
        element.appendChild(nodes[idx].cloneNode(true));
    }
};
var wrapTable = function (table) {
    var wrapper = document.createElement('div');
    wrapper.className = 'k-widget k-grid';
    wrapper.appendChild(table);
    return wrapper;
};
var createTableElement = function (sources) {
    var sourceCount = sources.length;
    var element = sources[0].cloneNode(true);
    var rowsCount = element.rows.length;
    if (sourceCount > 1) {
        for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
            for (var sourceIdx = 1; sourceIdx < sourceCount; sourceIdx++) {
                appendNodes(element.rows[rowIdx], sources[sourceIdx].rows[rowIdx].cells);
            }
        }
    }
    return element;
};
var createTable = function (colGroups, headers, bodies, footers) {
    var table = document.createElement('table');
    var colGroup = colGroups[0].cloneNode(true);
    for (var idx = 1; idx < colGroups.length; idx++) {
        appendNodes(colGroup, colGroups[idx].querySelectorAll('col'));
    }
    var header = createTableElement(headers);
    var body = createTableElement(bodies);
    header.className = __WEBPACK_IMPORTED_MODULE_0__grid_query__["b" /* HEADER_CLASS */];
    table.appendChild(colGroup);
    table.appendChild(header);
    table.appendChild(body);
    if (footers.length) {
        var footer = createTableElement(footers);
        footer.className = __WEBPACK_IMPORTED_MODULE_0__grid_query__["c" /* FOOTER_CLASS */];
        table.appendChild(footer);
    }
    return wrapTable(table);
};
/**
 * @hidden
 */
var exportElement = function (wrapper) {
    var query = new __WEBPACK_IMPORTED_MODULE_0__grid_query__["a" /* GridQuery */](wrapper);
    var content = query.content();
    var result;
    if (content) {
        var colGroups = [content.querySelector('colgroup')];
        var headers = [query.header().querySelector('thead')];
        var bodies = [content.querySelector('tbody')];
        var footer = query.footer();
        var footers = [];
        if (footer) {
            footers.push(footer.querySelector('tfoot'));
        }
        var lockedContent = query.content(true);
        if (lockedContent) {
            colGroups.unshift(lockedContent.querySelector('colgroup'));
            headers.unshift(query.header(true).querySelector('thead'));
            bodies.unshift(lockedContent.querySelector('tbody'));
            if (footer) {
                footers.unshift(query.footer(true).querySelector('tfoot'));
            }
        }
        result = createTable(colGroups, headers, bodies, footers);
    }
    else {
        result = wrapTable(query.table().cloneNode(true));
    }
    return result;
};


/***/ }),
/* 598 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFCommandDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pdf_service__ = __webpack_require__(193);


/**
 * Represents the **Export to PDF** command of the Grid.
 *
 * You can apply this directive to any `button` element inside a
 * [`ToolbarTemplate`]({% slug api_grid_commandcolumncomponent %}).
 *
 * When the user clicks a button associated with the directive, the
 * [`pdfExport`]({% slug api_grid_gridcomponent %}#toc-pdfexport) event
 * fires. For more information, refer to the [PDF export example]({% slug pdfexport_grid %}).
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *      <ng-template kendoGridToolbarTemplate>
 *          <button kendoGridPDFCommand>Export to PDF</button>
 *      </ng-template>
 *      <kendo-grid-pdf fileName="Grid.pdf">
 *      </kendo-grid-pdf>
 * </kendo-grid>
 * ```
 */
var PDFCommandDirective = (function () {
    function PDFCommandDirective(pdfService) {
        this.pdfService = pdfService;
    }
    /**
     * @hidden
     */
    PDFCommandDirective.prototype.click = function () {
        this.pdfService.exportClick.emit();
    };
    Object.defineProperty(PDFCommandDirective.prototype, "buttonClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PDFCommandDirective.prototype, "pdfClass", {
        /**
         * @hidden
         */
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return PDFCommandDirective;
}());

PDFCommandDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridPDFCommand]'
            },] },
];
/** @nocollapse */
PDFCommandDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__pdf_service__["a" /* PDFService */], },
]; };
PDFCommandDirective.propDecorators = {
    'click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostListener"], args: ['click',] },],
    'buttonClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-button',] },],
    'pdfClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-grid-pdf',] },],
};


/***/ }),
/* 599 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PDFExportEvent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_preventable_event__ = __webpack_require__(120);


/**
 * Arguments for the `pdfExport` event.
 */
var PDFExportEvent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](PDFExportEvent, _super);
    function PDFExportEvent() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return PDFExportEvent;
}(__WEBPACK_IMPORTED_MODULE_1__common_preventable_event__["a" /* PreventableEvent */]));



/***/ }),
/* 600 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export PDFModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pdf_component__ = __webpack_require__(356);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pdf_command_directive__ = __webpack_require__(598);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pdf_template_directive__ = __webpack_require__(355);





var exportedModules = [
    __WEBPACK_IMPORTED_MODULE_1__pdf_component__["a" /* PDFComponent */],
    __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__["a" /* PDFMarginComponent */],
    __WEBPACK_IMPORTED_MODULE_3__pdf_command_directive__["a" /* PDFCommandDirective */],
    __WEBPACK_IMPORTED_MODULE_4__pdf_template_directive__["a" /* PDFTemplateDirective */]
];
var declarations = [
    __WEBPACK_IMPORTED_MODULE_1__pdf_component__["a" /* PDFComponent */],
    __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__["a" /* PDFMarginComponent */],
    __WEBPACK_IMPORTED_MODULE_3__pdf_command_directive__["a" /* PDFCommandDirective */],
    __WEBPACK_IMPORTED_MODULE_4__pdf_template_directive__["a" /* PDFTemplateDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Grid PDF component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Grid and PDF modules
 * import { GridModule, PDFModule } from '@progress/kendo-angular-grid';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, GridModule, PDFModule], // import Grid and PDF modules
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var PDFModule = (function () {
    function PDFModule() {
    }
    return PDFModule;
}());

PDFModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [declarations],
                exports: [exportedModules]
            },] },
];
/** @nocollapse */
PDFModule.ctorParameters = function () { return []; };


/***/ }),
/* 601 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CellComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editing_edit_service__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__columns_command_column_component__ = __webpack_require__(301);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__columns_column_component__ = __webpack_require__(49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_cell_context__ = __webpack_require__(69);






/**
 * @hidden
 */
var CellComponent = (function () {
    function CellComponent(editService, cellContext) {
        this.editService = editService;
        this.cellContext = cellContext;
        this.isNew = false;
        this._templateContext = {};
    }
    Object.defineProperty(CellComponent.prototype, "commandCellClass", {
        get: function () {
            return this.isCommand(this.column);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CellComponent.prototype, "rowIndex", {
        get: function () {
            return this._rowIndex;
        },
        set: function (index) {
            this._rowIndex = index;
            this.updateCellContext();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CellComponent.prototype, "isEdited", {
        get: function () {
            if (!this.isColumnEditable) {
                return false;
            }
            var editContext = this.editService.columnContext(this.rowIndex, this.column);
            return this.isFieldEditable(editContext, this.column);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CellComponent.prototype, "formGroup", {
        get: function () {
            return this.editService.context(this.rowIndex).group;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CellComponent.prototype, "templateContext", {
        get: function () {
            this._templateContext.$implicit = this.formGroup;
            this._templateContext.isNew = this.isNew;
            this._templateContext.column = this.column;
            this._templateContext.dataItem = this.dataItem;
            this._templateContext.formGroup = this.formGroup;
            this._templateContext.rowIndex = this.rowIndex;
            return this._templateContext;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CellComponent.prototype, "format", {
        get: function () {
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__columns_column_component__["a" /* isColumnComponent */])(this.column) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["h" /* isNullOrEmptyString */])(this.column.format)) {
                return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["n" /* extractFormat */])(this.column.format);
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CellComponent.prototype, "isColumnEditable", {
        get: function () {
            if (!this.column || this.isCommand(this.column)) {
                return false;
            }
            return this.column.editable !== false;
        },
        enumerable: true,
        configurable: true
    });
    CellComponent.prototype.ngDoCheck = function () {
        this.updateCellContext();
    };
    CellComponent.prototype.isCommand = function (column) {
        return column instanceof __WEBPACK_IMPORTED_MODULE_2__columns_command_column_component__["a" /* CommandColumnComponent */];
    };
    CellComponent.prototype.isFieldEditable = function (editContext, column) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* isPresent */])(editContext)) {
            return false;
        }
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* isPresent */])(column.editTemplate)) {
            return true;
        }
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* isPresent */])(editContext.group) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* isPresent */])(editContext.group.get(column.field));
    };
    CellComponent.prototype.updateCellContext = function () {
        if (this.cellContext) {
            this.cellContext.rowIndex = this._rowIndex;
        }
    };
    return CellComponent;
}());

CellComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"], args: [{
                selector: '[kendoGridCell]',
                template: "\n        <ng-container [ngSwitch]=\"isEdited\">\n            <ng-content *ngSwitchCase=\"false\"></ng-content>\n            <ng-container *ngSwitchCase=\"true\">\n                <ng-template\n                    *ngIf=\"column.editTemplateRef\"\n                    [ngTemplateOutlet]=\"column.editTemplateRef\"\n                    [ngTemplateOutletContext]=\"templateContext\">\n                </ng-template>\n                <ng-container [ngSwitch]=\"column.editor\" *ngIf=\"!column.editTemplate\">\n                    <kendo-numerictextbox\n                        *ngSwitchCase=\"'numeric'\"\n                        [format]=\"format\"\n                        [formControl]=\"formGroup.get(column.field)\"\n                    ></kendo-numerictextbox>\n\n                    <kendo-datepicker\n                        *ngSwitchCase=\"'date'\"\n                        [format]=\"format\"\n                        [formControl]=\"formGroup.get(column.field)\"\n                    ></kendo-datepicker>\n\n                    <input\n                        *ngSwitchCase=\"'boolean'\"\n                        type=\"checkbox\"\n                        [formControl]=\"formGroup.get(column.field)\"\n                    />\n\n                    <input\n                        *ngSwitchDefault\n                        type=\"text\"\n                        class=\"k-textbox\"\n                        [formControl]=\"formGroup.get(column.field)\"\n                    />\n                </ng-container>\n            </ng-container>\n        </ng-container>\n    "
            },] },
];
/** @nocollapse */
CellComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__editing_edit_service__["a" /* EditService */], },
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [__WEBPACK_IMPORTED_MODULE_5__common_cell_context__["a" /* CELL_CONTEXT */],] },] },
]; };
CellComponent.propDecorators = {
    'commandCellClass': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['class.k-command-cell',] },],
    'column': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'isNew': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'rowIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'dataItem': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
};


/***/ }),
/* 602 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FieldAccessorPipe; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__ = __webpack_require__(75);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);
/* tslint:disable:pipe-naming */




/**
 * @hidden
 */
var FieldAccessorPipe = (function () {
    function FieldAccessorPipe(intlService) {
        this.intlService = intlService;
    }
    FieldAccessorPipe.prototype.transform = function (dataItem, fieldName, format, safe) {
        if (format === void 0) { format = ""; }
        if (safe === void 0) { safe = true; }
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["h" /* isNullOrEmptyString */])(fieldName)) {
            var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["d" /* getter */])(fieldName, safe)(dataItem);
            if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(value) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["h" /* isNullOrEmptyString */])(format)) {
                return this.intlService.format(format, value);
            }
            return value;
        }
        return dataItem;
    };
    return FieldAccessorPipe;
}());

FieldAccessorPipe.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Pipe"], args: [{
                name: 'valueOf',
                pure: false
            },] },
];
/** @nocollapse */
FieldAccessorPipe.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["b" /* IntlService */], },
]; };


/***/ }),
/* 603 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RowHeightService; });
/**
 * @hidden
 */
var update = function (arr, idx, value) { return (arr.slice(0, idx + 1).concat((arr.slice(idx + 1).map(function (x) { return x + value; })))); };
/**
 * @hidden
 */
var RowHeightService = (function () {
    function RowHeightService(total, rowHeight, detailRowHeight) {
        if (total === void 0) { total = 0; }
        this.total = total;
        this.rowHeight = rowHeight;
        this.detailRowHeight = detailRowHeight;
        this.offsets = [];
        this.heights = [];
        var agg = 0;
        for (var idx = 0; idx < total; idx++) {
            this.offsets.push(agg);
            agg += rowHeight;
            this.heights.push(rowHeight);
        }
    }
    RowHeightService.prototype.height = function (rowIndex) {
        return this.heights[rowIndex];
    };
    RowHeightService.prototype.expandDetail = function (rowIndex) {
        if (this.height(rowIndex) === this.rowHeight) {
            this.updateRowHeight(rowIndex, this.detailRowHeight);
        }
    };
    RowHeightService.prototype.collapseDetail = function (rowIndex) {
        if (this.height(rowIndex) > this.rowHeight) {
            this.updateRowHeight(rowIndex, this.detailRowHeight * -1);
        }
    };
    RowHeightService.prototype.index = function (position) {
        if (position < 0) {
            return undefined;
        }
        var result = this.offsets.reduce(function (prev, current, idx) {
            if (prev !== undefined) {
                return prev;
            }
            else if (current === position) {
                return idx;
            }
            else if (current > position) {
                return idx - 1;
            }
            return undefined;
        }, undefined); // tslint:disable-line:align
        return result === undefined ? this.total - 1 : result;
    };
    RowHeightService.prototype.offset = function (rowIndex) {
        return this.offsets[rowIndex];
    };
    RowHeightService.prototype.totalHeight = function () {
        return this.heights.reduce(function (prev, curr) { return prev + curr; }, 0);
    };
    RowHeightService.prototype.updateRowHeight = function (rowIndex, value) {
        this.heights[rowIndex] += value;
        this.offsets = update(this.offsets, rowIndex, value);
    };
    return RowHeightService;
}());



/***/ }),
/* 604 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ScrollAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PageAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollerService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_BehaviorSubject__ = __webpack_require__(150);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_BehaviorSubject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_BehaviorSubject__);


/**
 * @hidden
 */
var ScrollAction = (function () {
    function ScrollAction(offset) {
        this.offset = offset;
    }
    return ScrollAction;
}());

/**
 * @hidden
 */
var PageAction = (function () {
    function PageAction(skip, take) {
        this.skip = skip;
        this.take = take;
    }
    return PageAction;
}());

/**
 * @hidden
 */
var ScrollerService = (function () {
    function ScrollerService(scrollObservable) {
        this.scrollObservable = scrollObservable;
        this.firstLoaded = 0;
    }
    ScrollerService.prototype.create = function (rowHeightService, skip, take, total) {
        var _this = this;
        this.rowHeightService = rowHeightService;
        this.firstLoaded = skip;
        this.lastLoaded = skip + take;
        this.take = take;
        this.total = total;
        this.lastScrollTop = 0;
        var subject = new __WEBPACK_IMPORTED_MODULE_1_rxjs_BehaviorSubject__["BehaviorSubject"](new ScrollAction(this.rowHeightService.offset(skip)));
        this.subscription = __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"].create(function (observer) {
            _this.unsubscribe();
            _this.scrollSubscription = _this.scrollObservable.subscribe(function (x) { return _this.onScroll(x, observer); });
        }).subscribe(function (x) { return subject.next(x); });
        return subject;
    };
    ScrollerService.prototype.destroy = function () {
        this.unsubscribe();
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
    };
    ScrollerService.prototype.onScroll = function (_a, observer) {
        var scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight;
        if (this.lastScrollTop === scrollTop) {
            return;
        }
        var up = this.lastScrollTop >= scrollTop;
        this.lastScrollTop = scrollTop;
        var firstItemIndex = this.rowHeightService.index(scrollTop);
        var firstItemOffset = this.rowHeightService.offset(firstItemIndex);
        var lastItemIndex = this.rowHeightService.index(scrollTop + offsetHeight);
        if (!up && lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {
            var overflow = (firstItemIndex + this.take) - this.total;
            if (overflow > 0) {
                firstItemIndex = firstItemIndex - overflow;
                firstItemOffset = this.rowHeightService.offset(firstItemIndex);
            }
            this.firstLoaded = firstItemIndex;
            observer.next(new ScrollAction(firstItemOffset));
            var nextTake = this.firstLoaded + this.take;
            this.lastLoaded = Math.min(nextTake, this.total);
            nextTake = nextTake > this.total ? this.total - this.firstLoaded : this.take;
            observer.next(new PageAction(this.firstLoaded, this.take));
        }
        if (up && firstItemIndex < this.firstLoaded) {
            var nonVisibleBuffer = Math.floor(this.take * 0.3);
            this.firstLoaded = Math.max(firstItemIndex - nonVisibleBuffer, 0);
            observer.next(new ScrollAction(this.rowHeightService.offset(this.firstLoaded)));
            this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);
            observer.next(new PageAction(this.firstLoaded, this.take));
        }
    };
    ScrollerService.prototype.unsubscribe = function () {
        if (this.scrollSubscription) {
            this.scrollSubscription.unsubscribe();
            this.scrollSubscription = undefined;
        }
    };
    return ScrollerService;
}());



/***/ }),
/* 605 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectAllCheckboxDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__selection_service__ = __webpack_require__(91);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(7);



var SelectAllCheckboxDirective = (function () {
    function SelectAllCheckboxDirective(selectionService, el, renderer, ngZone) {
        var _this = this;
        this.selectionService = selectionService;
        this.el = el;
        this.renderer = renderer;
        this.ngZone = ngZone;
        /**
         * Fires when the user clicks the select-all checkbox (`kendoGridSelectAllCheckbox`).
         */
        this.selectAllChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.type = "checkbox";
        this.stateSet = false;
        this.ngZone.runOutsideAngular(function () {
            _this.destroyClick = _this.renderer.listen(_this.el.nativeElement, "click", _this.onClick.bind(_this));
        });
    }
    SelectAllCheckboxDirective.prototype.ngAfterContentChecked = function () {
        this.setState();
    };
    SelectAllCheckboxDirective.prototype.ngOnChanges = function () {
        this.stateSet = true;
    };
    SelectAllCheckboxDirective.prototype.ngOnDestroy = function () {
        if (this.destroyClick) {
            this.destroyClick();
        }
    };
    /**
     * @hidden
     */
    SelectAllCheckboxDirective.prototype.onClick = function () {
        var _this = this;
        var isChecked = this.el.nativeElement.checked;
        var options = this.selectionService.options;
        this.selectAllChange.emit(isChecked ? "checked" : "unchecked");
        if (options.enabled && options.mode === "multiple") {
            this.ngZone.run(function () {
                _this.selectionService.updateAll(isChecked);
            });
        }
    };
    /**
     * @hidden
     */
    SelectAllCheckboxDirective.prototype.setState = function () {
        var state = this.stateSet ? this.stateToBool() : this.selectionService.selectAllState;
        var elem = this.el.nativeElement;
        this.renderer.setProperty(elem, "indeterminate", !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(state));
        this.renderer.setProperty(elem, "checked", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["b" /* isPresent */])(state) ? state : false);
    };
    /**
     * @hidden
     */
    SelectAllCheckboxDirective.prototype.stateToBool = function () {
        switch (this.state) {
            case "checked":
                return true;
            case "unchecked":
                return false;
            default:
                return undefined;
        }
    };
    return SelectAllCheckboxDirective;
}());

SelectAllCheckboxDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridSelectAllCheckbox]'
            },] },
];
/** @nocollapse */
SelectAllCheckboxDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };
SelectAllCheckboxDirective.propDecorators = {
    'state': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"] },],
    'selectAllChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"] },],
    'type': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.type',] },],
};


/***/ }),
/* 606 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectionCheckboxDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__selection_service__ = __webpack_require__(91);
/* tslint:disable:no-input-rename */


/**
 * Represents the row selection checkbox of the Grid.
 * The directive expects the index of the current row as an input parameter. For more information, refer to the example below.
 *
 * Apply the directive to an `input` element inside the
 * [`CheckboxColumnComponent`]({% slug api_grid_checkboxcolumncomponent %}).
 *
 * When the user clicks the checkbox that is associated with the directive,
 * a [`selectionChange`]({% slug api_grid_gridcomponent %}#toc-selectionChange) event is triggered.
 *
 * @example
 * ```ts-no-run
 * <kendo-grid>
 *   <kendo-grid-checkbox-column title="Custom checkbox">
 *     <ng-template kendoGridCellTemplate let-idx="rowIndex">
 *       <input [kendoGridSelectionCheckbox]="idx" />
 *     </ng-template>
 *   </kendo-grid-checkbox-column>
 * </kendo-grid>
 * ```
 */
var SelectionCheckboxDirective = (function () {
    function SelectionCheckboxDirective(selectionService, el, renderer) {
        this.selectionService = selectionService;
        this.el = el;
        this.renderer = renderer;
        this.type = "checkbox";
        this.destroyClick = this.renderer.listen(this.el.nativeElement, "click", this.onClick.bind(this));
    }
    SelectionCheckboxDirective.prototype.ngAfterContentChecked = function () {
        this.setCheckedState();
    };
    SelectionCheckboxDirective.prototype.ngOnDestroy = function () {
        if (this.destroyClick) {
            this.destroyClick();
        }
    };
    /**
     * @hidden
     */
    SelectionCheckboxDirective.prototype.onClick = function () {
        if (this.selectionService.options.enabled) {
            var ev = this.selectionService.toggleByIndex(this.itemIndex);
            ev.ctrlKey = false;
            //Setting the deprecated `index` and `selected` properties
            ev.index = this.itemIndex;
            ev.selected = ev.selectedRows.length > ev.deselectedRows.length;
            this.selectionService.changes.emit(ev);
        }
    };
    /*
     * @hidden
     */
    SelectionCheckboxDirective.prototype.setCheckedState = function () {
        this.renderer.setProperty(this.el.nativeElement, "checked", this.selectionService.isSelected(this.itemIndex));
    };
    return SelectionCheckboxDirective;
}());

SelectionCheckboxDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Directive"], args: [{
                selector: '[kendoGridSelectionCheckbox]'
            },] },
];
/** @nocollapse */
SelectionCheckboxDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__selection_service__["a" /* SelectionService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["ElementRef"], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"], },
]; };
SelectionCheckboxDirective.propDecorators = {
    'itemIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"], args: ["kendoGridSelectionCheckbox",] },],
    'type': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["HostBinding"], args: ['attr.type',] },],
};


/***/ }),
/* 607 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InputsModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__slider_module__ = __webpack_require__(384);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__switch_module__ = __webpack_require__(388);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__numerictextbox_module__ = __webpack_require__(379);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__maskedtextbox_module__ = __webpack_require__(375);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__textbox_module__ = __webpack_require__(391);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__progress_kendo_angular_intl__ = __webpack_require__(12);








/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Inputs components.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Inputs module
 * import { InputsModule } from '@progress/kendo-angular-inputs';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, InputsModule], // import Inputs module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var InputsModule = (function () {
    function InputsModule() {
    }
    return InputsModule;
}());

InputsModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                exports: [__WEBPACK_IMPORTED_MODULE_5__textbox_module__["a" /* TextBoxModule */], __WEBPACK_IMPORTED_MODULE_1__slider_module__["a" /* SliderModule */], __WEBPACK_IMPORTED_MODULE_2__switch_module__["a" /* SwitchModule */], __WEBPACK_IMPORTED_MODULE_3__numerictextbox_module__["a" /* NumericTextBoxModule */], __WEBPACK_IMPORTED_MODULE_4__maskedtextbox_module__["a" /* MaskedTextBoxModule */]],
                imports: [__WEBPACK_IMPORTED_MODULE_6__angular_common__["CommonModule"]],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_7__progress_kendo_angular_intl__["b" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_7__progress_kendo_angular_intl__["c" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
InputsModule.ctorParameters = function () { return []; };


/***/ }),
/* 608 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MaskingService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__parsing_combinators__ = __webpack_require__(609);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__parsing_parsers__ = __webpack_require__(377);



/**
 * @hidden
 */
var MaskingService = (function () {
    function MaskingService() {
        this.rules = {};
        this.prompt = "_";
        this.mask = "";
        this.promptPlaceholder = " ";
        this.includeLiterals = false;
        this.maskTokens = [];
        this.unmaskTokens = [];
        this.rawTokens = [];
        this.validationTokens = [];
    }
    MaskingService.prototype.update = function (_a) {
        var _b = _a.mask, mask = _b === void 0 ? '' : _b, _c = _a.prompt, prompt = _c === void 0 ? '' : _c, _d = _a.promptPlaceholder, promptPlaceholder = _d === void 0 ? ' ' : _d, _e = _a.rules, rules = _e === void 0 ? {} : _e, _f = _a.includeLiterals, includeLiterals = _f === void 0 ? false : _f;
        this.mask = mask;
        this.prompt = prompt;
        this.promptPlaceholder = promptPlaceholder;
        this.rules = rules;
        this.includeLiterals = includeLiterals;
        this.tokenize();
    };
    MaskingService.prototype.validationValue = function (maskedValue) {
        if (maskedValue === void 0) { maskedValue = ''; }
        var value = maskedValue;
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(this.validationTokens)
            .run(maskedValue)
            .fold(function (unmasked) {
            value = unmasked.join('');
        });
        return value;
    };
    MaskingService.prototype.rawValue = function (maskedValue) {
        if (maskedValue === void 0) { maskedValue = ''; }
        var value = maskedValue;
        if (!this.rawTokens.length) {
            return value;
        }
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(this.rawTokens)
            .run(maskedValue)
            .fold(function (unmasked) {
            value = unmasked.join('');
        });
        return value;
    };
    /**
     * @hidden
     */
    MaskingService.prototype.maskRaw = function (rawValue) {
        if (rawValue === void 0) { rawValue = ''; }
        var value = rawValue;
        if (!this.maskTokens.length) {
            return value;
        }
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(this.maskTokens)
            .run(rawValue)
            .fold(function (masked) {
            value = masked.join('');
        });
        return value;
    };
    MaskingService.prototype.maskInput = function (input, control, splitPoint) {
        if (input.length < control.length) {
            return this.maskRemoved(input, control, splitPoint);
        }
        return this.maskInserted(input, control, splitPoint);
    };
    MaskingService.prototype.maskInRange = function (pasted, oldValue, start, end) {
        var value = '';
        var selection = end;
        var beforeChange = oldValue.split('').slice(0, start);
        var afterChange = oldValue.split('').slice(end);
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(this.maskTokens.slice(start, end))
            .run(pasted)
            .fold(function (masked) {
            value = beforeChange
                .concat(masked)
                .concat(afterChange)
                .join('');
        });
        return {
            selection: selection,
            value: value
        };
    };
    MaskingService.prototype.maskRemoved = function (input, control, splitPoint) {
        var _this = this;
        var value = '';
        var selection = splitPoint;
        var unchanged = input.split('').slice(splitPoint);
        var changed = input.split('').slice(0, splitPoint).join('');
        var take = this.maskTokens.length - (input.length - splitPoint);
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(this.maskTokens.slice(0, take))
            .run(changed, control)
            .fold(function (masked) {
            selection = _this.adjustPosition(masked, selection);
            value = masked.concat(unchanged).join('');
        });
        return {
            selection: selection,
            value: value
        };
    };
    MaskingService.prototype.adjustPosition = function (input, selection) {
        var caretChar = input[selection];
        var isLiteral = this.maskTokens[selection].isLiteral(caretChar);
        if (!isLiteral && caretChar !== this.prompt) {
            return selection + 1;
        }
        return selection;
    };
    MaskingService.prototype.maskInserted = function (input, control, splitPoint) {
        var _this = this;
        var value = '';
        var selection = splitPoint;
        var changed = input.slice(0, splitPoint);
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(this.unmaskTokens)
            .run(changed, control)
            .chain(function (unmasked) {
            selection = unmasked.join('').length;
            var unchanged = control.slice(selection);
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["a" /* sequence */])(_this.maskTokens)
                .run(unmasked.join('') + unchanged, control);
        })
            .fold(function (masked) {
            value = masked.join('');
        });
        return {
            selection: selection,
            value: value
        };
    };
    Object.defineProperty(MaskingService.prototype, "maskTokenCreator", {
        get: function () {
            var _a = this, prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder;
            return {
                literal: function (rule) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["a" /* literal */])(rule); },
                mask: function (rule) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["b" /* mask */])({ prompt: prompt, promptPlaceholder: promptPlaceholder })(rule); }
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskingService.prototype, "unmaskTokenCreator", {
        get: function () {
            var _this = this;
            return {
                literal: function (rule) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["c" /* unliteral */])(rule); },
                mask: function (rule) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["d" /* unmask */])(_this.prompt)(rule); }
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskingService.prototype, "rawTokenCreator", {
        get: function () {
            var _a = this, prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder, includeLiterals = _a.includeLiterals;
            return {
                literal: function (_) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["e" /* rawLiteral */])(includeLiterals); },
                mask: function (_) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["f" /* rawMask */])({ prompt: prompt, promptPlaceholder: promptPlaceholder }); }
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MaskingService.prototype, "validationTokenCreator", {
        get: function () {
            var prompt = this.prompt;
            return {
                literal: function (_) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["e" /* rawLiteral */])(false); },
                mask: function (_) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["f" /* rawMask */])({ prompt: prompt, promptPlaceholder: '' }); }
            };
        },
        enumerable: true,
        configurable: true
    });
    MaskingService.prototype.tokenize = function () {
        var _this = this;
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["b" /* greedy */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["g" /* token */])(this.rules, this.maskTokenCreator))
            .run(this.mask)
            .fold(function (tokens, _) {
            _this.maskTokens = tokens;
        });
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["b" /* greedy */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["g" /* token */])(this.rules, this.unmaskTokenCreator))
            .run(this.mask)
            .fold(function (tokens, _) {
            _this.unmaskTokens = tokens;
        });
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["b" /* greedy */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["g" /* token */])(this.rules, this.rawTokenCreator))
            .run(this.mask)
            .fold(function (tokens, _) {
            _this.rawTokens = tokens;
        });
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parsing_combinators__["b" /* greedy */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__parsing_parsers__["g" /* token */])(this.rules, this.validationTokenCreator))
            .run(this.mask)
            .fold(function (tokens, _) {
            _this.validationTokens = tokens;
        });
    };
    return MaskingService;
}());

MaskingService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
MaskingService.ctorParameters = function () { return []; };


/***/ }),
/* 609 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return sequence; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return greedy; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__parsers__ = __webpack_require__(377);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__result__ = __webpack_require__(378);


/**
 * @hidden
 */
var always = function (value) { return new __WEBPACK_IMPORTED_MODULE_0__parsers__["h" /* Parser */](function (stream) { return new __WEBPACK_IMPORTED_MODULE_1__result__["b" /* Result */](value, stream); }); };
/**
 * @hidden
 */
var append = function (p1, p2) { return p1.chain(function (vs) { return p2.map(function (v) { return vs.concat([v]); }); }); };
/**
 * @hidden
 */
var sequence = function (list) { return list.reduce(function (acc, parser) { return append(acc, parser); }, always([])); };
/**
 * @hidden
 */
var greedy = function (parser) { return new __WEBPACK_IMPORTED_MODULE_0__parsers__["h" /* Parser */](function (stream) {
    var result = new __WEBPACK_IMPORTED_MODULE_1__result__["b" /* Result */]([], stream);
    while (!stream.eof()) {
        result = result.concat(parser.run(stream));
    }
    return result;
}); };


/***/ }),
/* 610 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Stream; });
/**
 * @hidden
 */
var Stream = (function () {
    function Stream(input, control) {
        if (input === void 0) { input = []; }
        if (control === void 0) { control = []; }
        this.input = input;
        this.control = control;
        this.inputCursor = 0;
        this.controlCursor = 0;
    }
    Stream.prototype.eof = function () {
        return this.inputCursor >= this.input.length;
    };
    // Get the first value from the input.
    Stream.prototype.next = function () {
        return {
            char: this.input[this.inputCursor++],
            control: this.control[this.controlCursor++]
        };
    };
    Stream.prototype.peek = function () {
        return {
            char: this.input[this.inputCursor],
            control: this.control[this.controlCursor]
        };
    };
    Stream.prototype.eat_input = function () {
        this.inputCursor++;
    };
    Stream.prototype.eat_control = function () {
        this.controlCursor++;
    };
    Stream.prototype.eat = function () {
        this.inputCursor++;
        this.controlCursor++;
    };
    return Stream;
}());



/***/ }),
/* 611 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrowDirection; });
/**
 * @hidden
 */
var ArrowDirection;
(function (ArrowDirection) {
    ArrowDirection[ArrowDirection["Down"] = -1] = "Down";
    ArrowDirection[ArrowDirection["None"] = 0] = "None";
    ArrowDirection[ArrowDirection["Up"] = 1] = "Up";
})(ArrowDirection || (ArrowDirection = {}));


/***/ }),
/* 612 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(382);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoNumericTextBoxLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 613 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numericRegex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return decimalPart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return noop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return defined; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isNumber; });
/* harmony export (immutable) */ __webpack_exports__["e"] = pad;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(380);

/**
 * @hidden
 */
var numericRegex = function (options) {
    var autoCorrect = options.autoCorrect, decimals = options.decimals, min = options.min;
    var separator = options.separator;
    if (separator === __WEBPACK_IMPORTED_MODULE_0__constants__["d" /* POINT */]) {
        separator = '\\' + separator;
    }
    var signPattern = autoCorrect && min !== null && min >= 0 ? '' : '-?';
    var numberPattern;
    if (decimals === 0) {
        numberPattern = '\\d*';
    }
    else {
        numberPattern = "(?:(?:\\d+(" + separator + "\\d*)?)|(?:" + separator + "\\d*))?";
    }
    return new RegExp("^" + signPattern + numberPattern + "$");
};
/**
 * @hidden
 */
var decimalPart = function (value) {
    return value >= 0 ? Math.floor(value) : Math.ceil(value);
};
/**
 * @hidden
 */
var noop = function (_) { }; // tslint:disable-line:no-empty
/**
 * @hidden
 */
// tslint:disable-line:no-empty
var defined = function (value) {
    return typeof value !== 'undefined';
};
/**
 * @hidden
 */
var isNumber = function (value) {
    return !isNaN(value) && value !== null;
};
/**
 * @hidden
 */
function pad(value, digits) {
    var count = digits - String(value).length;
    var result = value;
    if (count > 0) {
        var padString = new Array(count + 1).join("0");
        result = parseFloat(value + padString);
    }
    return result;
}


/***/ }),
/* 614 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SliderCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(385);




/**
 * Custom component messages override default component messages.
 */
var SliderCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](SliderCustomMessagesComponent, _super);
    function SliderCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(SliderCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return SliderCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

SliderCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return SliderCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-slider-messages',
                template: ""
            },] },
];
/** @nocollapse */
SliderCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 615 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(385);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoSliderLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 616 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = decreaseValueToStep;
/* harmony export (immutable) */ __webpack_exports__["b"] = increaseValueToStep;
/* unused harmony export snapValue */
/* harmony export (immutable) */ __webpack_exports__["e"] = eventValue;
/* harmony export (immutable) */ __webpack_exports__["d"] = isButton;
/* harmony export (immutable) */ __webpack_exports__["c"] = isDocumentAvailable;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_math__ = __webpack_require__(372);

function elementOffset(element) {
    var box = element.getBoundingClientRect();
    var documentElement = document.documentElement;
    return {
        top: box.top + (window.pageYOffset || documentElement.scrollTop) - (documentElement.clientTop || 0),
        left: box.left + (window.pageXOffset || documentElement.scrollLeft) - (documentElement.clientLeft || 0)
    };
}
function limitValue(value, min, max) {
    return Math.max(Math.min(value, max), min);
}
/**
 * @hidden
 */
function decreaseValueToStep(value, _a) {
    var max = _a.max, min = _a.min, smallStep = _a.smallStep;
    var stepValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["c" /* subtract */])(value, min);
    var result;
    var stepRemainder = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["d" /* remainder */])(stepValue, smallStep);
    if (stepRemainder === 0) {
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["c" /* subtract */])(stepValue, smallStep);
    }
    else {
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["c" /* subtract */])(stepValue, stepRemainder);
    }
    return limitValue(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["a" /* add */])(result, min), min, max);
}
/**
 * @hidden
 */
function increaseValueToStep(value, _a) {
    var max = _a.max, min = _a.min, smallStep = _a.smallStep;
    var stepValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["c" /* subtract */])(value, min);
    var stepRemainder = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["d" /* remainder */])(stepValue, smallStep);
    var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["a" /* add */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["c" /* subtract */])(stepValue, stepRemainder), smallStep);
    return limitValue(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["a" /* add */])(result, min), min, max);
}
/**
 * @hidden
 */
function snapValue(value, options) {
    var smallStep = options.smallStep, min = options.min;
    var left = decreaseValueToStep(value, options);
    var right = increaseValueToStep(value, options);
    if ((value - min) % smallStep === 0) {
        return value;
    }
    if (right - value <= (right - left) / 2) {
        return right;
    }
    return left;
}
/**
 * @hidden
 */
function eventValue(eventArgs, scaleElement, options) {
    var min = options.min, max = options.max, vertical = options.vertical, rtl = options.rtl;
    var trackOffset = elementOffset(scaleElement);
    var offset = vertical ? eventArgs.pageY - trackOffset.top : eventArgs.pageX - trackOffset.left;
    var scale = (max - min) / (vertical ? scaleElement.clientHeight : scaleElement.clientWidth);
    var offsetValue = offset * scale;
    var value = rtl || vertical ? max - offsetValue : min + offsetValue;
    var stepFractionLength = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["e" /* fractionLength */])(options.smallStep);
    value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_math__["b" /* toFixedPrecision */])(value, stepFractionLength + 1);
    return snapValue(value, options);
}
/**
 * @hidden
 */
function isButton(element) {
    return element.className.indexOf('k-button-increase') >= 0 || element.className.indexOf('k-button-decrease') >= 0;
}
/**
 * @hidden
 */
function isDocumentAvailable() {
    return typeof document !== 'undefined';
}


/***/ }),
/* 617 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SwitchCustomMessagesComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(389);




/**
 * Custom component messages override default component messages.
 */
var SwitchCustomMessagesComponent = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](SwitchCustomMessagesComponent, _super);
    function SwitchCustomMessagesComponent(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    Object.defineProperty(SwitchCustomMessagesComponent.prototype, "override", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    return SwitchCustomMessagesComponent;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

SwitchCustomMessagesComponent.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return SwitchCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: 'kendo-switch-messages',
                template: ""
            },] },
];
/** @nocollapse */
SwitchCustomMessagesComponent.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 618 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizedMessagesDirective; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__messages__ = __webpack_require__(389);




/**
 * @hidden
 */
var LocalizedMessagesDirective = (function (_super) {
    __WEBPACK_IMPORTED_MODULE_0_tslib__["__extends"](LocalizedMessagesDirective, _super);
    function LocalizedMessagesDirective(service) {
        var _this = _super.call(this) || this;
        _this.service = service;
        return _this;
    }
    return LocalizedMessagesDirective;
}(__WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */]));

LocalizedMessagesDirective.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Directive"], args: [{
                providers: [
                    {
                        provide: __WEBPACK_IMPORTED_MODULE_3__messages__["a" /* Messages */],
                        useExisting: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["forwardRef"])(function () { return LocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref
                    }
                ],
                selector: '[kendoSwitchLocalizedMessages]'
            },] },
];
/** @nocollapse */
LocalizedMessagesDirective.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_2__progress_kendo_angular_l10n__["a" /* LocalizationService */], },
]; };


/***/ }),
/* 619 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createMaxValidator; });
/**
 * @hidden
 */
var createMaxValidator = function (maxValue) {
    return function (c) {
        var err = {
            maxError: {
                maxValue: maxValue,
                value: c.value
            }
        };
        return (c.value !== null && c.value > maxValue) ? err : null;
    };
};


/***/ }),
/* 620 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createMinValidator; });
/**
 * @hidden
 */
var createMinValidator = function (minValue) {
    return function (c) {
        var err = {
            minError: {
                minValue: minValue,
                value: c.value
            }
        };
        return (c.value !== null && c.value < minValue) ? err : null;
    };
};


/***/ }),
/* 621 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errorSolutions; });
var DOCS_URL = 'http://www.telerik.com/kendo-angular-ui/components/internationalization/troubleshooting/';
/**
 * @hidden
 */
var errorSolutions = {
    'NoCurrency': "Solution: " + DOCS_URL + "#toc-no-currency",
    'NoCurrencyDisplay': "Solution: " + DOCS_URL + "#toc-no-currency-display",
    'NoCurrencyRegion': "Solution: " + DOCS_URL + "#toc-no-currency-region",
    'NoDateFieldNames': "Solution: " + DOCS_URL + "#toc-no-date-filed-names",
    'NoFirstDay': "Solution: " + DOCS_URL + "#toc-no-first-day",
    'NoGMTInfo': "Solution: " + DOCS_URL + "#toc-no-gmt-info",
    'NoLocale': "Solution: " + DOCS_URL + "#toc-no-locale",
    'NoValidCurrency': "Solution: " + DOCS_URL + "#toc-no-valid-currency",
    'NoWeekData': "Solution: " + DOCS_URL + "#toc-no-week-data"
};


/***/ }),
/* 622 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IntlModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__date_pipe__ = __webpack_require__(394);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__number_pipe__ = __webpack_require__(395);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__intl_service__ = __webpack_require__(127);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__cldr_intl_service__ = __webpack_require__(393);





var pipes = [
    __WEBPACK_IMPORTED_MODULE_1__date_pipe__["a" /* DatePipe */],
    __WEBPACK_IMPORTED_MODULE_2__number_pipe__["a" /* NumberPipe */]
];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Intl services.
 */
var IntlModule = (function () {
    function IntlModule() {
    }
    return IntlModule;
}());

IntlModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [pipes],
                exports: [pipes],
                providers: [
                    { provide: __WEBPACK_IMPORTED_MODULE_3__intl_service__["a" /* IntlService */], useClass: __WEBPACK_IMPORTED_MODULE_4__cldr_intl_service__["a" /* CldrIntlService */] }
                ]
            },] },
];
/** @nocollapse */
IntlModule.ctorParameters = function () { return []; };


/***/ }),
/* 623 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentMessages; });
/**
 * Base class that acts as a component messages container.
 *
 * For internal use.
 * @hidden
 */
var ComponentMessages = (function () {
    function ComponentMessages() {
    }
    Object.defineProperty(ComponentMessages.prototype, "override", {
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    ComponentMessages.prototype.ngOnChanges = function (changes) {
        var _this = this;
        var keys = Object.keys(changes);
        keys.forEach(function (key) { return _this.service.register(key, _this[key], _this.override); });
    };
    return ComponentMessages;
}());



/***/ }),
/* 624 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return L10N_PREFIX; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LocalizationService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__message_service__ = __webpack_require__(396);


/**
 * Localization prefix for the component messages.
 *
 * For internal use.
 * @hidden
 */
var L10N_PREFIX = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]('Localization key prefix');
/**
 * Component localization service.
 *
 * For internal use.
 * @hidden
 */
var LocalizationService = (function () {
    function LocalizationService(prefix, messageService) {
        this.prefix = prefix;
        this.messageService = messageService;
        this.dictionary = {};
    }
    LocalizationService.prototype.get = function (shortKey) {
        var key = this.key(shortKey);
        return this.dictionary[key];
    };
    LocalizationService.prototype.register = function (shortKey, value, override) {
        if (override === void 0) { override = false; }
        var key = this.key(shortKey);
        var message = value;
        if (!override) {
            if (this.dictionary.hasOwnProperty(key)) {
                return;
            }
            message = this.defaultValue(key, value);
        }
        this.dictionary[key] = message;
    };
    LocalizationService.prototype.key = function (shortKey) {
        return this.prefix + '.' + shortKey;
    };
    LocalizationService.prototype.defaultValue = function (key, value) {
        if (!this.messageService) {
            return value;
        }
        var alt = this.messageService.get(key);
        return (alt === undefined) ? value : alt;
    };
    return LocalizationService;
}());

LocalizationService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
LocalizationService.ctorParameters = function () { return [
    { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"], args: [L10N_PREFIX,] },] },
    { type: __WEBPACK_IMPORTED_MODULE_1__message_service__["a" /* MessageService */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Optional"] },] },
]; };


/***/ }),
/* 625 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RTL; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);

/**
 * A token that specifies the text direction of Kendo UI for Angular components.
 *
 * @example
 * {% embed_file rtl/app.module.ts preview %}
 * {% embed_file rtl/app.component.ts %}
 * {% embed_file shared/main.ts hidden %}
 *
 */
var RTL = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["InjectionToken"]("Kendo UI Right-to-Left token");


/***/ }),
/* 626 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export PDFExportModule */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pdf_export_component__ = __webpack_require__(398);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__ = __webpack_require__(206);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pdf_template_directive__ = __webpack_require__(207);




var COMPONENT_DIRECTIVES = [
    __WEBPACK_IMPORTED_MODULE_1__pdf_export_component__["a" /* PDFExportComponent */],
    __WEBPACK_IMPORTED_MODULE_2__pdf_margin_component__["a" /* PDFMarginComponent */],
    __WEBPACK_IMPORTED_MODULE_3__pdf_template_directive__["a" /* PDFTemplateDirective */]
];
/**
 * Represents the [NgModule](https://angular.io/guide/ngmodule) definition for the PDF Export directive.
 */
var PDFExportModule = (function () {
    function PDFExportModule() {
    }
    return PDFExportModule;
}());

PDFExportModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES]
            },] },
];
/** @nocollapse */
PDFExportModule.ctorParameters = function () { return []; };


/***/ }),
/* 627 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopupModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__popup_component__ = __webpack_require__(208);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__popup_service__ = __webpack_require__(399);




var POPUP_DIRECTIVES = [__WEBPACK_IMPORTED_MODULE_2__popup_component__["a" /* PopupComponent */]];
/**
 * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)
 * definition for the Popup component.
 *
 * @example
 *
 * ```ts-no-run
 * // Import the Popup module
 * import { PopupModule } from '@progress/kendo-angular-popup';
 *
 * // The browser platform with a compiler
 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 *
 * import { NgModule } from '@angular/core';
 *
 * // Import the app component
 * import { AppComponent } from './app.component';
 *
 * // Define the app module
 * _@NgModule({
 *     declarations: [AppComponent], // declare app component
 *     imports:      [BrowserModule, PopupModule], // import Popup module
 *     bootstrap:    [AppComponent]
 * })
 * export class AppModule {}
 *
 * // Compile and launch the module
 * platformBrowserDynamic().bootstrapModule(AppModule);
 *
 * ```
 */
var PopupModule = (function () {
    function PopupModule() {
    }
    return PopupModule;
}());

PopupModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [POPUP_DIRECTIVES],
                entryComponents: [POPUP_DIRECTIVES],
                exports: [POPUP_DIRECTIVES],
                imports: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["CommonModule"]],
                providers: [__WEBPACK_IMPORTED_MODULE_3__popup_service__["a" /* PopupService */]]
            },] },
];
/** @nocollapse */
PopupModule.ctorParameters = function () { return []; };


/***/ }),
/* 628 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AlignService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dom_service__ = __webpack_require__(92);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(71);



/**
 * @hidden
 */
var AlignService = (function () {
    function AlignService(_dom) {
        this._dom = _dom;
    }
    AlignService.prototype.alignElement = function (settings) {
        var anchor = settings.anchor, element = settings.element, anchorAlign = settings.anchorAlign, elementAlign = settings.elementAlign, offset = settings.offset, positionMode = settings.positionMode;
        var fixedMode = positionMode === 'fixed' || !this._dom.hasOffsetParent(element);
        var anchorRect = fixedMode ? this.absoluteRect(anchor, element, offset) : this.relativeRect(anchor, element, offset);
        return this._dom.align({
            anchorAlign: anchorAlign,
            anchorRect: anchorRect,
            elementAlign: elementAlign,
            elementRect: this._dom.offset(element)
        });
    };
    AlignService.prototype.absoluteRect = function (anchor, element, offset) {
        return this._dom.removeScroll(this._dom.addScroll(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["j" /* removeStackingOffset */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* eitherRect */])(this._dom.offset(anchor), offset), this._dom.stackingElementOffset(element)), this._dom.stackingElementScroll(element)), this.elementScrollPosition(anchor, element));
    };
    AlignService.prototype.elementScrollPosition = function (anchor, element) {
        return anchor ? { x: 0, y: 0 } : this._dom.scrollPosition(element);
    };
    AlignService.prototype.relativeRect = function (anchor, element, offset) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* eitherRect */])(this._dom.position(anchor, element), offset);
    };
    return AlignService;
}());

AlignService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
AlignService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__dom_service__["a" /* DOMService */], },
]; };


/***/ }),
/* 629 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PositionService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dom_service__ = __webpack_require__(92);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(71);



/**
 * @hidden
 */
var PositionService = (function () {
    function PositionService(_dom) {
        this._dom = _dom;
    }
    PositionService.prototype.positionElement = function (settings) {
        var anchor = settings.anchor, currentLocation = settings.currentLocation, positionMode = settings.positionMode, element = settings.element, anchorAlign = settings.anchorAlign, elementAlign = settings.elementAlign, collisions = settings.collisions;
        var dom = this._dom;
        var viewPort = settings.viewPort || dom.stackingElementViewPort(element) || dom.windowViewPort(element);
        var anchorRect = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* eitherRect */])(dom.offset(anchor), currentLocation);
        var initialElementRect = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["e" /* replaceOffset */])(dom.staticOffset(element), currentLocation);
        var elementRect = this.elementRect(element, initialElementRect, positionMode);
        var result = dom.restrictToView({
            anchorAlign: anchorAlign,
            anchorRect: anchorRect,
            collisions: collisions,
            elementAlign: elementAlign,
            elementRect: elementRect,
            viewPort: viewPort
        });
        return {
            flipped: result.flipped,
            offset: dom.addOffset(initialElementRect, result.offset)
        };
    };
    PositionService.prototype.elementRect = function (element, rect, mode) {
        if (mode === 'fixed') {
            return rect;
        }
        return this._dom.removeScroll(rect, this._dom.scrollPosition(element));
    };
    return PositionService;
}());

PositionService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
PositionService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_1__dom_service__["a" /* DOMService */], },
]; };


/***/ }),
/* 630 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResizeService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_auditTime__ = __webpack_require__(105);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_auditTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_auditTime__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(71);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dom_service__ = __webpack_require__(92);






/**
 * @hidden
 */
var ResizeService = (function () {
    function ResizeService(_dom, _zone) {
        this._dom = _dom;
        this._zone = _zone;
    }
    ResizeService.prototype.subscribe = function (callback) {
        var _this = this;
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["b" /* isDocumentAvailable */])()) {
            return;
        }
        this._zone.runOutsideAngular(function () {
            _this.subscription = __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"]
                .fromEvent(_this._dom.getWindow(), "resize")
                .auditTime(__WEBPACK_IMPORTED_MODULE_4__util__["c" /* FRAME_DURATION */])
                .subscribe(function () { return callback(); });
        });
    };
    ResizeService.prototype.unsubscribe = function () {
        if (!this.subscription) {
            return;
        }
        this.subscription.unsubscribe();
    };
    ResizeService.prototype.isUnsubscribed = function () {
        return this.subscription && this.subscription.closed;
    };
    return ResizeService;
}());

ResizeService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ResizeService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_5__dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 631 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export THRESHOLD_DIFF */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollableService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_fromEvent__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_observable_fromEvent__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_merge__ = __webpack_require__(104);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_observable_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_auditTime__ = __webpack_require__(105);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_auditTime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_auditTime__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dom_service__ = __webpack_require__(92);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(71);







/**
 * @hidden
 */
var THRESHOLD_DIFF = 1;
/**
 * @hidden
 */
var ScrollableService = (function () {
    function ScrollableService(_dom, _zone) {
        this._dom = _dom;
        this._zone = _zone;
    }
    ScrollableService.prototype.forElement = function (element) {
        this.unsubscribe();
        this.element = element;
        return this;
    };
    ScrollableService.prototype.subscribe = function (callback) {
        var _this = this;
        if (!callback || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["b" /* isDocumentAvailable */])() || !this.element) {
            return;
        }
        var nativeElement = this._dom.nativeElement(this.element);
        var parents = this._dom.scrollableParents(this.element);
        this._zone.runOutsideAngular(function () {
            var observables = parents.map(function (p) { return __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].fromEvent(p, "scroll").auditTime(__WEBPACK_IMPORTED_MODULE_6__util__["c" /* FRAME_DURATION */]); });
            var subscriber = function (e) {
                callback(_this.isVisible(nativeElement, e.target));
            };
            _this.subscription = __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"].merge.apply(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"], observables).subscribe(subscriber);
        });
    };
    ScrollableService.prototype.unsubscribe = function () {
        if (!this.subscription) {
            return;
        }
        this.subscription.unsubscribe();
    };
    ScrollableService.prototype.isVisible = function (elem, container) {
        var elemRect = this._dom.boundingOffset(elem);
        var containerRect = this._dom.boundingOffset(container);
        if ((containerRect.top - elemRect.bottom) > THRESHOLD_DIFF) {
            return false;
        }
        if ((containerRect.bottom - elemRect.bottom) < -THRESHOLD_DIFF) {
            return false;
        }
        if ((containerRect.right - elemRect.right) < -THRESHOLD_DIFF) {
            return false;
        }
        if ((containerRect.left - elemRect.left) > THRESHOLD_DIFF) {
            return false;
        }
        return true;
    };
    return ScrollableService;
}());

ScrollableService.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"] },
];
/** @nocollapse */
ScrollableService.ctorParameters = function () { return [
    { type: __WEBPACK_IMPORTED_MODULE_5__dom_service__["a" /* DOMService */], },
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"], },
]; };


/***/ }),
/* 632 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResizeSensorModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__resize_sensor_component__ = __webpack_require__(400);


var COMPONENT_DIRECTIVES = [__WEBPACK_IMPORTED_MODULE_1__resize_sensor_component__["a" /* ResizeSensorComponent */]];
/**
 * Resize Sensor module
 */
var ResizeSensorModule = (function () {
    function ResizeSensorModule() {
    }
    return ResizeSensorModule;
}());

ResizeSensorModule.decorators = [
    { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"], args: [{
                declarations: [COMPONENT_DIRECTIVES],
                exports: [COMPONENT_DIRECTIVES]
            },] },
];
/** @nocollapse */
ResizeSensorModule.ctorParameters = function () { return []; };


/***/ }),
/* 633 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export orderBy */
/* unused harmony export distinct */
/* unused harmony export count */
/* unused harmony export limit */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return process; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sorting_sort_array_operator__ = __webpack_require__(403);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__grouping_group_operators__ = __webpack_require__(211);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__filtering_filter_operators__ = __webpack_require__(210);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__filtering_filter_expression_factory__ = __webpack_require__(209);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__transducers__ = __webpack_require__(212);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__accessor__ = __webpack_require__(73);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__funcs__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__sorting_sort__ = __webpack_require__(639);









/**
 * Orders the specified array according to the provided sort descriptors.
 *
 * @param {T[]} data - The data to be sorted.
 * @param {SortDescriptor[]} descriptors - The descriptors by which the data will be sorted.
 * @returns {T[]} - The sorted data.
 *
 * @example
 * ```ts-no-run
 * import { orderBy } from '@progress/kendo-data-query';
 *
 * const data = [
 *     { name: "Pork", category: "Food", subcategory: "Meat" },
 *     { name: "Pepper", category: "Food", subcategory: "Vegetables" },
 *     { name: "Beef", category: "Food", subcategory: "Meat" }
 * ];
 *
 * const result = orderBy(data, [{ field: "name", dir: "asc" }]);
 * ```
 */
var orderBy = function (data, descriptors) {
    if (descriptors.some(function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(x.dir); })) {
        data = data.slice(0);
        var comparer = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__sorting_sort_array_operator__["a" /* composeSortDescriptors */])(descriptors);
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__sorting_sort__["a" /* sort */])(data, 0, data.length, comparer);
    }
    return data;
};
var defaultComparer = function (a, b) { return a === b; };
var normalizeComparer = function (comparer) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["d" /* isString */])(comparer)) {
        var accessor_1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__accessor__["a" /* getter */])(comparer);
        comparer = function (a, b) { return accessor_1(a) === accessor_1(b); };
    }
    return comparer;
};
var _distinct = function (data, comparer) {
    return data.filter(function (x, idx, xs) { return xs.findIndex(comparer.bind(null, x)) === idx; });
};
/**
 * Reduces the provided array so it contains only unique values.
 *
 * @param {T[]} data - The array that will be reduced.
 * @param {(Comparer | string)} comparer - An optional custom comparer function or the field name that will be used for comparison.
 * @returns {T[]} - The reduced data.
 *
 * @example
 * ```ts-no-run
 * import { distinct } from '@progress/kendo-data-query';
 *
 * const data = [
 *     { name: "Pork", category: "Food", subcategory: "Meat" },
 *     { name: "Pepper", category: "Food", subcategory: "Vegetables" },
 *     { name: "Beef", category: "Food", subcategory: "Meat" }
 * ];
 *
 * const result = distinct(data, "subcategory");
 *
 * // output:
 * // result => [
 * //     { name: "Pork", category: "Food", subcategory: "Meat" },
 * //     { name: "Pepper", category: "Food", subcategory: "Vegetables" }
 * // ];
 * ```
 */
var distinct = function (data, comparer) {
    if (comparer === void 0) { comparer = defaultComparer; }
    return _distinct(data, normalizeComparer(comparer));
};
/**
 * @hidden
 */
var count = function (data, predicate) {
    var counter = 0;
    for (var idx = 0, length_1 = data.length; idx < length_1; idx++) {
        if (predicate(data[idx])) {
            counter++;
        }
    }
    return counter;
};
/**
 * @hidden
 */
var limit = function (data, predicate) {
    if (predicate) {
        return data.filter(predicate);
    }
    return data;
};
/**
 * Applies the specified operation descriptors to the data.
 *
 * @param {T[]} data - The data to be processed.
 * @param {State} state - The operation descriptors that will be applied to the data.
 * @returns {DataResult} - The processed data.
 *
 * @example
 * ``` ts-no-run
 *
 * const result = process(data, {
 *     skip: 10,
 *     take: 20,
 *     group: [{
 *       field: 'category.categoryName',
 *             aggregates: [
 *                   { aggregate: "sum", field: "unitPrice" },
 *                   { aggregate: "sum", field: "unitsInStock" }
 *             ]
 *       }],
 *     sort: [{ field: 'productName', dir: 'desc' }],
 *     filter: {
 *         logic: "or",
 *         filters: [
 *           { field: "discontinued", operator: "eq", value: true },
 *           { field: "unitPrice", operator: "lt", value: 22 }
 *         ]
 *     }
 * });
 *
 * ```
 */
var process = function (data, state) {
    var skipCount = state.skip, takeCount = state.take, filterDescriptor = state.filter, sort = state.sort, group = state.group;
    var sortDescriptors = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__grouping_group_operators__["a" /* normalizeGroups */])(group || []).concat(sort || []);
    if (sortDescriptors.length) {
        data = orderBy(data, sortDescriptors);
    }
    var hasFilters = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(filterDescriptor) && __WEBPACK_IMPORTED_MODULE_5__transducers__["f" /* filter */].length;
    var hasGroups = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(group) && group.length;
    if (!hasFilters && !hasGroups) {
        return {
            data: takeCount ? data.slice(skipCount, skipCount + takeCount) : data,
            total: data.length
        };
    }
    var total;
    var transformers = [];
    var predicate;
    if (hasFilters) {
        predicate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__filtering_filter_expression_factory__["b" /* compileFilter */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__filtering_filter_operators__["a" /* normalizeFilters */])(filterDescriptor));
        total = count(data, predicate);
        transformers.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__transducers__["f" /* filter */])(predicate));
    }
    else {
        total = data.length;
    }
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(skipCount) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(takeCount)) {
        transformers.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__transducers__["g" /* skip */])(skipCount));
        transformers.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__transducers__["h" /* take */])(takeCount));
    }
    if (transformers.length) {
        var transform = __WEBPACK_IMPORTED_MODULE_7__funcs__["a" /* compose */].apply(void 0, transformers);
        var result = hasGroups ?
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__grouping_group_operators__["b" /* groupBy */])(data, group, transform, limit(data, predicate)) :
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__transducers__["b" /* exec */])(transform(__WEBPACK_IMPORTED_MODULE_5__transducers__["i" /* concat */]), [], data);
        return { data: result, total: total };
    }
    return {
        data: hasGroups ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__grouping_group_operators__["b" /* groupBy */])(data, group) : data,
        total: total
    };
};


/***/ }),
/* 634 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return transformCompositeFilter; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_descriptor_interface__ = __webpack_require__(74);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__accessor__ = __webpack_require__(73);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(24);



var logic = {
    "or": {
        concat: function (acc, fn) { return function (a) { return acc(a) || fn(a); }; },
        identity: function () { return false; }
    },
    "and": {
        concat: function (acc, fn) { return function (a) { return acc(a) && fn(a); }; },
        identity: function () { return true; }
    }
};
var operatorsMap = {
    contains: function (a, b) { return (a || "").indexOf(b) >= 0; },
    doesnotcontain: function (a, b) { return (a || "").indexOf(b) === -1; },
    doesnotendwith: function (a, b) { return (a || "").indexOf(b, (a || "").length - (b || "").length) < 0; },
    doesnotstartwith: function (a, b) { return (a || "").lastIndexOf(b, 0) === -1; },
    endswith: function (a, b) { return (a || "").indexOf(b, (a || "").length - (b || "").length) >= 0; },
    eq: function (a, b) { return a === b; },
    gt: function (a, b) { return a > b; },
    gte: function (a, b) { return a >= b; },
    isempty: function (a) { return a === ''; },
    isnotempty: function (a) { return a !== ''; },
    isnotnull: function (a) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["a" /* isPresent */])(a); },
    isnull: function (a) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["f" /* isBlank */])(a); },
    lt: function (a, b) { return a < b; },
    lte: function (a, b) { return a <= b; },
    neq: function (a, b) { return a != b; },
    startswith: function (a, b) { return (a || "").lastIndexOf(b, 0) === 0; }
};
var dateRegExp = /^\/Date\((.*?)\)\/$/;
var convertValue = function (value, ignoreCase) {
    if (value != null && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["d" /* isString */])(value)) {
        var date = dateRegExp.exec(value);
        if (date) {
            return new Date(+date[1]).getTime();
        }
        else if (ignoreCase) {
            return value.toLowerCase();
        }
    }
    else if (value != null && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["c" /* isDate */])(value)) {
        return value.getTime();
    }
    return value;
};
var typedGetter = function (prop, value, ignoreCase) {
    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["a" /* isPresent */])(value)) {
        return prop;
    }
    var acc = prop;
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["d" /* isString */])(value)) {
        var date = dateRegExp.exec(value);
        if (date) {
            value = new Date(+date[1]);
        }
        else if (ignoreCase) {
            acc = function (a) {
                var x = prop(a);
                return typeof x === 'string' ? x.toLowerCase() : x;
            };
        }
    }
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["c" /* isDate */])(value)) {
        return function (a) {
            var x = acc(a);
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["c" /* isDate */])(x) ? x.getTime() : x;
        };
    }
    return acc;
};
var transformFilter = function (_a) {
    var field = _a.field, ignoreCase = _a.ignoreCase, value = _a.value, operator = _a.operator;
    field = !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["a" /* isPresent */])(field) ? function (a) { return a; } : field;
    ignoreCase = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["a" /* isPresent */])(ignoreCase) ? ignoreCase : true;
    var itemProp = typedGetter(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["g" /* isFunction */])(field) ? field : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__accessor__["a" /* getter */])(field, true), value, ignoreCase);
    value = convertValue(value, ignoreCase);
    var op = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils__["g" /* isFunction */])(operator) ? operator : operatorsMap[operator];
    return function (a) { return op(itemProp(a), value, ignoreCase); };
};
/**
 * @hidden
 */
var transformCompositeFilter = function (filter) {
    var combiner = logic[filter.logic];
    return filter.filters
        .filter(__WEBPACK_IMPORTED_MODULE_2__utils__["a" /* isPresent */])
        .map(function (x) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */])(x) ? transformCompositeFilter(x) : transformFilter(x); })
        .reduce(combiner.concat, combiner.identity);
};


/***/ }),
/* 635 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export translateDataSourceResultGroups */
/* unused harmony export translateAggregateResults */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__funcs__ = __webpack_require__(93);


var set = function (field, target, value) {
    target[field] = value;
    return target;
};
var convert = function (mapper) { return function (values) { return Object.keys(values).reduce(mapper.bind(null, values), {}); }; };
var translateAggregate = convert(function (source, acc, field) { return set(field.toLowerCase(), acc, source[field]); });
var translateAggregates = convert(function (source, acc, field) { return set(field, acc, translateAggregate(source[field])); });
var valueOrDefault = function (value, defaultValue) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(value) ? value : defaultValue; };
var normalizeGroup = function (group) { return ({
    aggregates: group.Aggregates || group.aggregates,
    field: group.Member || group.member || group.field,
    hasSubgroups: group.HasSubgroups || group.hasSubgroups || false,
    items: group.Items || group.items,
    value: valueOrDefault(group.Key, valueOrDefault(group.key, group.value))
}); };
var translateGroup = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["a" /* compose */])(function (_a) {
    var field = _a.field, hasSubgroups = _a.hasSubgroups, value = _a.value, aggregates = _a.aggregates, items = _a.items;
    return ({
        aggregates: translateAggregates(aggregates),
        field: field,
        items: hasSubgroups ? items.map(translateGroup) : items,
        value: value
    });
}, normalizeGroup);
/**
 * Converts the grouped result, which is returned into the `Data` field
 * of the UI for ASP.NET MVC `ToDataSourceResult` method, to a comparable format.
 * @param data - The value of the `Data` field of the response.
 * @returns {GroupResult[]} - The converted result.
 */
var translateDataSourceResultGroups = function (data) { return data.map(translateGroup); };
/**
 * Converts the `AggregateResults` field content, which is returned by the
 * UI for ASP.NET MVC `ToDataSourceResult` method, to a comparable format.
 * @param data - The value of the `AggregateResults` field of the response.
 * @returns {AggregateResult} - The converted result.
 */
var translateAggregateResults = function (data) { return ((data || []).reduce(function (acc, x) { return set(x.Member, acc, set(x.AggregateMethodName.toLowerCase(), acc[x.Member] || {}, x.Value)); }, {})); };


/***/ }),
/* 636 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export toDataSourceRequestString */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filtering_filter_descriptor_interface__ = __webpack_require__(74);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__accessor__ = __webpack_require__(73);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__funcs__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__filter_serialization_common__ = __webpack_require__(401);





var prefixWith = function (key) { return function (value) { return key + "=" + value; }; };
var empty = function () { return ""; };
var isNotEmptyArray = function (value) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* isPresent */])(value) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["e" /* isArray */])(value) && value.length > 0; };
var has = function (accessor) { return function (value) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* isPresent */])(accessor(value)); }; };
var isNotEmpty = function (accessor) { return function (value) { return isNotEmptyArray(accessor(value)); }; };
var runOrEmpty = function (predicate, fn) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["b" /* either */])(predicate, fn, empty); };
var calcPage = function (_a) {
    var skip = _a.skip, take = _a.take;
    return Math.floor((skip || 0) / take) + 1;
};
var formatDescriptors = function (accessor, formatter) { return function (state) { return (accessor(state).map(formatter).join("~")); }; };
var removeAfter = function (what) { return function (str) { return str.slice(0, str.indexOf(what)); }; };
var replace = function (patterns) {
    return __WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */].apply(void 0, patterns.map(function (_a) {
        var left = _a[0], right = _a[1];
        return function (s) { return s.replace(new RegExp(left, "g"), right); };
    }));
};
var sanitizeDateLiterals = replace([["\"", ""], [":", "-"]]);
var removeAfterDot = removeAfter(".");
var directionFormatter = function (_a) {
    var field = _a.field, _b = _a.dir, dir = _b === void 0 ? "asc" : _b;
    return field + "-" + dir;
};
var aggregateFormatter = function (_a) {
    var field = _a.field, aggregate = _a.aggregate;
    return field + "-" + aggregate;
};
var take = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__accessor__["a" /* getter */])("take");
var aggregates = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__accessor__["a" /* getter */])("aggregates");
var skip = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__accessor__["a" /* getter */])("skip");
var group = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__accessor__["a" /* getter */])("group");
var sort = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__accessor__["a" /* getter */])("sort", true);
var formatSort = formatDescriptors(sort, directionFormatter);
var formatGroup = formatDescriptors(group, directionFormatter);
var formatAggregates = formatDescriptors(aggregates, aggregateFormatter);
var prefixDateValue = function (value) { return "datetime'" + value + "'"; };
var formatDateValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(prefixDateValue, removeAfterDot, sanitizeDateLiterals, JSON.stringify, __WEBPACK_IMPORTED_MODULE_4__filter_serialization_common__["a" /* toUTC */]);
var formatDate = function (_a) {
    var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;
    return ({
        value: formatDateValue(value),
        field: field,
        ignoreCase: ignoreCase,
        operator: operator
    });
};
var normalizeSort = function (state) { return Object.assign({}, state, {
    sort: (sort(state) || []).filter(function (_a) {
        var dir = _a.dir;
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNotNullOrEmptyString */])(dir);
    })
}); };
var transformSkip = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(prefixWith('page'), calcPage);
var transformTake = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(prefixWith('pageSize'), take);
var transformGroup = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(prefixWith('group'), formatGroup);
var transformSort = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(prefixWith('sort'), formatSort);
var transformAggregates = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(prefixWith('aggregate'), formatAggregates);
var serializePage = runOrEmpty(has(skip), transformSkip);
var serializePageSize = runOrEmpty(has(take), transformTake);
var serializeGroup = runOrEmpty(isNotEmpty(group), transformGroup);
var serializeAggregates = runOrEmpty(has(aggregates), transformAggregates);
var serializeSort = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(runOrEmpty(isNotEmpty(sort), transformSort), normalizeSort);
var hasField = function (_a) {
    var field = _a.field;
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNotNullOrEmptyString */])(field);
};
var filterFormatter = function (_a) {
    var field = _a.field, operator = _a.operator, value = _a.value;
    return field + "~" + operator + "~" + value;
};
var dateFormatter = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_4__filter_serialization_common__["b" /* isDateValue */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(filterFormatter, formatDate), filterFormatter);
var typedFormatter = runOrEmpty(hasField, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_4__filter_serialization_common__["c" /* isStringValue */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["a" /* compose */])(filterFormatter, __WEBPACK_IMPORTED_MODULE_4__filter_serialization_common__["d" /* quote */]), dateFormatter));
var join = function (_a) {
    var logic = _a.logic;
    return "~" + logic + "~";
};
var serialize = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__filter_serialization_common__["e" /* serializeFilters */])(function (filter) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_0__filtering_filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */], serialize, typedFormatter)(filter); }, join);
var serializeFilter = function (_a) {
    var filter = _a.filter;
    if (filter && filter.filters) {
        var filters = serialize(filter);
        if (filters.length) {
            return "filter=" + filters;
        }
    }
    return "";
};
var rules = function (state) { return function (key) { return ({
    "aggregates": serializeAggregates(state),
    "filter": serializeFilter(state),
    "group": serializeGroup(state),
    "skip": serializePage(state),
    "sort": serializeSort(state),
    "take": serializePageSize(state)
}[key]); }; };
/**
 * Converts a [`DataSourceRequestState`]({% slug api_kendo-data-query_datasourcerequeststate %}) into a string
 * that is comparable with the `DataSourceRequest` format in UI for ASP.NET MVC.
 *
 * @param {DataRequestState} state - The state that will be serialized.
 * @returns {string} - The serialized state.
 * @example
 * ```ts-no-run
 *  import {
 *      toDataSourceRequestString,
 *      translateDataSourceResultGroups,
 *      translateAggregateResults
 * } from '@progress/kendo-data-query';
 *
 * export class Service {
 *  private BASE_URL: string = '...';
 *
 *  constructor(private http: Http) { }
 *
 *  // Omitted for brevity...
 *
 *  private fetch(state: DataSourceRequestState): Observable<DataResult> {
 *   const queryStr = `${toDataSourceRequestString(state)}`; //serialize the state
 *   const hasGroups = state.group && state.group.length;
 *
 *   return this.http
 *       .get(`${this.BASE_URL}?${queryStr}`) //send the state to the server
 *       .map(response => response.json())
 *       .map(({Data, Total, AggregateResults}) => // process the response
 *           (<GridDataResult>{
 *               //if there are groups convert them to compatible format
 *               data: hasGroups ? translateDataSourceResultGroups(Data) : Data,
 *               total: Total,
 *               // convert the aggregates if such exists
 *               aggregateResult: translateAggregateResults(AggregateResults)
 *           })
 *       );
 *  }
 * }
 * ```
 */
var toDataSourceRequestString = function (state) { return (Object.keys(state)
    .map(rules(state))
    .filter(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isNotNullOrEmptyString */])
    .join('&')); };


/***/ }),
/* 637 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return serializeFilter; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filtering_filter_descriptor_interface__ = __webpack_require__(74);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__funcs__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__ = __webpack_require__(401);



var fnFormatter = function (operator) { return function (_a) {
    var field = _a.field, value = _a.value;
    return operator + "(" + field + "," + value + ")";
}; };
var singleOperatorFormatter = function (operator) { return function (_a) {
    var field = _a.field, value = _a.value;
    return field + " " + operator + " " + value;
}; };
var stringFormat = function (formatter) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["a" /* compose */])(formatter, __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["d" /* quote */], __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["f" /* toLower */], __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["g" /* normalizeField */]); };
var stringFnOperator = function (operator) { return stringFormat(fnFormatter(operator)); };
var stringOperator = function (operator) { return stringFormat(singleOperatorFormatter(operator)); };
var numericOperator = function (operator) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["a" /* compose */])(singleOperatorFormatter(operator), __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["g" /* normalizeField */]); };
var dateOperator = function (operator) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["a" /* compose */])(singleOperatorFormatter(operator), __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["g" /* normalizeField */], __WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["h" /* formatDate */]); };
var ifDate = function (operator) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["b" /* isDateValue */], dateOperator(operator), numericOperator(operator)); };
var typedOperator = function (operator) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["c" /* isStringValue */], stringOperator(operator), ifDate(operator)); };
var appendEqual = function (str) { return str + " eq -1"; };
var filterOperators = {
    contains: stringFnOperator("contains"),
    doesnotcontain: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["a" /* compose */])(appendEqual, stringFnOperator("indexof")),
    endswith: stringFnOperator("endswith"),
    eq: typedOperator("eq"),
    gt: typedOperator("gt"),
    gte: typedOperator("ge"),
    isempty: function (_a) {
        var field = _a.field;
        return field + " eq ''";
    },
    isnotempty: function (_a) {
        var field = _a.field;
        return field + " ne ''";
    },
    isnotnull: function (_a) {
        var field = _a.field;
        return field + " ne null";
    },
    isnull: function (_a) {
        var field = _a.field;
        return field + " eq null";
    },
    lt: typedOperator("lt"),
    lte: typedOperator("le"),
    neq: typedOperator("ne"),
    startswith: stringFnOperator("startswith")
};
var join = function (x) { return " " + x.logic + " "; };
var serialize = function (x) { return filterOperators[x.operator](x); };
var serializeAll = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__filter_serialization_common__["e" /* serializeFilters */])(function (filter) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_0__filtering_filter_descriptor_interface__["a" /* isCompositeFilterDescriptor */], serializeAll, serialize)(filter); }, join);
/**
 * @hidden
 */
var serializeFilter = function (filter) {
    if (filter.filters && filter.filters.length) {
        return "$filter=" + serializeAll(filter);
    }
    return "";
};


/***/ }),
/* 638 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export toODataString */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(24);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__odata_filtering_operators__ = __webpack_require__(637);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__funcs__ = __webpack_require__(93);



var serializeSort = function (orderby) {
    var str = orderby
        .filter(function (sort) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */])(sort.dir); })
        .map(function (sort) {
        var order = sort.field.replace(/\./g, "/");
        return sort.dir === "desc" ? order + " desc" : order;
    }).join(",");
    return str ? "$orderby=" + str : str;
};
var emptyString = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__funcs__["c" /* constant */])('');
var concat = function (a) { return function (b) { return a + b; }; };
var serializeKey = function (strings, val) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__funcs__["b" /* either */])(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* isPresent */], concat(strings[0]), emptyString)(val); };
var rules = function (key, state) {
    return ({
        "filter": __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__odata_filtering_operators__["a" /* serializeFilter */])(state.filter || {}),
        "skip": (_a = ["$skip=", ""], _a.raw = ["$skip=", ""], serializeKey(_a, state.skip)),
        "sort": serializeSort(state.sort || []),
        "take": (_b = ["$top=", ""], _b.raw = ["$top=", ""], serializeKey(_b, state.take))
    }[key]);
    var _a, _b;
};
/**
 * Converts a [`State`]({% slug api_kendo-data-query_state %}) into an OData v4 compatible string.
 *
 * @param {State} state - The state that will be serialized.
 * @returns {string} - The serialized state.
 */
var toODataString = function (state) { return (Object.keys(state)
    .map(function (x) { return rules(x, state); })
    .filter(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* isNotNullOrEmptyString */])
    .join('&')); };


/***/ }),
/* 639 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return sort; });
var merge = function (data, left, middle, right, compare) {
    var leftLength = middle - left;
    var rightLength = right - middle;
    var temp = [];
    for (var idx = 0; idx < leftLength; idx++) {
        temp.push(data[left + idx]);
    }
    var cursor1 = 0;
    var cursor2 = middle;
    var dest = left;
    do {
        if (compare(data[cursor2], temp[cursor1]) < 0) {
            data[dest++] = data[cursor2++];
            rightLength--;
        }
        else {
            data[dest++] = temp[cursor1++];
            leftLength--;
        }
    } while (rightLength > 0 && leftLength > 0);
    while (leftLength) {
        data[dest++] = temp[cursor1++];
        leftLength--;
    }
    while (rightLength) {
        data[dest++] = data[cursor2++];
        rightLength--;
    }
};
/**
 * @hidden
 */
var sort = function (data, start, end, compare) {
    if (end - start < 2) {
        return;
    }
    var mid = (start + end) >>> 1; // tslint:disable-line:no-bitwise
    sort(data, start, mid, compare);
    sort(data, mid, end, compare);
    merge(data, start, mid, end, compare);
};


/***/ }),
/* 640 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addCenturies; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_years__ = __webpack_require__(214);

/**
 * A function that adds and subtracts centuries from a `Date` object.
 *
 * @param date - The initial date value.
 * @param offset - The number of centuries to add or subtract from the date.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * addCenturies(new Date(2016, 5, 1), 5); // 2516-6-1
 * addCenturies(new Date(2016, 5, 1), -5); // 1516-6-1
 * ```
 */
var addCenturies = function (value, offset) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__add_years__["a" /* addYears */])(value, 100 * offset);
};


/***/ }),
/* 641 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addDecades; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_years__ = __webpack_require__(214);

/**
 * A function that adds and subtracts decades from a `Date` object.
 *
 * @param date - The initial date value.
 * @param offset - The number of decades to add or subtract from the date.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * addDecades(new Date(2016, 5, 1), 5); // 2066-6-1
 * addDecades(new Date(2016, 5, 1), -5); // 1966-6-1
 * ```
 */
var addDecades = function (value, offset) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__add_years__["a" /* addYears */])(value, 10 * offset);
};


/***/ }),
/* 642 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addWeeks; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_days__ = __webpack_require__(128);

/**
 * A function that adds and subtracts weeks from a Date object.
 *
 * @param date - The initial date value.
 * @param offset - The number of weeks to add/subtract from the date.
 * @returns - A new `Date` instance.
 *
 * @example
 * ```ts-no-run
 * addWeeks(new Date(2016, 5, 1), 3); // 2016-6-22
 * addWeeks(new Date(2016, 5, 1), -3); // 2015-5-11
 * ```
 */
var addWeeks = function (date, offset) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__add_days__["a" /* addDays */])(date, offset * 7);
};


/***/ }),
/* 643 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return durationInCenturies; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__first_decade_of_century__ = __webpack_require__(404);

/**
 * A function that calculates duration in centuries between two `Date` objects.
 *
 * @param start - The start date value.
 * @param end - The end date value.
 * @returns - The duration in months.
 *
 * @example
 * ```ts-no-run
 * durationInCenturies(new Date(2016, 0, 1), new Date(3216, 0, 1)); // 12
 * durationInCenturies(new Date(2016, 6, 1), new Date(2617, 0, 1)); // 6
 * durationInCenturies(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0
 * ```
 */
var durationInCenturies = function (start, end) { return ((__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__first_decade_of_century__["a" /* firstDecadeOfCentury */])(end).getFullYear() - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__first_decade_of_century__["a" /* firstDecadeOfCentury */])(start).getFullYear()) / 100); };


/***/ }),
/* 644 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return durationInDecades; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__first_year_of_decade__ = __webpack_require__(405);

/**
 * A function that calculates duration in decades between two `Date` objects.
 *
 * @param start - The start date value.
 * @param end - The end date value.
 * @returns - The duration in months.
 *
 * @example
 * ```ts-no-run
 * durationInDecades(new Date(2016, 0, 1), new Date(2136, 0, 1)); // 12
 * durationInDecades(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0
 * ```
 */
var durationInDecades = function (start, end) { return ((__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__first_year_of_decade__["a" /* firstYearOfDecade */])(end).getFullYear() - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__first_year_of_decade__["a" /* firstYearOfDecade */])(start).getFullYear()) / 10); };


/***/ }),
/* 645 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return durationInMonths; });
/**
 * A function that calculates duration in months between two `Date` objects.
 *
 * @param start - The start date value.
 * @param end - The end date value.
 * @returns - The duration in months.
 *
 * @example
 * ```ts-no-run
 * durationInMonths(new Date(2016, 0, 1), new Date(2017, 0, 1)); // 12
 * durationInMonths(new Date(2016, 6, 1), new Date(2017, 0, 1)); // 6
 * durationInMonths(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0
 * ```
 */
var durationInMonths = function (start, end) { return (((end.getFullYear() - start.getFullYear())) * 12 + (end.getMonth() - start.getMonth())); };


/***/ }),
/* 646 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return durationInYears; });
/**
 * A function that calculates duration in years between two `Date` objects.
 *
 * @param start - The start date value.
 * @param end - The end date value.
 * @returns - The duration in years.
 *
 * @example
 * ```ts-no-run
 * durationInYears(new Date(2016, 0, 1), new Date(2028, 0, 1)); // 12
 * durationInYears(new Date(2016, 0, 1), new Date(2022, 0, 1)); // 6
 * durationInYears(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0
 * ```
 */
var durationInYears = function (start, end) { return (end.getFullYear() - start.getFullYear()); };


/***/ }),
/* 647 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export firstDayInWeek */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__clone_date__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__day_enum__ = __webpack_require__(216);


/**
 *  A function which returns the first date of the current week.
 *
 * @param date - The initial date.
 * @param weekStartDay [default: Day.Sunday] - The first day of the week.
 * @returns - The first date of the current week.
 *
 * @example
 * ```ts-no-run
 * firstDayInWeek(new Date(2016, 0, 15)); // 2016-01-10
 * firstDayInWeek(new Date(2016, 0, 15), Day.Monday); // 2016-01-11
 * ```
 */
var firstDayInWeek = function (date, weekStartDay) {
    if (weekStartDay === void 0) { weekStartDay = __WEBPACK_IMPORTED_MODULE_1__day_enum__["a" /* Day */].Sunday; }
    var first = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__clone_date__["a" /* cloneDate */])(date);
    while (first.getDay() !== weekStartDay) {
        first.setDate(first.getDate() - 1);
    }
    return first;
};


/***/ }),
/* 648 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return firstDayOfMonth; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create_date__ = __webpack_require__(51);

/**
 * A function which returns the first date of the month.
 *
 * @param date - The initial date.
 * @returns - The first date of the initial date month.
 *
 * @example
 * ```ts-no-run
 * firstDayOfMonth(new Date(2016, 0, 15)); // 2016-01-01
 * ```
 */
var firstDayOfMonth = function (date) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__create_date__["a" /* createDate */])(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
};


/***/ }),
/* 649 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return firstMonthOfYear; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__set_month__ = __webpack_require__(410);

/**
 * A function that returns a `Date` object of the first month in a year.
 *
 * @param date - The start date value.
 * @returns - The first month in a year.
 *
 * @example
 * ```ts-no-run
 * firstMonthOfYear(new Date(2017, 11, 1)); // 2017-1-1
 * firstMonthOfYear(new Date(2017, 0, 1)); // 2017-1-1
 * ```
 */
var firstMonthOfYear = function (value) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__set_month__["a" /* setMonth */])(value, 0); };


/***/ }),
/* 650 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export isEqualDate */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__get_date__ = __webpack_require__(406);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_equal__ = __webpack_require__(407);


/**
 * A function that compares the date portions of 2 dates.
 *
 * @param candidate - The candidate date.
 * @param expected - The expected date.
 * @returns - A Boolean value whether the values are equal.
 *
 * @example
 * ```ts-no-run
 * isEqualDate(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // true
 * isEqualDate(new Date(2016, 0, 1, 10), new Date(2016, 0, 2, 10)); // false
 * ```
 */
var isEqualDate = function (candidate, expected) {
    if (!candidate && !expected) {
        return true;
    }
    return candidate && expected && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__is_equal__["a" /* isEqual */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_date__["a" /* getDate */])(candidate), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_date__["a" /* getDate */])(expected));
};


/***/ }),
/* 651 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return lastDecadeOfCentury; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__normalize_year__ = __webpack_require__(131);

/**
 * A function that returns a `Date` object of the last decade in a century.
 *
 * @param date - The start date value.
 * @returns - The last year in a decade.
 *
 * @example
 * ```ts-no-run
 * lastDecadeOfCentury(new Date(2017, 0, 1)); // 2090-1-1
 * lastDecadeOfCentury(new Date(2007, 10, 22)); // 2090-11-22
 * lastDecadeOfCentury(new Date(2126, 0, 1)); // 2190-1-1
 * ```
 */
var lastDecadeOfCentury = function (value) { return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__normalize_year__["a" /* normalizeYear */])(value, function (y) { return y - (y % 100) + 90; })); };


/***/ }),
/* 652 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return lastMonthOfYear; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__set_month__ = __webpack_require__(410);

/**
 * A function that returns a `Date` object of the last month in a year.
 *
 * @param date - The start date value.
 * @returns - The last month in a year.
 *
 * @example
 * ```ts-no-run
 * lastMonthOfYear(new Date(2017, 5, 3)); // 2017-12-3
 * lastMonthOfYear(new Date(2017, 11, 3)); // 2017-12-3
 * ```
 */
var lastMonthOfYear = function (value) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__set_month__["a" /* setMonth */])(value, 11); };


/***/ }),
/* 653 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return lastYearOfDecade; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__normalize_year__ = __webpack_require__(131);

/**
 * A function that returns a `Date` object of the last year in a decade.
 *
 * @param date - The start date value.
 * @returns - The last year in a decade.
 *
 * @example
 * ```ts-no-run
 * lastYearOfDecade(new Date(2017, 0, 1)); // 2019-1-1
 * lastYearOfDecade(new Date(2007, 10, 22)); // 2009-11-22
 * lastYearOfDecade(new Date(2026, 0, 1)); // 2029-1-1
 * ```
 */
var lastYearOfDecade = function (value) { return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__normalize_year__["a" /* normalizeYear */])(value, function (y) { return y - (y % 10) + 9; })); };


/***/ }),
/* 654 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export nextDayOfWeek */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__direction_enum__ = __webpack_require__(129);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__day_of_week__ = __webpack_require__(215);


/**
 * A function which returns a date by a specific week name.
 * For example, `Day.Monday`.
 *
 * @param date - The date to calculate from.
 * @param weekDay - The `Day` enum specifying the desired week day.
 * @returns - A `Date` instance.
 *
 * @example
 * ```ts-no-run
 * nextDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2016-01-06, Wednesday
 * ```
 */
var nextDayOfWeek = function (date, weekDay) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__day_of_week__["a" /* dayOfWeek */])(date, weekDay, __WEBPACK_IMPORTED_MODULE_0__direction_enum__["a" /* Direction */].Forward);
};


/***/ }),
/* 655 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return weekInYear; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__day_enum__ = __webpack_require__(216);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__add_days__ = __webpack_require__(128);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__create_date__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__prev_day_of_week__ = __webpack_require__(409);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ms_per_day__ = __webpack_require__(408);





var moveDateToWeekStart = function (date, weekStartDay) {
    if (weekStartDay !== __WEBPACK_IMPORTED_MODULE_0__day_enum__["a" /* Day */].Monday) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__add_days__["a" /* addDays */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__prev_day_of_week__["a" /* prevDayOfWeek */])(date, weekStartDay), 4);
    }
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__add_days__["a" /* addDays */])(date, (4 - (date.getDay() || 7)));
};
var calcWeekInYear = function (date, weekStartDay) {
    var firstWeekInYear = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__create_date__["a" /* createDate */])(date.getFullYear(), 0, 1, -6);
    var newDate = moveDateToWeekStart(date, weekStartDay);
    var diffInMS = newDate.getTime() - firstWeekInYear.getTime();
    var days = Math.floor(diffInMS / __WEBPACK_IMPORTED_MODULE_4__ms_per_day__["a" /* MS_PER_DAY */]);
    return 1 + Math.floor(days / 7);
};
/**
 * A function that returns the number of the week within a year, which is calculated in relation to the date.
 *
 * For more information, refer to the [**ISO week date**](https://en.wikipedia.org/wiki/ISO_week_date) article.
 *
 * @param date - The date used for the week number calculation.
 * @param weekStartDay - The first day of the week. By default, the first week day is Monday.
 * @returns - The number of the week within the year.
 *
 * @example
 * ```ts-no-run
 * weekInYear(new Date(2016, 0, 1)); // Week 53, 2015
 * weekInYear(new Date(2016, 0, 5)); // Week 1, 2016
 * weekInYear(new Date(2017, 0, 1)); // Week 52, 2016
 * weekInYear(new Date(2017, 0, 2)); // Week 1, 2017
 * ```
 */
var weekInYear = function (date, weekStartDay) {
    if (weekStartDay === void 0) { weekStartDay = __WEBPACK_IMPORTED_MODULE_0__day_enum__["a" /* Day */].Monday; }
    var prevWeekDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__add_days__["a" /* addDays */])(date, -7);
    var nextWeekDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__add_days__["a" /* addDays */])(date, 7);
    var weekNumber = calcWeekInYear(date, weekStartDay);
    if (weekNumber === 0) {
        return calcWeekInYear(prevWeekDate, weekStartDay) + 1;
    }
    if (weekNumber === 53 && calcWeekInYear(nextWeekDate, weekStartDay) > 1) {
        return 1;
    }
    return weekNumber;
};


/***/ }),
/* 656 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = defineOptionsAccessors;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);


function optionsAccessor(name) {
    return function(value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(value)) {
            this.options.set(name, value);
            return this;
        }

        return this.options.get(name);
    };
}

function defineOptionsAccessors(fn, names) {
    for (var i = 0; i < names.length; i++) {
        fn[names[i]] = optionsAccessor(names[i]);
    }
}
//# sourceMappingURL=define-options-accessors.js.map


/***/ }),
/* 657 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__alignment_align__ = __webpack_require__(659);
/* unused harmony reexport align */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__alignment_v_align__ = __webpack_require__(662);
/* unused harmony reexport vAlign */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__alignment_stack__ = __webpack_require__(661);
/* unused harmony reexport stack */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__alignment_v_stack__ = __webpack_require__(663);
/* unused harmony reexport vStack */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__alignment_wrap__ = __webpack_require__(665);
/* unused harmony reexport wrap */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__alignment_v_wrap__ = __webpack_require__(664);
/* unused harmony reexport vWrap */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__alignment_fit__ = __webpack_require__(660);
/* unused harmony reexport fit */







//# sourceMappingURL=alignment.js.map


/***/ }),
/* 658 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = alignStartReverse;

function alignStartReverse(size, rect, align, axis, sizeField) {
    var start;
    if (align === "start") {
        start = rect.origin[axis] + rect.size[sizeField] - size;
    } else if (align === "end") {
        start = rect.origin[axis];
    } else {
        start = rect.origin[axis] + (rect.size[sizeField] - size) / 2;
    }

    return start;
}
//# sourceMappingURL=align-start-reverse.js.map


/***/ }),
/* 659 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__align_elements__ = __webpack_require__(412);



function align(elements, rect, alignment) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__align_elements__["a" /* default */])(elements, rect, alignment, "x", "width");
}
//# sourceMappingURL=align.js.map


/***/ }),
/* 660 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_transform__ = __webpack_require__(39);


function fit(element, rect) {
    var bbox = element.clippedBBox();
    if (bbox) {
        var elementSize = bbox.size;
        var rectSize = rect.size;
        if (rectSize.width < elementSize.width || rectSize.height < elementSize.height) {
            var scale = Math.min(rectSize.width / elementSize.width, rectSize.height / elementSize.height);
            var transform = element.transform() || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__geometry_transform__["a" /* default */])();
            transform.scale(scale, scale);
            element.transform(transform);
        }
    }
}
//# sourceMappingURL=fit.js.map


/***/ }),
/* 661 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__stack_elements__ = __webpack_require__(217);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create_stack_elements__ = __webpack_require__(414);



function stack(elements) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__stack_elements__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__create_stack_elements__["a" /* default */])(elements), "x", "y", "width");
}
//# sourceMappingURL=stack.js.map


/***/ }),
/* 662 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__align_elements__ = __webpack_require__(412);


function vAlign(elements, rect, alignment) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__align_elements__["a" /* default */])(elements, rect, alignment, "y", "height");
}
//# sourceMappingURL=v-align.js.map


/***/ }),
/* 663 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__stack_elements__ = __webpack_require__(217);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create_stack_elements__ = __webpack_require__(414);



function vStack(elements) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__stack_elements__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__create_stack_elements__["a" /* default */])(elements), "y", "x", "height");
}
//# sourceMappingURL=v-stack.js.map


/***/ }),
/* 664 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrap_elements__ = __webpack_require__(415);


function vWrap(elements, rect) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__wrap_elements__["a" /* default */])(elements, rect, "y", "x", "height");
}
//# sourceMappingURL=v-wrap.js.map


/***/ }),
/* 665 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrap_elements__ = __webpack_require__(415);


function wrap(elements, rect) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__wrap_elements__["a" /* default */])(elements, rect, "x", "y", "width");
}
//# sourceMappingURL=wrap.js.map


/***/ }),
/* 666 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(416);
/* unused harmony reexport Animation */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__animations_animation_factory__ = __webpack_require__(667);
/* unused harmony reexport AnimationFactory */


//# sourceMappingURL=animations.js.map


/***/ }),
/* 667 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animation__ = __webpack_require__(416);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);



var AnimationFactory = (function (Class) {
    function AnimationFactory() {
        Class.call(this);

        this._items = [];
    }

    if ( Class ) AnimationFactory.__proto__ = Class;
    AnimationFactory.prototype = Object.create( Class && Class.prototype );
    AnimationFactory.prototype.constructor = AnimationFactory;

    AnimationFactory.prototype.register = function register (name, type) {
        this._items.push({
            name: name,
            type: type
        });
    };

    AnimationFactory.prototype.create = function create (element, options) {
        var items = this._items;
        var match;

        if (options && options.type) {
            var type = options.type.toLowerCase();
            for (var i = 0; i < items.length; i++) {
                if (items[i].name.toLowerCase() === type) {
                    match = items[i];
                    break;
                }
            }
        }

        if (match) {
            return new match.type(element, options);
        }
    };

    return AnimationFactory;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

AnimationFactory.current = new AnimationFactory();

__WEBPACK_IMPORTED_MODULE_0__animation__["a" /* default */].create = function(type, element, options) {
    return AnimationFactory.current.create(type, element, options);
};

/* unused harmony default export */ var _unused_webpack_default_export = (AnimationFactory);
//# sourceMappingURL=animation-factory.js.map


/***/ }),
/* 668 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["swing"] = swing;
/* harmony export (immutable) */ __webpack_exports__["linear"] = linear;
/* harmony export (immutable) */ __webpack_exports__["easeOutElastic"] = easeOutElastic;
function swing(position) {
    return 0.5 - Math.cos(position * Math.PI) / 2;
}

function linear(position) {
    return position;
}

function easeOutElastic(position, time, start, diff) {
    var s = 1.70158,
        p = 0,
        a = diff;

    if (position === 0) {
        return start;
    }

    if (position === 1) {
        return start + diff;
    }

    if (!p) {
        p = 0.5;
    }

    if (a < Math.abs(diff)) {
        a = diff;
        s = p / 4;
    } else {
        s = p / (2 * Math.PI) * Math.asin(diff / a);
    }

    return a * Math.pow(2, -10 * position) *
           Math.sin((Number(position) - s) * (1.1 * Math.PI) / p) + diff + start;
}

//# sourceMappingURL=easing-functions.js.map


/***/ }),
/* 669 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__canvas_surface__ = __webpack_require__(419);
/* unused harmony reexport Surface */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__canvas_root_node__ = __webpack_require__(418);
/* unused harmony reexport RootNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__canvas_node__ = __webpack_require__(218);
/* unused harmony reexport Node */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__canvas_group_node__ = __webpack_require__(417);
/* unused harmony reexport GroupNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__canvas_arc_node__ = __webpack_require__(670);
/* unused harmony reexport ArcNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__canvas_circle_node__ = __webpack_require__(671);
/* unused harmony reexport CircleNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__canvas_rect_node__ = __webpack_require__(675);
/* unused harmony reexport RectNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__canvas_image_node__ = __webpack_require__(673);
/* unused harmony reexport ImageNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__canvas_text_node__ = __webpack_require__(677);
/* unused harmony reexport TextNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__canvas_path_node__ = __webpack_require__(52);
/* unused harmony reexport PathNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__canvas_multi_path_node__ = __webpack_require__(674);
/* unused harmony reexport MultiPathNode */












//# sourceMappingURL=canvas.js.map


/***/ }),
/* 670 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_render_path__ = __webpack_require__(136);




var ArcNode = (function (PathNode) {
    function ArcNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) ArcNode.__proto__ = PathNode;
    ArcNode.prototype = Object.create( PathNode && PathNode.prototype );
    ArcNode.prototype.constructor = ArcNode;

    ArcNode.prototype.renderPoints = function renderPoints (ctx) {
        var path = this.srcElement.toPath();
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_path__["a" /* default */])(ctx, path);
    };

    return ArcNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Arc = ArcNode;

/* unused harmony default export */ var _unused_webpack_default_export = (ArcNode);
//# sourceMappingURL=arc-node.js.map


/***/ }),
/* 671 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);



var CircleNode = (function (PathNode) {
    function CircleNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) CircleNode.__proto__ = PathNode;
    CircleNode.prototype = Object.create( PathNode && PathNode.prototype );
    CircleNode.prototype.constructor = CircleNode;

    CircleNode.prototype.renderPoints = function renderPoints (ctx) {
        var ref = this.srcElement.geometry();
        var center = ref.center;
        var radius = ref.radius;

        ctx.arc(center.x, center.y, radius, 0, Math.PI * 2);
    };

    return CircleNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Circle = CircleNode;

/* unused harmony default export */ var _unused_webpack_default_export = (CircleNode);
//# sourceMappingURL=circle-node.js.map


/***/ }),
/* 672 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__surface__ = __webpack_require__(419);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shapes_group__ = __webpack_require__(98);




function exportImage(group, options) {
    var defaults = {
        width: "800px", height: "600px",
        cors: "Anonymous"
    };

    var exportRoot = group;
    var bbox = group.clippedBBox();


    if (bbox) {
        var origin = bbox.getOrigin();
        exportRoot = new __WEBPACK_IMPORTED_MODULE_2__shapes_group__["a" /* default */]();
        exportRoot.transform(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__geometry__["c" /* transform */])().translate(-origin.x, -origin.y));
        exportRoot.children.push(group);

        var size = bbox.getSize();
        defaults.width = size.width + "px";
        defaults.height = size.height + "px";
    }

    var surfaceOptions = Object.assign(defaults, options);

    var container = document.createElement("div");
    var style = container.style;

    style.display = "none";
    style.width = surfaceOptions.width;
    style.height = surfaceOptions.height;
    document.body.appendChild(container);

    var surface = new __WEBPACK_IMPORTED_MODULE_0__surface__["a" /* default */](container, surfaceOptions);
    surface.suspendTracking();
    surface.draw(exportRoot);

    var promise = surface.image();
    var destroy = function () {
        surface.destroy();
        document.body.removeChild(container);
    };
    promise.then(destroy, destroy);

    return promise;
}
//# sourceMappingURL=export-image.js.map


/***/ }),
/* 673 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);




var ImageNode = (function (PathNode) {
    function ImageNode(srcElement, cors) {
        PathNode.call(this, srcElement);

        this.onLoad = this.onLoad.bind(this);
        this.onError = this.onError.bind(this);

        this.loading = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* createPromise */])();

        var img = this.img = new Image();

        if (cors && !(/^data:/i.test(srcElement.src()))) {
            img.crossOrigin = cors;
        }

        img.src = srcElement.src();

        if (img.complete) {
            this.onLoad();
        } else {
            img.onload = this.onLoad;
            img.onerror = this.onError;
        }
    }

    if ( PathNode ) ImageNode.__proto__ = PathNode;
    ImageNode.prototype = Object.create( PathNode && PathNode.prototype );
    ImageNode.prototype.constructor = ImageNode;

    ImageNode.prototype.renderTo = function renderTo (ctx) {
        if (this.loading.state() === "resolved") {
            ctx.save();

            this.setTransform(ctx);
            this.setClip(ctx);

            this.drawImage(ctx);

            ctx.restore();
        }
    };

    ImageNode.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "src") {
            this.loading = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* createPromise */])();
            this.img.src = this.srcElement.src();
        } else {
            PathNode.prototype.optionsChange.call(this, e);
        }
    };

    ImageNode.prototype.onLoad = function onLoad () {
        this.loading.resolve();
        this.invalidate();
    };

    ImageNode.prototype.onError = function onError () {
        this.loading.reject(new Error(
            "Unable to load image '" + this.img.src +
            "'. Check for connectivity and verify CORS headers."
        ));
    };

    ImageNode.prototype.drawImage = function drawImage (ctx) {
        var rect = this.srcElement.rect();
        var topLeft = rect.topLeft();

        ctx.drawImage(
            this.img, topLeft.x, topLeft.y, rect.width(), rect.height()
        );
    };

    return ImageNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Image = ImageNode;

/* unused harmony default export */ var _unused_webpack_default_export = (ImageNode);
//# sourceMappingURL=image-node.js.map


/***/ }),
/* 674 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_render_path__ = __webpack_require__(136);




var MultiPathNode = (function (PathNode) {
    function MultiPathNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) MultiPathNode.__proto__ = PathNode;
    MultiPathNode.prototype = Object.create( PathNode && PathNode.prototype );
    MultiPathNode.prototype.constructor = MultiPathNode;

    MultiPathNode.prototype.renderPoints = function renderPoints (ctx) {
        var paths = this.srcElement.paths;
        for (var i = 0; i < paths.length; i++) {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_path__["a" /* default */])(ctx, paths[i]);
        }
    };

    return MultiPathNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].MultiPath = MultiPathNode;

/* unused harmony default export */ var _unused_webpack_default_export = (MultiPathNode);
//# sourceMappingURL=multi-path-node.js.map


/***/ }),
/* 675 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);



var RectNode = (function (PathNode) {
    function RectNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) RectNode.__proto__ = PathNode;
    RectNode.prototype = Object.create( PathNode && PathNode.prototype );
    RectNode.prototype.constructor = RectNode;

    RectNode.prototype.renderPoints = function renderPoints (ctx) {
        var ref = this.srcElement.geometry();
        var origin = ref.origin;
        var size = ref.size;

        ctx.rect(origin.x, origin.y, size.width, size.height);
    };

    return RectNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Rect = RectNode;

/* unused harmony default export */ var _unused_webpack_default_export = (RectNode);
//# sourceMappingURL=rect-node.js.map


/***/ }),
/* 676 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);


var SurfaceCursor = function SurfaceCursor(surface) {
    surface.bind("mouseenter", this._mouseenter.bind(this));
    surface.bind("mouseleave", this._mouseleave.bind(this));

    this.element = surface.element;
};

SurfaceCursor.prototype.clear = function clear () {
    this._resetCursor();
};

SurfaceCursor.prototype.destroy = function destroy () {
    this._resetCursor();
    delete this.element;
};

SurfaceCursor.prototype._mouseenter = function _mouseenter (e) {
    var cursor = this._shapeCursor(e);

    if (!cursor) {
        this._resetCursor();
    } else {
        if (!this._current) {
            this._defaultCursor = this._getCursor();
        }

        this._setCursor(cursor);
    }
};

SurfaceCursor.prototype._mouseleave = function _mouseleave () {
    this._resetCursor();
};

SurfaceCursor.prototype._shapeCursor = function _shapeCursor (e) {
    var shape = e.element;

    while (shape && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["e" /* defined */])(shape.options.cursor)) {
        shape = shape.parent;
    }

    if (shape) {
        return shape.options.cursor;
    }
};

SurfaceCursor.prototype._getCursor = function _getCursor () {
    if (this.element) {
        return this.element.style.cursor;
    }
};

SurfaceCursor.prototype._setCursor = function _setCursor (cursor) {
    if (this.element) {
        this.element.style.cursor = cursor;
        this._current = cursor;
    }
};

SurfaceCursor.prototype._resetCursor = function _resetCursor () {
    if (this._current) {
        this._setCursor(this._defaultCursor || "");
        delete this._current;
    }
};

/* harmony default export */ __webpack_exports__["a"] = (SurfaceCursor);


//# sourceMappingURL=surface-cursor.js.map


/***/ }),
/* 677 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(38);



var TextNode = (function (PathNode) {
    function TextNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) TextNode.__proto__ = PathNode;
    TextNode.prototype = Object.create( PathNode && PathNode.prototype );
    TextNode.prototype.constructor = TextNode;

    TextNode.prototype.renderTo = function renderTo (ctx) {
        var text = this.srcElement;
        var pos = text.position();
        var size = text.measure();

        ctx.save();

        this.setTransform(ctx);
        this.setClip(ctx);
        this.setOpacity(ctx);

        ctx.beginPath();

        ctx.font = text.options.font;
        ctx.textAlign = 'left';

        if (this.setFill(ctx)) {
            ctx.fillText(text.content(), pos.x, pos.y + size.baseline);
        }

        if (this.setStroke(ctx)) {
            this.setLineDash(ctx);
            ctx.strokeText(text.content(), pos.x, pos.y + size.baseline);
        }

        ctx.restore();
    };

    return TextNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));


__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Text = TextNode;

/* unused harmony default export */ var _unused_webpack_default_export = (TextNode);
//# sourceMappingURL=text-node.js.map


/***/ }),
/* 678 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = animationFrameProxy;
var wnd = typeof window !== "undefined" ? window : {};

var animationFrame = wnd.requestAnimationFrame ||
                    wnd.webkitRequestAnimationFrame ||
                    wnd.mozRequestAnimationFrame ||
                    wnd.oRequestAnimationFrame ||
                    wnd.msRequestAnimationFrame ||
                    function(callback) { setTimeout(callback, 1000 / 60); };

function animationFrameProxy(callback) {
    animationFrame.call(wnd, callback);
}

//# sourceMappingURL=animation-frame.js.map


/***/ }),
/* 679 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__color_parse_color__ = __webpack_require__(421);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__color_parse_color__["e"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__color_color__ = __webpack_require__(680);
/* unused harmony reexport Color */


//# sourceMappingURL=color.js.map


/***/ }),
/* 680 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__class__ = __webpack_require__(137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__named_colors__ = __webpack_require__(420);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__parse_color__ = __webpack_require__(421);




var Color = (function (Class) {
    function Color(value) {
        var this$1 = this;

        Class.call(this);

        if (arguments.length === 1) {
            var formats = Color.formats;
            var resolvedColor = this.resolveColor(value);

            for (var idx = 0; idx < formats.length; idx++) {
                var formatRegex = formats[idx].re;
                var processor = formats[idx].process;
                var parts = formatRegex.exec(resolvedColor);

                if (parts) {
                    var channels = processor(parts);
                    this$1.r = channels[0];
                    this$1.g = channels[1];
                    this$1.b = channels[2];
                }
            }
        } else {
            this.r = arguments[0];
            this.g = arguments[1];
            this.b = arguments[2];
        }

        this.r = this.normalizeByte(this.r);
        this.g = this.normalizeByte(this.g);
        this.b = this.normalizeByte(this.b);
    }

    if ( Class ) Color.__proto__ = Class;
    Color.prototype = Object.create( Class && Class.prototype );
    Color.prototype.constructor = Color;

    Color.prototype.toHex = function toHex () {
        var pad = this.padDigit;
        var r = this.r.toString(16);
        var g = this.g.toString(16);
        var b = this.b.toString(16);

        return "#" + pad(r) + pad(g) + pad(b);
    };

    Color.prototype.resolveColor = function resolveColor (value) {
        var color = value || "black";

        if (color.charAt(0) === "#") {
            color = color.substr(1, 6);
        }

        color = color.replace(/ /g, "");
        color = color.toLowerCase();
        color = Color.namedColors[color] || color;

        return color;
    };

    Color.prototype.normalizeByte = function normalizeByte (value) {
        if (value < 0 || isNaN(value)) {
            return 0;
        }

        return value > 255 ? 255 : value;
    };

    Color.prototype.padDigit = function padDigit (value) {
        return (value.length === 1) ? "0" + value : value;
    };

    Color.prototype.brightness = function brightness (value) {
        var round = Math.round;

        this.r = round(this.normalizeByte(this.r * value));
        this.g = round(this.normalizeByte(this.g * value));
        this.b = round(this.normalizeByte(this.b * value));

        return this;
    };

    Color.prototype.percBrightness = function percBrightness () {
        return Math.sqrt(0.241 * this.r * this.r + 0.691 * this.g * this.g + 0.068 * this.b * this.b);
    };

    Color.fromBytes = function fromBytes (r, g, b, a) {
        return new __WEBPACK_IMPORTED_MODULE_2__parse_color__["a" /* Bytes */](r, g, b, a != null ? a : 1);
    };

    Color.fromRGB = function fromRGB (r, g, b, a) {
        return new __WEBPACK_IMPORTED_MODULE_2__parse_color__["b" /* RGB */](r, g, b, a != null ? a : 1);
    };

    Color.fromHSV = function fromHSV (h, s, v, a) {
        return new __WEBPACK_IMPORTED_MODULE_2__parse_color__["c" /* HSV */](h, s, v, a != null ? a : 1);
    };

    Color.fromHSL = function fromHSL (h, s, l, a) {
        return new __WEBPACK_IMPORTED_MODULE_2__parse_color__["d" /* HSL */](h, s, l, a != null ? a : 1);
    };

    return Color;
}(__WEBPACK_IMPORTED_MODULE_0__class__["a" /* default */]));

Color.formats = [ {
    re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
    process: function(parts) {
        return [
            parseInt(parts[1], 10), parseInt(parts[2], 10), parseInt(parts[3], 10)
        ];
    }
}, {
    re: /^(\w{2})(\w{2})(\w{2})$/,
    process: function(parts) {
        return [
            parseInt(parts[1], 16), parseInt(parts[2], 16), parseInt(parts[3], 16)
        ];
    }
}, {
    re: /^(\w{1})(\w{1})(\w{1})$/,
    process: function(parts) {
        return [
            parseInt(parts[1] + parts[1], 16),
            parseInt(parts[2] + parts[2], 16),
            parseInt(parts[3] + parts[3], 16)
        ];
    }
} ];

Color.namedColors = __WEBPACK_IMPORTED_MODULE_1__named_colors__["a" /* default */];

/* unused harmony default export */ var _unused_webpack_default_export = (Color);
//# sourceMappingURL=color.js.map


/***/ }),
/* 681 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = htmlEncode;
var ampRegExp = /&/g;
var ltRegExp = /</g;
var quoteRegExp = /"/g;
var aposRegExp = /'/g;
var gtRegExp = />/g;

function htmlEncode(value) {
    return String(value).replace(ampRegExp, "&amp;").replace(ltRegExp, "&lt;").replace(gtRegExp, "&gt;").replace(quoteRegExp, "&quot;").replace(aposRegExp, "&#39;");
}
//# sourceMappingURL=html-encode.js.map


/***/ }),
/* 682 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = logToConsole;
/* eslint-disable no-console */

function logToConsole(message) {
    var console = window.console;

    if (typeof(console) != "undefined" && console.log) {
        console.log(message);
    }
}
//# sourceMappingURL=log-to-console.js.map


/***/ }),
/* 683 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__class__ = __webpack_require__(137);


var Observable = (function (Class) {
    function Observable() {
        Class.call(this);

        this._events = {};
    }

    if ( Class ) Observable.__proto__ = Class;
    Observable.prototype = Object.create( Class && Class.prototype );
    Observable.prototype.constructor = Observable;

    Observable.prototype.bind = function bind (eventName, handlers, one) {
        var arguments$1 = arguments;
        var this$1 = this;

        var eventNames = getArray(eventName);
        var handlersIsFunction = isFunction(handlers);
        var length = eventNames.length;

        if (handlers === undefined) {
            for (var field in eventName) {
                this$1.bind(field, eventName[field]);
            }
            return this;
        }

        var loop = function ( idx ) {
            var eventName$1 = eventNames[idx];

            var handler = handlersIsFunction ? handlers : handlers[eventName$1];

            if (handler) {
                if (one) {
                    var original = handler;
                    handler = function () { // eslint-disable-line no-loop-func
                        this$1.unbind(eventName$1, handler);
                        original.apply(this$1, arguments$1);
                    };
                    handler.original = original;
                }
                var events = this$1._events[eventName$1] = this$1._events[eventName$1] || [];
                events.push(handler);
            }
        };

        for (var idx = 0; idx < length; idx++) loop( idx );

        return this;
    };

    Observable.prototype.one = function one (eventNames, handlers) {
        return this.bind(eventNames, handlers, true);
    };

    Observable.prototype.first = function first (eventName, handlers) {
        var this$1 = this;

        var eventNames = getArray(eventName);
        var handlersIsFunction = isFunction(handlers);

        for (var idx = 0, length = eventNames.length; idx < length; idx++) {
            var eventName$1 = eventNames[idx];

            var handler = handlersIsFunction ? handlers : handlers[eventName$1];

            if (handler) {
                var events = this$1._events[eventName$1] = this$1._events[eventName$1] || [];
                events.unshift(handler);
            }
        }

        return this;
    };

    Observable.prototype.trigger = function trigger (eventName, e) {
        var this$1 = this;
        if ( e === void 0 ) e = {};

        var events = this._events[eventName];

        if (events) {
            var length = events.length;

            e.sender = this;
            e._defaultPrevented = false;
            e.preventDefault = preventDefault;
            e.isDefaultPrevented = isDefaultPrevented;

            events = events.slice();

            for (var idx = 0; idx < length; idx++) {
                events[idx].call(this$1, e);
            }

            return e._defaultPrevented === true;
        }

        return false;
    };

    Observable.prototype.unbind = function unbind (eventName, handler) {
        var events = this._events[eventName];

        if (eventName === undefined) {
            this._events = {};
        } else if (events) {
            if (handler) {
                for (var idx = events.length - 1; idx >= 0; idx--) {
                    if (events[idx] === handler || events[idx].original === handler) {
                        events.splice(idx, 1);
                    }
                }
            } else {
                this._events[eventName] = [];
            }
        }

        return this;
    };

    return Observable;
}(__WEBPACK_IMPORTED_MODULE_0__class__["a" /* default */]));

function isFunction(value) {
    return typeof value === "function";
}

function getArray(value) {
    return typeof value === "string" ? [ value ] : value;
}

function preventDefault() {
    this._defaultPrevented = true;
}

function isDefaultPrevented() {
    return this._defaultPrevented === true;
}

/* harmony default export */ __webpack_exports__["a"] = (Observable);
//# sourceMappingURL=observable.js.map


/***/ }),
/* 684 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = saveAs;
// XXX: the following will not work with IE9 (requires server proxy).
function saveAs(options) {
    var dataURI = options.dataURI;
    var fileName = options.fileName;
    var data = dataURI;

    if (typeof data == "string" && window.Blob) {
        var parts = data.split(";base64,");
        var contentType = parts[0];
        var base64 = atob(parts[1]);
        var array = new Uint8Array(base64.length);
        for (var idx = 0; idx < base64.length; idx++) {
            array[idx] = base64.charCodeAt(idx);
        }
        data = new Blob([ array.buffer ], { type: contentType });
    }
    if (navigator.msSaveBlob) {
        navigator.msSaveBlob(data, fileName);
    } else {
        var link = document.createElement("a");
        link.download = fileName;
        data = link.href = URL.createObjectURL(data);
        var e = document.createEvent("MouseEvents");
        e.initMouseEvent("click", true, false, window,
                         0, 0, 0, 0, 0, false, false, false, false, 0, null);
        link.dispatchEvent(e);
        setTimeout(function() {
            URL.revokeObjectURL(data);
        });
    }
}
//# sourceMappingURL=save-as.js.map


/***/ }),
/* 685 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = template;
function template() {
    // XXX: no template engine for now
    throw new Error("String template not yet supported.  Pass a function and use your preferred template engine.");
}
//# sourceMappingURL=template.js.map


/***/ }),
/* 686 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
function now() {
    return new Date().getTime();
}

function throttle(fn, delay) {
    var lastExecTime = 0;
    var timeout;

    if (!delay || delay <= 0) {
        return fn;
    }

    var throttled = function() {
        var elapsed = now() - lastExecTime;
        var args = arguments;

        var exec = function() {
            fn.apply(null, args);
            lastExecTime = now();
        };

        // first execution
        if (!lastExecTime) {
            return exec();
        }

        if (timeout) {
            clearTimeout(timeout);
        }

        if (elapsed > delay) {
            exec();
        } else {
            timeout = setTimeout(exec, delay - elapsed);
        }
    };

    throttled.cancel = function() {
        clearTimeout(timeout);
    };

    return throttled;
}
//# sourceMappingURL=throttle.js.map


/***/ }),
/* 687 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = closeOrLess;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__close__ = __webpack_require__(425);


function closeOrLess(a, b, tolerance) {
    return a < b || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__close__["a" /* default */])(a, b, tolerance);
}
//# sourceMappingURL=close-or-less.js.map


/***/ }),
/* 688 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);




var ComplexNumber = (function (Class) {
    function ComplexNumber(real, img) {
        if ( real === void 0 ) real = 0;
        if ( img === void 0 ) img = 0;

        Class.call(this);

        this.real = real;
        this.img = img;
    }

    if ( Class ) ComplexNumber.__proto__ = Class;
    ComplexNumber.prototype = Object.create( Class && Class.prototype );
    ComplexNumber.prototype.constructor = ComplexNumber;

    ComplexNumber.prototype.add = function add (cNumber) {
        return new ComplexNumber(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* round */])(this.real + cNumber.real, __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* PRECISION */]), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["d" /* round */])(this.img + cNumber.img, __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* PRECISION */]));
    };

    ComplexNumber.prototype.addConstant = function addConstant (value) {
        return new ComplexNumber(this.real + value, this.img);
    };

    ComplexNumber.prototype.negate = function negate () {
        return new ComplexNumber(-this.real, -this.img);
    };

    ComplexNumber.prototype.multiply = function multiply (cNumber) {
        return new ComplexNumber(this.real * cNumber.real - this.img * cNumber.img,
            this.real * cNumber.img + this.img * cNumber.real);
    };

    ComplexNumber.prototype.multiplyConstant = function multiplyConstant (value) {
        return new ComplexNumber(this.real * value, this.img * value);
    };

    ComplexNumber.prototype.nthRoot = function nthRoot (n) {
        var rad = Math.atan2(this.img, this.real);
        var r = Math.sqrt(Math.pow(this.img, 2) + Math.pow(this.real, 2));
        var nthR = Math.pow(r, 1 / n);

        return new ComplexNumber(nthR * Math.cos(rad / n), nthR * Math.sin(rad / n)); //Moivre's formula
    };

    ComplexNumber.prototype.equals = function equals (cNumber) {
        return this.real === cNumber.real && this.img === cNumber.img;
    };

    ComplexNumber.prototype.isReal = function isReal () {
        return this.img === 0;
    };

    return ComplexNumber;
}(__WEBPACK_IMPORTED_MODULE_1__common__["d" /* Class */]));

/* harmony default export */ __webpack_exports__["a"] = (ComplexNumber);
//# sourceMappingURL=complex-number.js.map


/***/ }),
/* 689 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = curveIntersectionsCount;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_cubic_polynomial__ = __webpack_require__(429);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__solve_cubic_equation__ = __webpack_require__(428);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__calculate_curve_at__ = __webpack_require__(222);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__close__ = __webpack_require__(425);





function curveIntersectionsCount(points, point, bbox) {
    var polynomial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__to_cubic_polynomial__["a" /* default */])(points, "x");
    var roots = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__solve_cubic_equation__["a" /* default */])(polynomial[0], polynomial[1], polynomial[2], polynomial[3] - point.x);
    var rayIntersection, intersectsRay;
    var count = 0;
    for (var i = 0; i < roots.length; i++) {
        rayIntersection = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__calculate_curve_at__["a" /* default */])(roots[i], "y", points);
        intersectsRay = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__close__["a" /* default */])(rayIntersection, point.y) || rayIntersection > point.y;
        if (intersectsRay && (((roots[i] === 0 || roots[i] === 1) && bbox.bottomRight().x > point.x) || (0 < roots[i] && roots[i] < 1))) {
            count++;
        }
    }

    return count;
}
//# sourceMappingURL=curve-intersections-count.js.map


/***/ }),
/* 690 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = hasRootsInRange;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_cubic_polynomial__ = __webpack_require__(429);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__solve_cubic_equation__ = __webpack_require__(428);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__calculate_curve_at__ = __webpack_require__(222);




function hasRootsInRange(points, point, field, rootField, range) {
    var polynomial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__to_cubic_polynomial__["a" /* default */])(points, rootField);
    var roots = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__solve_cubic_equation__["a" /* default */])(polynomial[0], polynomial[1], polynomial[2], polynomial[3] - point[rootField]);
    var intersection;

    for (var idx = 0; idx < roots.length; idx++) {
        if (0 <= roots[idx] && roots[idx] <= 1) {
            intersection = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__calculate_curve_at__["a" /* default */])(roots[idx], field, points);
            if (Math.abs(intersection - point[field]) <= range) {
                return true;
            }
        }
    }
}
//# sourceMappingURL=has-roots-in-range.js.map


/***/ }),
/* 691 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isOutOfEndPoint;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transform__ = __webpack_require__(39);



function isOutOfEndPoint(endPoint, controlPoint, point) {
    var angle = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["i" /* deg */])(Math.atan2(controlPoint.y - endPoint.y, controlPoint.x - endPoint.x));
    var rotatedPoint = point.transformCopy(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__transform__["a" /* default */])().rotate(-angle, endPoint));

    return rotatedPoint.x < endPoint.x;
}
//# sourceMappingURL=is-out-of-end-point.js.map


/***/ }),
/* 692 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = lineIntersection;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__point__ = __webpack_require__(19);


function lineIntersection(p0, p1, p2, p3) {
    var s1x = p1.x - p0.x;
    var s2x = p3.x - p2.x;
    var s1y = p1.y - p0.y;
    var s2y = p3.y - p2.y;
    var nx = p0.x - p2.x;
    var ny = p0.y - p2.y;
    var d = s1x * s2y - s2x * s1y;
    var s = (s1x * ny - s1y * nx) / d;
    var t = (s2x * ny - s2y * nx) / d;

    if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
        return new __WEBPACK_IMPORTED_MODULE_0__point__["a" /* default */](p0.x + t * s1x, p0.y + t * s1y);
    }
}
//# sourceMappingURL=line-intersection.js.map


/***/ }),
/* 693 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gradients_linear_gradient__ = __webpack_require__(224);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__gradients_linear_gradient__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gradients_radial_gradient__ = __webpack_require__(225);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__gradients_radial_gradient__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gradients_gradient_stop__ = __webpack_require__(432);
/* unused harmony reexport GradientStop */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gradients_gradient__ = __webpack_require__(223);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__gradients_gradient__["a"]; });




//# sourceMappingURL=gradients.js.map


/***/ }),
/* 694 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shapes_elements_array__ = __webpack_require__(439);


var StopsArray = (function (ElementsArray) {
    function StopsArray () {
        ElementsArray.apply(this, arguments);
    }

    if ( ElementsArray ) StopsArray.__proto__ = ElementsArray;
    StopsArray.prototype = Object.create( ElementsArray && ElementsArray.prototype );
    StopsArray.prototype.constructor = StopsArray;

    StopsArray.prototype._change = function _change () {
        this.optionsChange({
            field: "stops"
        });
    };

    return StopsArray;
}(__WEBPACK_IMPORTED_MODULE_0__shapes_elements_array__["a" /* default */]));

/* harmony default export */ __webpack_exports__["a"] = (StopsArray);
//# sourceMappingURL=stops-array.js.map


/***/ }),
/* 695 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__html_core__ = __webpack_require__(696);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__html_core__["a"]; });


//# sourceMappingURL=html.js.map


/***/ }),
/* 696 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return drawDOM; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pdf__ = __webpack_require__(227);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__drawing__ = __webpack_require__(95);
/* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */
/* eslint-disable space-infix-ops, space-before-function-paren, array-bracket-spacing, object-curly-spacing */
/* eslint-disable no-nested-ternary, max-params, default-case, no-else-return, no-empty, yoda */
/* eslint-disable no-param-reassign, no-var, block-scoped-var */







var browser = __WEBPACK_IMPORTED_MODULE_3__common__["a" /* support */].browser;
/*

  XXX: to test:

  - cloneNodes function:
    - drawing document containing canvas with page breaking
    - drawing document with named radio <input>-s (should not clear selection)
    - IE9/IE10 don't support el.dataset; do they copy user data?

  - repeating table headers/footers on page breaking

  - forceBreak, keepTogether

  - avoidLinks

 */

/* -----[ local vars ]----- */

function slice(thing) {
    return Array.prototype.slice.call(thing);
}

var KENDO_PSEUDO_ELEMENT = "KENDO-PSEUDO-ELEMENT";

var IMAGE_CACHE = {};

var nodeInfo = {};
nodeInfo._root = nodeInfo;

/* -----[ Custom Text node to speed up rendering in PDF ]----- */

var TextRect = (function (Text) {
  function TextRect(str, rect, options) {
        Text.call(this, str, rect.getOrigin(), options);
        this._pdfRect = rect;
    }

  if ( Text ) TextRect.__proto__ = Text;
  TextRect.prototype = Object.create( Text && Text.prototype );
  TextRect.prototype.constructor = TextRect;
    TextRect.prototype.rect = function rect () {
        // this is the crux of it: we can avoid a call to
        // measure(), which is what the base class does, since we
        // already know the rect.  measure() is s-l-o-w.
        return this._pdfRect;
    };
    TextRect.prototype.rawBBox = function rawBBox () {
        // also let's avoid creating a new rectangle.
        return this._pdfRect;
    };

  return TextRect;
}(__WEBPACK_IMPORTED_MODULE_4__drawing__["e" /* Text */]));

function addClass(el, cls) {
    if (el.classList) {
        el.classList.add(cls);
    } else {
        el.className += " " + cls;
    }
}

function removeClass(el, cls) {
    if (el.classList) {
        el.classList.remove(cls);
    } else {
        el.className = el.className.split(/\s+/).reduce(function(a, word){
            if (word != cls) {
                a.push(word);
            }
            return a;
        }, []).join(" ");
    }
}

function setCSS(el, styles) {
    Object.keys(styles).forEach(function(key){
        el.style[key] = styles[key];
    });
}

var matches = typeof Element !== "undefined" && Element.prototype && (function(p){
    if (p.matches) {
        return function(el, selector) { return el.matches(selector); };
    }
    if (p.webkitMatchesSelector) {
        return function(el, selector) { return el.webkitMatchesSelector(selector); };
    }
    if (p.mozMatchesSelector) {
        return function(el, selector) { return el.mozMatchesSelector(selector); };
    }
    if (p.msMatchesSelector) {
        return function(el, selector) { return el.msMatchesSelector(selector); };
    }
    return function(s) {
	return [].indexOf.call(document.querySelectorAll(s), this) !== -1;
    };
})(Element.prototype);

function closest(el, selector) {
    if (el.closest) {
        return el.closest(selector);
    }
    // IE: stringifying rather than simply comparing with `document`,
    // which is not iframe-proof and fails in editor export —
    // https://github.com/telerik/kendo/issues/6721
    while (el && !/^\[object (?:HTML)?Document\]$/.test(String(el))) {
        if (matches(el, selector)) {
            return el;
        }
        el = el.parentNode;
    }
}

// clone nodes ourselves, so that we redraw <canvas> (DOM or
// jQuery clone will not)
var cloneNodes = (function($){
    if ($) {
        // if we have Kendo and jQuery, use this version as it will
        // maintain proper links between cloned element and Kendo
        // widgets (i.e. it clones jQuery data(), which isn't the same
        // as element's data attributes).
        // https://github.com/telerik/kendo-ui-core/issues/2750
        return function cloneNodes(el) {
            var clone = el.cloneNode(false);
            if (el.nodeType == 1 /* Element */) {
                var $el = $(el), $clone = $(clone), i;
                var data = $el.data();
                for (i in data) {
                    $clone.data(i, data[i]);
                }
                if (/^canvas$/i.test(el.tagName)) {
                    clone.getContext("2d").drawImage(el, 0, 0);
                } else if (/^(?:input|select|textarea|option)$/i.test(el.tagName)) {
                    // drop the name attributes so that we don't affect the selection of the
                    // original nodes (i.e. checked status of radio buttons) when we insert our copy
                    // into the DOM.  https://github.com/telerik/kendo/issues/5409
                    clone.removeAttribute("id");
                    clone.removeAttribute("name");
                    clone.value = el.value;
                    clone.checked = el.checked;
                    clone.selected = el.selected;
                }
                for (i = el.firstChild; i; i = i.nextSibling) {
                    clone.appendChild(cloneNodes(i));
                }
            }
            return clone;
        };
    } else {
        // the no-jQuery version
        return function cloneNodes(el) {
            var clone = (function dive(node){
                var clone = node.cloneNode(false);
                if (node._kendoExportVisual) {
                    clone._kendoExportVisual = node._kendoExportVisual;
                }
                for (var i = node.firstChild; i; i = i.nextSibling) {
                    clone.appendChild(dive(i));
                }
                return clone;
            })(el);

            // re-draw canvases - https://github.com/telerik/kendo/issues/4872
            var canvases = el.querySelectorAll("canvas");
            if (canvases.length) {
                slice(clone.querySelectorAll("canvas")).forEach(function (canvas, i) {
                    canvas.getContext("2d").drawImage(canvases[i], 0, 0);
                });
            }

            // remove "name" attributes from <input> elements -
            // https://github.com/telerik/kendo/issues/5409
            var orig = el.querySelectorAll("input, select, textarea, option");
            slice(clone.querySelectorAll("input, select, textarea, option")).forEach(function (el, i) {
                el.removeAttribute("id");
                el.removeAttribute("name");
                el.value = orig[i].value;
                el.checked = orig[i].checked;
                el.selected = orig[i].selected;
            });

            return clone;
        };
    }
})(typeof window !== "undefined" && window.kendo && window.kendo.jQuery);

function getXY(thing) {
    if (typeof thing == "number") {
        return { x: thing, y: thing };
    }
    if (Array.isArray(thing)) {
        return { x: thing[0], y: thing[1] };
    }
    return { x: thing.x, y: thing.y };
}

function drawDOM(element, options) {
    if (!options) {
        options = {};
    }
    var promise = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["a" /* createPromise */])();

    if (!element) {
        return promise.reject("No element to export");
    }

    if (typeof window.getComputedStyle != "function") {
        throw new 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+.");
    }

    __WEBPACK_IMPORTED_MODULE_1__pdf__["b" /* defineFont */](getFontFaces(element.ownerDocument));

    var scale = getXY(options.scale || 1);

    function doOne(element) {
        var group = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();

        // translate to start of page
        var pos = element.getBoundingClientRect();
        setTransform(group, [
            scale.x,
            0,
            0,
            scale.y,
            (-pos.left * scale.x),
            (-pos.top * scale.y)
        ]);

        nodeInfo._clipbox = false;
        nodeInfo._matrix = __WEBPACK_IMPORTED_MODULE_0__geometry__["a" /* Matrix */].unit();
        nodeInfo._stackingContext = {
            element: element,
            group: group
        };

        if (options.avoidLinks === true) {
            nodeInfo._avoidLinks = "a";
        } else {
            nodeInfo._avoidLinks = options.avoidLinks;
        }

        addClass(element, "k-pdf-export");
        renderElement(element, group);
        removeClass(element, "k-pdf-export");

        return group;
    }

    cacheImages(element, function(){
        var forceBreak = options && options.forcePageBreak;
        var hasPaperSize = options && options.paperSize && options.paperSize != "auto";
        var paperOptions = __WEBPACK_IMPORTED_MODULE_1__pdf__["c" /* getPaperOptions */](function(key, def){
            if (key == "paperSize") {
                // PDF.getPaperOptions croaks on "auto", just pass dummy A4 as we might
                // still be interested in margins.
                return hasPaperSize ? options[key] : "A4";
            }
            return key in options ? options[key] : def;
        });
        var pageWidth = hasPaperSize && paperOptions.paperSize[0];
        var pageHeight = hasPaperSize && paperOptions.paperSize[1];
        var margin = options.margin && paperOptions.margin;
        var hasMargin = Boolean(margin);
        if (forceBreak || pageHeight) {
            if (!margin) {
                margin = { left: 0, top: 0, right: 0, bottom: 0 };
            }

            // we want paper size and margin to be unaffected by
            // scaling in the output, so we have to reverse-scale
            // before our calculations begin.
            if (pageWidth)  { pageWidth  /= scale.x; }
            if (pageHeight) { pageHeight /= scale.y; }
            margin.left   /= scale.x;
            margin.right  /= scale.x;
            margin.top    /= scale.y;
            margin.bottom /= scale.y;

            var group = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]({
                pdf: {
                    multiPage     : true,
                    paperSize     : hasPaperSize ? paperOptions.paperSize : "auto",
                    _ignoreMargin : hasMargin // HACK!  see exportPDF in pdf/drawing.js
                }
            });
            handlePageBreaks(
                function(x) {
                    if (options.progress) {
                        var canceled = false, pageNum = 0;
                        (function next(){
                            if (pageNum < x.pages.length) {
                                var page = doOne(x.pages[pageNum]);
                                group.append(page);
                                options.progress({
                                    page: page,
                                    pageNum: ++pageNum,
                                    totalPages: x.pages.length,
                                    cancel: function() {
                                        canceled = true;
                                    }
                                });
                                if (!canceled) {
                                    setTimeout(next);
                                } else {
                                    // XXX: should we also fail() the deferred object?
                                    x.container.parentNode.removeChild(x.container);
                                }
                            } else {
                                x.container.parentNode.removeChild(x.container);
                                promise.resolve(group);
                            }
                        })();
                    } else {
                        x.pages.forEach(function(page){
                            group.append(doOne(page));
                        });
                        x.container.parentNode.removeChild(x.container);
                        promise.resolve(group);
                    }
                },
                element,
                forceBreak,
                pageWidth ? pageWidth - margin.left - margin.right : null,
                pageHeight ? pageHeight - margin.top - margin.bottom : null,
                margin,
                options
            );
        } else {
            promise.resolve(doOne(element));
        }
    });

    function makeTemplate(template) {
        if (template != null) {
            if (typeof template == "string") {
                template = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common__["j" /* template */])(template.replace(/^\s+|\s+$/g, ""));
            }
            if (typeof template == "function") {
                return function(data) {
                    var el = template(data);
                    if (el && typeof el == "string") {
                        var div = document.createElement("div");
                        div.innerHTML = el;
                        el = div.firstElementChild;
                    }
                    return el;
                };
            }
            // assumed DOM element
            return function() {
                return template.cloneNode(true);
            };
        }
    }

    function handlePageBreaks(callback, element, forceBreak, pageWidth, pageHeight, margin, options) {
        var template = makeTemplate(options.template);
        var doc = element.ownerDocument;
        var pages = [];
        var copy = options._destructive ? element : cloneNodes(element);
        var container = doc.createElement("KENDO-PDF-DOCUMENT");
        var adjust = 0;

        // make sure <tfoot> elements are at the end (Grid widget
        // places TFOOT before TBODY, tricking our algorithm to
        // insert a page break right after the header).
        // https://github.com/telerik/kendo/issues/4699
        slice(copy.querySelectorAll("tfoot")).forEach(function(tfoot){
            tfoot.parentNode.appendChild(tfoot);
        });

        // remember the index of each LI from an ordered list.
        // we'll use it to reconstruct the proper numbering.
        slice(copy.querySelectorAll("ol")).forEach(function(ol){
            slice(ol.children).forEach(function(li, index){
                li.setAttribute("kendo-split-index", index);
            });
        });

        setCSS(container, {
            display   : "block",
            position  : "absolute",
            boxSizing : "content-box",
            left      : "-10000px",
            top       : "-10000px"
        });

        if (pageWidth) {
            // subtle: if we don't set the width *and* margins here, the layout in this
            // container will be different from the one in our final page elements, and we'll
            // split at the wrong places.
            setCSS(container, {
                width        : pageWidth + "px",
                paddingLeft  : margin.left + "px",
                paddingRight : margin.right + "px"
            });

            // when the first element has a margin-top (i.e. a <h1>) the page will be
            // inadvertently enlarged by that number (the browser will report the container's
            // bounding box top to start at the element's top, rather than including its
            // margin).  Adding overflow: hidden seems to fix it.
            //
            // to understand the difference, try the following snippets in your browser:
            //
            // 1. <div style="background: yellow">
            //      <h1 style="margin: 3em">Foo</h1>
            //    </div>
            //
            // 2. <div style="background: yellow; overflow: hidden">
            //      <h1 style="margin: 3em">Foo</h1>
            //    </div>
            //
            // this detail is not important when automatic page breaking is not requested, hence
            // doing it only if pageWidth is defined.
            setCSS(copy, { overflow: "hidden" });
        }

        element.parentNode.insertBefore(container, element);
        container.appendChild(copy);

        // we need the timeouts here, so that images dimensions are
        // properly computed in DOM when we start our thing.
        if (options.beforePageBreak) {
            setTimeout(function(){
                options.beforePageBreak(container, doPageBreak);
            }, 15);
        } else {
            setTimeout(doPageBreak, 15);
        }

        function doPageBreak() {
            if (forceBreak != "-" || pageHeight) {
                splitElement(copy);
            }

            {
                var page = makePage();
                copy.parentNode.insertBefore(page, copy);
                page.appendChild(copy);
            }

            if (template) {
                pages.forEach(function(page, i){
                    var el = template({
                        element    : page,
                        pageNum    : i + 1,
                        totalPages : pages.length
                    });
                    if (el) {
                        page.appendChild(el);
                    }
                });
            }

            cacheImages(pages, function() {
                // Even though we already cached images, they simply won't be available
                // immediately in the newly created DOM.  Previously we'd allow a 10ms timeout,
                // but that's arbitrary and clearly not working in all cases
                // (https://github.com/telerik/kendo/issues/5399), so this function will wait
                // for their .complete attribute.
                whenImagesAreActuallyLoaded(pages, function(){
                    callback({ pages: pages, container: container });
                });
            });
        }

        function keepTogether(el) {
            if (options.keepTogether && matches(el, options.keepTogether) && el.offsetHeight <= pageHeight - adjust) {
                return true;
            }

            var tag = el.tagName;
            if (/^h[1-6]$/i.test(tag) && el.offsetHeight >= pageHeight - adjust) {
                return false;
            }

            return (el.getAttribute("data-kendo-chart") ||
                    /^(?:img|tr|thead|th|tfoot|iframe|svg|object|canvas|input|textarea|select|video|h[1-6])/i.test(el.tagName));
        }

        function splitElement(element) {
            if (element.tagName == "TABLE") {
                setCSS(element, { tableLayout: "fixed" });
            }
            var style = getComputedStyle(element);
            var bottomPadding = parseFloat(getPropertyValue(style, "padding-bottom"));
            var bottomBorder = parseFloat(getPropertyValue(style, "border-bottom-width"));
            var saveAdjust = adjust;
            adjust += bottomPadding + bottomBorder;
            var isFirst = true;
            for (var el = element.firstChild; el; el = el.nextSibling) {
                if (el.nodeType == 1 /* Element */) {
                    isFirst = false;
                    if (matches(el, forceBreak)) {
                        breakAtElement(el);
                        continue;
                    }
                    if (!pageHeight) {
                        // we're in "manual breaks mode"
                        splitElement(el);
                        continue;
                    }
                    if (!/^(?:static|relative)$/.test(getPropertyValue(getComputedStyle(el), "position"))) {
                        continue;
                    }
                    var fall = fallsOnMargin(el);
                    if (fall == 1) {
                        // element starts on next page, break before anyway.
                        breakAtElement(el);
                    }
                    else if (fall) {
                        // elements ends up on next page, or possibly doesn't fit on a page at
                        // all.  break before it anyway if it's an <img> or <tr>, otherwise
                        // attempt to split.
                        if (keepTogether(el)) {
                            breakAtElement(el);
                        } else {
                            splitElement(el);
                        }
                    }
                    else {
                        splitElement(el);
                    }
                }
                else if (el.nodeType == 3 /* Text */ && pageHeight) {
                    splitText(el, isFirst);
                    isFirst = false;
                }
            }
            adjust = saveAdjust;
        }

        function firstInParent(el) {
            var p = el.parentNode, first = p.firstChild;
            if (el === first) {
                return true;
            }
            if (el === p.children[0]) {
                if (first.nodeType == 7 /* comment */ ||
                    first.nodeType == 8 /* processing instruction */) {
                    return true;
                }
                if (first.nodeType == 3 /* text */) {
                    // if whitespace only we can probably consider it's first
                    return !/\S/.test(first.data);
                }
            }
            return false;
        }

        function breakAtElement(el) {
            if (el.nodeType == 1 && el !== copy && firstInParent(el)) {
                return breakAtElement(el.parentNode);
            }
            var table, colgroup, thead, grid, gridHead;
            table = closest(el, "table");
            colgroup = table && table.querySelector("colgroup");
            if (options.repeatHeaders) {
                thead = table && table.querySelector("thead");

                // If we break page in a Kendo Grid, repeat its header.  This ugly hack is
                // necessary because a scrollable grid will keep the header in a separate
                // <table> element from its content.
                //
                // XXX: This is likely to break as soon as the widget HTML is modified.
                grid = closest(el, ".k-grid.k-widget");
                if (grid && grid.querySelector(".k-auto-scrollable")) {
                    gridHead = grid.querySelector(".k-grid-header");
                }
            }
            var page = makePage();
            var range = doc.createRange();
            range.setStartBefore(copy);
            range.setEndBefore(el);
            page.appendChild(range.extractContents());
            copy.parentNode.insertBefore(page, copy);
            preventBulletOnListItem(el.parentNode);
            if (table) {
                table = closest(el, "table"); // that's the <table> on next page!
                if (options.repeatHeaders && thead) {
                    table.insertBefore(thead.cloneNode(true), table.firstChild);
                }
                if (colgroup) {
                    table.insertBefore(colgroup.cloneNode(true), table.firstChild);
                }
            }
            if (options.repeatHeaders && gridHead) {
                grid = closest(el, ".k-grid.k-widget");
                grid.insertBefore(gridHead.cloneNode(true), grid.firstChild);
            }
        }

        function makePage() {
            var page = doc.createElement("KENDO-PDF-PAGE");
            setCSS(page, {
                display  : "block",
                boxSizing: "content-box",
                width    : pageWidth ? (pageWidth + "px") : "auto",
                padding  : (margin.top + "px " +
                            margin.right + "px " +
                            margin.bottom + "px " +
                            margin.left + "px"),

                // allow absolutely positioned elements to be relative to current page
                position : "relative",

                // without the following we might affect layout of subsequent pages
                height   : pageHeight ? (pageHeight + "px") : "auto",
                overflow : pageHeight || pageWidth ? "hidden" : "visible",
                clear    : "both"
            });

            // debug
            // $("<div>").css({
            //     position  : "absolute",
            //     left      : margin.left,
            //     top       : margin.top,
            //     width     : pageWidth,
            //     height    : pageHeight,
            //     boxSizing : "border-box",
            //     background: "rgba(255, 255, 0, 0.5)"
            //     //border    : "1px solid red"
            // }).appendTo(page);

            if (options && options.pageClassName) {
                page.className = options.pageClassName;
            }
            pages.push(page);
            return page;
        }

        function fallsOnMargin(thing) {
            var box = thing.getBoundingClientRect();
            if (box.width === 0 || box.height === 0) {
                // I'd say an element with dimensions zero fits on current page.
                return 0;
            }
            var top = copy.getBoundingClientRect().top;
            var available = pageHeight - adjust;
            return (box.height > available) ? 3
                : (box.top - top > available) ? 1
                : (box.bottom - top > available) ? 2
                : 0;
        }

        function splitText(node, isFirst) {
            if (!/\S/.test(node.data)) {
                return;
            }

            var len = node.data.length;
            var range = doc.createRange();
            range.selectNodeContents(node);
            var fall = fallsOnMargin(range);
            if (!fall) {
                return;     // the whole text fits on current page
            }

            var nextnode = node;
            if (fall == 1) {
                // starts on next page, break before anyway.
                if (isFirst) {
                    // avoid leaving an empty <p>, <li>, etc. on previous page.
                    breakAtElement(node.parentNode);
                } else {
                    breakAtElement(node);
                }
            }
            else {
                (function findEOP(min, pos, max) {
                    range.setEnd(node, pos);
                    if (min == pos || pos == max) {
                        return pos;
                    }
                    if (fallsOnMargin(range)) {
                        return findEOP(min, (min + pos) >> 1, pos);
                    } else {
                        return findEOP(pos, (pos + max) >> 1, max);
                    }
                })(0, len >> 1, len);

                if (!/\S/.test(range.toString()) && isFirst) {
                    // avoid leaving an empty <p>, <li>, etc. on previous page.
                    breakAtElement(node.parentNode);
                } else {
                    // This is only needed for IE, but it feels cleaner to do it anyway.  Without
                    // it, IE will truncate a very long text (playground/pdf-long-text-2.html).
                    nextnode = node.splitText(range.endOffset);

                    var page = makePage();
                    range.setStartBefore(copy);
                    page.appendChild(range.extractContents());
                    copy.parentNode.insertBefore(page, copy);
                    preventBulletOnListItem(nextnode.parentNode);
                }
            }

            splitText(nextnode);
        }

        function preventBulletOnListItem(el) {
            // set a hint on continued LI elements, to tell the
            // renderer not to draw the bullet again.
            // https://github.com/telerik/kendo-ui-core/issues/2732
            var li = closest(el, "li");
            if (li) {
                li.setAttribute("kendo-no-bullet", "1");
                preventBulletOnListItem(li.parentNode);
            }
        }
    }

    return promise;
}

drawDOM.getFontFaces = getFontFaces;

// This is needed for the Spreadsheet print functionality.  Since
// there we only need to draw text, this cuts through the ceremony
// of drawDOM/renderElement and renders the text node directly.
drawDOM.drawText = function(element) {
    var group = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
    nodeInfo._clipbox = false;
    nodeInfo._matrix = __WEBPACK_IMPORTED_MODULE_0__geometry__["a" /* Matrix */].unit();
    nodeInfo._stackingContext = {
        element: element,
        group: group
    };
    pushNodeInfo(element, getComputedStyle(element), group);
    if (element.firstChild.nodeType == 3 /* Text */) {
        // avoid the penalty of renderElement
        renderText(element, element.firstChild, group);
    } else {
        _renderElement(element, group);
    }
    popNodeInfo();
    return group;
};

var parseBackgroundImage = (function(){
    var tok_linear_gradient  = /^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/;
    //var tok_radial_gradient  = /^((-webkit-|-moz-|-o-|-ms-)?radial-gradient\s*)\(/;
    var tok_percent          = /^([-0-9.]+%)/;
    var tok_length           = /^([-0-9.]+px)/;
    var tok_keyword          = /^(left|right|top|bottom|to|center)\W/;
    var tok_angle            = /^([-0-9.]+(deg|grad|rad|turn))/;
    var tok_whitespace       = /^(\s+)/;
    var tok_popen            = /^(\()/;
    var tok_pclose           = /^(\))/;
    var tok_comma            = /^(,)/;
    var tok_url              = /^(url)\(/;
    var tok_content          = /^(.*?)\)/;

    var cache1 = {}, cache2 = {};

    function parse(input) {
        var orig = input;
        if (hasOwnProperty(cache1, orig)) {
            return cache1[orig];
        }
        function skip_ws() {
            var m = tok_whitespace.exec(input);
            if (m) {
                input = input.substr(m[1].length);
            }
        }
        function read(token) {
            skip_ws();
            var m = token.exec(input);
            if (m) {
                input = input.substr(m[1].length);
                return m[1];
            }
        }

        function read_stop() {
            var color = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common__["c" /* parseColor */])(input, true);
            var length, percent;
            if (color) {
                var match =
                    /^#[0-9a-f]+/i.exec(input) ||
                    /^rgba?\(.*?\)/i.exec(input) ||
                    /^..*?\b/.exec(input); // maybe named color
                input = input.substr(match[0].length);
                color = color.toRGB();
                if (!(length = read(tok_length))) {
                    percent = read(tok_percent);
                }
                return { color: color, length: length, percent: percent };
            }
        }

        function read_linear_gradient(propName) {
            var angle;
            var to1, to2;
            var stops = [];
            var reverse = false;

            if (read(tok_popen)) {
                // 1. [ <angle> || to <side-or-corner>, ]?
                angle = read(tok_angle);
                if (angle) {
                    angle = parseAngle(angle);
                    read(tok_comma);
                }
                else {
                    to1 = read(tok_keyword);
                    if (to1 == "to") {
                        to1 = read(tok_keyword);
                    } else if (to1 && /^-/.test(propName)) {
                        reverse = true;
                    }
                    to2 = read(tok_keyword);
                    read(tok_comma);
                }

                if (/-moz-/.test(propName) && angle == null && to1 == null) {
                    var x = read(tok_percent), y = read(tok_percent);
                    reverse = true;
                    if (x == "0%") {
                        to1 = "left";
                    } else if (x == "100%") {
                        to1 = "right";
                    }
                    if (y == "0%") {
                        to2 = "top";
                    } else if (y == "100%") {
                        to2 = "bottom";
                    }
                    read(tok_comma);
                }

                // 2. color stops
                while (input && !read(tok_pclose)) {
                    var stop = read_stop();
                    if (!stop) {
                        break;
                    }
                    stops.push(stop);
                    read(tok_comma);
                }

                return {
                    type    : "linear",
                    angle   : angle,
                    to      : to1 && to2 ? to1 + " " + to2 : to1 ? to1 : to2 ? to2 : null,
                    stops   : stops,
                    reverse : reverse
                };
            }
        }

        function read_url() {
            if (read(tok_popen)) {
                var url = read(tok_content);
                url = url.replace(/^['"]+|["']+$/g, "");
                read(tok_pclose);
                return { type: "url", url: url };
            }
        }

        var tok;

        if ((tok = read(tok_linear_gradient))) {
            tok = read_linear_gradient(tok);
        }
        else if ((tok = read(tok_url))) {
            tok = read_url();
        }

        return (cache1[orig] = tok || { type: "none" });
    }

    return function(input) {
        if (hasOwnProperty(cache2, input)) {
            return cache2[input];
        }
        return (cache2[input] = splitProperty(input).map(parse));
    };
})();

var splitProperty = (function(){
    var cache = {};
    return function(input, separator) {
        if (!separator) {
            separator = /^\s*,\s*/;
        }

        var cacheKey = input + separator;

        if (hasOwnProperty(cache, cacheKey)) {
            return cache[cacheKey];
        }

        var ret = [];
        var last = 0, pos = 0;
        var in_paren = 0;
        var in_string = false;
        var m;

        function looking_at(rx) {
            return (m = rx.exec(input.substr(pos)));
        }

        function trim(str) {
            return str.replace(/^\s+|\s+$/g, "");
        }

        while (pos < input.length) {
            if (!in_string && looking_at(/^[\(\[\{]/)) {
                in_paren++;
                pos++;
            }
            else if (!in_string && looking_at(/^[\)\]\}]/)) {
                in_paren--;
                pos++;
            }
            else if (!in_string && looking_at(/^[\"\']/)) {
                in_string = m[0];
                pos++;
            }
            else if (in_string == "'" && looking_at(/^\\\'/)) {
                pos += 2;
            }
            else if (in_string == '"' && looking_at(/^\\\"/)) {
                pos += 2;
            }
            else if (in_string == "'" && looking_at(/^\'/)) {
                in_string = false;
                pos++;
            }
            else if (in_string == '"' && looking_at(/^\"/)) {
                in_string = false;
                pos++;
            }
            else if (looking_at(separator)) {
                if (!in_string && !in_paren && pos > last) {
                    ret.push(trim(input.substring(last, pos)));
                    last = pos + m[0].length;
                }
                pos += m[0].length;
            }
            else {
                pos++;
            }
        }
        if (last < pos) {
            ret.push(trim(input.substring(last, pos)));
        }
        return (cache[cacheKey] = ret);
    };
})();

var getFontURL = (function(cache){
    return function(el){
        // XXX: for IE we get here the whole cssText of the rule,
        // because the computedStyle.src is empty.  Next time we need
        // to fix these regexps we better write a CSS parser. :-\
        var url = cache[el];
        if (!url) {
            var m;
            if ((m = /url\((['"]?)([^'")]*?)\1\)\s+format\((['"]?)truetype\3\)/.exec(el))) {
                url = cache[el] = m[2];
            } else if ((m = /url\((['"]?)([^'")]*?\.ttf)\1\)/.exec(el))) {
                url = cache[el] = m[2];
            }
        }
        return url;
    };
})(Object.create(null));

var getFontHeight = (function(cache){
    return function(font) {
        var height = cache[font];
        if (height == null) {
            height = cache[font] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["w" /* measureText */])("Mapq", { font: font }).height;
        }
        return height;
    };
})(Object.create(null));

function getFontFaces(doc) {
    if (doc == null) {
        doc = document;
    }
    var result = {};
    for (var i = 0; i < doc.styleSheets.length; ++i) {
        doStylesheet(doc.styleSheets[i]);
    }
    return result;
    function doStylesheet(ss) {
        if (ss) {
            var rules = null;
            try {
                rules = ss.cssRules;
            } catch (ex) {}
            if (rules) {
                addRules(ss, rules);
            }
        }
    }
    function findFonts(rule) {
        var src = getPropertyValue(rule.style, "src");
        if (src) {
            return splitProperty(src).reduce(function(a, el){
                var font = getFontURL(el);
                if (font) {
                    a.push(font);
                }
                return a;
            }, []);
        } else {
            // Internet Explorer
            // XXX: this is gross.  should work though for valid CSS.
            var font = getFontURL(rule.cssText);
            return font ? [ font ] : [];
        }
    }
    function addRules(styleSheet, rules) {
        for (var i = 0; i < rules.length; ++i) {
            var r = rules[i];
            switch (r.type) {
              case 3:       // CSSImportRule
                doStylesheet(r.styleSheet);
                break;
              case 5:       // CSSFontFaceRule
                var style  = r.style;
                var family = splitProperty(getPropertyValue(style, "font-family"));
                var bold   = /^([56789]00|bold)$/i.test(getPropertyValue(style, "font-weight"));
                var italic = "italic" == getPropertyValue(style, "font-style");
                var src    = findFonts(r);
                if (src.length > 0) {
                    addRule(styleSheet, family, bold, italic, src[0]);
                }
            }
        }
    }
    function addRule(styleSheet, names, bold, italic, url) {
        // We get full resolved absolute URLs in Chrome, but sadly
        // not in Firefox.
        if (!(/^data:/i.test(url))) {
            if (!(/^[^\/:]+:\/\//.test(url) || /^\//.test(url))) {
                url = String(styleSheet.href).replace(/[^\/]*$/, "") + url;
            }
        }
        names.forEach(function(name){
            name = name.replace(/^(['"]?)(.*?)\1$/, "$2"); // it's quoted
            if (bold) {
                name += "|bold";
            }
            if (italic) {
                name += "|italic";
            }
            result[name] = url;
        });
    }
}

function hasOwnProperty(obj, key) {
    return Object.prototype.hasOwnProperty.call(obj, key);
}

function getCounter(name) {
    name = "_counter_" + name;
    return nodeInfo[name];
}

function getAllCounters(name) {
    var values = [], p = nodeInfo;
    name = "_counter_" + name;
    while (p) {
        if (hasOwnProperty(p, name)) {
            values.push(p[name]);
        }
        p = Object.getPrototypeOf(p);
    }
    return values.reverse();
}

function incCounter(name, inc) {
    var p = nodeInfo;
    name = "_counter_" + name;
    while (p && !hasOwnProperty(p, name)) {
        p = Object.getPrototypeOf(p);
    }
    if (!p) {
        p = nodeInfo._root;
    }
    p[name] = (p[name] || 0) + (inc == null ? 1 : inc);
}

function resetCounter(name, val) {
    name = "_counter_" + name;
    nodeInfo[name] = val == null ? 0 : val;
}

function doCounters(a, f, def) {
    for (var i = 0; i < a.length;) {
        var name = a[i++];
        var val = parseFloat(a[i]);
        if (isNaN(val)) {
            f(name, def);
        } else {
            f(name, val);
            ++i;
        }
    }
}

function updateCounters(style) {
    var counterReset = getPropertyValue(style, "counter-reset");
    if (counterReset) {
        doCounters(splitProperty(counterReset, /^\s+/), resetCounter, 0);
    }
    var counterIncrement = getPropertyValue(style, "counter-increment");
    if (counterIncrement) {
        doCounters(splitProperty(counterIncrement, /^\s+/), incCounter, 1);
    }
}

function parseColor(str, css) {
    var color = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common__["c" /* parseColor */])(str, true);
    if (color) {
        color = color.toRGB();
        if (css) {
            color = color.toCssRgba();
        } else if (color.a === 0) {
            color = null;
        }
    }
    return color;
}

function whenImagesAreActuallyLoaded(elements, callback) {
    var pending = 0;
    elements.forEach(function(el){
        var images = el.querySelectorAll("img");
        for (var i = 0; i < images.length; ++i) {
            var img = images[i];
            if (!img.complete) {
                pending++;
                img.onload = img.onerror = next;
            }
        }
    });
    if (!pending) {
        next();
    }
    function next() {
        if (--pending <= 0) {
            callback();
        }
    }
}

function cacheImages(element, callback) {
    var urls = [];
    function add(url) {
        if (!IMAGE_CACHE[url]) {
            IMAGE_CACHE[url] = true;
            urls.push(url);
        }
    }
    function dive(element){
        if (/^img$/i.test(element.tagName)) {
            add(element.src);
        }
        parseBackgroundImage(
            getPropertyValue(
                getComputedStyle(element), "background-image"
            )
        ).forEach(function(bg){
            if (bg.type == "url") {
                add(bg.url);
            }
        });

        if (element.children) {
            slice(element.children).forEach(dive);
        }
    }

    if (Array.isArray(element)) {
        element.forEach(dive);
    } else {
        dive(element);
    }

    var count = urls.length;
    function next() {
        if (--count <= 0) {
            callback();
        }
    }
    if (count === 0) {
        next();
    }
    urls.forEach(function(url){
        var img = IMAGE_CACHE[url] = new window.Image();
        if (!(/^data:/i.test(url))) {
            img.crossOrigin = "Anonymous";
        }
        img.src = url;
        if (img.complete) {
            next();
        } else {
            img.onload = next;
            img.onerror = function() {
                IMAGE_CACHE[url] = null;
                next();
            };
        }
    });
}

function alphaNumeral(n) {
    var result = "";
    do {
        var r = n % 26;
        result = String.fromCharCode(97 + r) + result;
        n = Math.floor(n / 26);
    } while (n > 0);
    return result;
}

function pushNodeInfo(element, style, group) {
    nodeInfo = Object.create(nodeInfo);
    nodeInfo[element.tagName.toLowerCase()] = {
        element: element,
        style: style
    };
    var decoration = getPropertyValue(style, "text-decoration");
    if (decoration && decoration != "none") {
        var color = getPropertyValue(style, "color");
        decoration.split(/\s+/g).forEach(function(name){
            if (!nodeInfo[name]) {
                nodeInfo[name] = color;
            }
        });
    }

    if (createsStackingContext(style)) {
        nodeInfo._stackingContext = {
            element: element,
            group: group
        };
    }
}

function popNodeInfo() {
    nodeInfo = Object.getPrototypeOf(nodeInfo);
}

function updateClipbox(path) {
    if (nodeInfo._clipbox != null) {
        var box = path.bbox(nodeInfo._matrix);
        if (nodeInfo._clipbox) {
            nodeInfo._clipbox = __WEBPACK_IMPORTED_MODULE_0__geometry__["b" /* Rect */].intersect(nodeInfo._clipbox, box);
        } else {
            nodeInfo._clipbox = box;
        }
    }
}

function emptyClipbox() {
    var cb = nodeInfo._clipbox;
    if (cb == null) {
        return true;
    }
    if (cb) {
        return cb.width() === 0 || cb.height() === 0;
    }
}

function createsStackingContext(style) {
    function prop(name) { return getPropertyValue(style, name); }
    if (prop("transform") != "none" ||
        prop("position") != "static" ||
        prop("z-index") != "auto" ||
        prop("opacity") < 1) {
        return true;
    }
}

function getComputedStyle(element, pseudoElt) {
    return window.getComputedStyle(element, pseudoElt || null);
}

function getPropertyValue(style, prop, defa) {
    var val = style.getPropertyValue(prop);
    if (val == null || val === "") {
        if (browser.webkit) {
            val = style.getPropertyValue("-webkit-" + prop );
        } else if (browser.mozilla) {
            val = style.getPropertyValue("-moz-" + prop );
        } else if (browser.opera) {
            val = style.getPropertyValue("-o-" + prop);
        } else if (browser.msie || browser.edge) {
            val = style.getPropertyValue("-ms-" + prop);
        }
    }
    if (arguments.length > 2 && (val == null || val === "")) {
        return defa;
    } else {
        return val;
    }
}

function pleaseSetPropertyValue(style, prop, value, important) {
    style.setProperty(prop, value, important);
    if (browser.webkit) {
        style.setProperty("-webkit-" + prop, value, important);
    } else if (browser.mozilla) {
        style.setProperty("-moz-" + prop, value, important);
    } else if (browser.opera) {
        style.setProperty("-o-" + prop, value, important);
    } else if (browser.msie || browser.edge) {
        style.setProperty("-ms-" + prop, value, important);
        prop = "ms" + prop.replace(/(^|-)([a-z])/g, function(s, p1, p2){
            return p1 + p2.toUpperCase();
        });
        style[prop] = value;
    }
}

function getBorder(style, side) {
    side = "border-" + side;
    return {
        width: parseFloat(getPropertyValue(style, side + "-width")),
        style: getPropertyValue(style, side + "-style"),
        color: parseColor(getPropertyValue(style, side + "-color"), true)
    };
}

function saveStyle(element, func) {
    var prev = element.style.cssText;
    var result = func();
    element.style.cssText = prev;
    return result;
}

function getBorderRadius(style, side) {
    var r = getPropertyValue(style, "border-" + side + "-radius").split(/\s+/g).map(parseFloat);
    if (r.length == 1) {
        r.push(r[0]);
    }
    return sanitizeRadius({ x: r[0], y: r[1] });
}

function getContentBox(element) {
    var box = element.getBoundingClientRect();
    box = innerBox(box, "border-*-width", element);
    box = innerBox(box, "padding-*", element);
    return box;
}

function innerBox(box, prop, element) {
    var style, wt, wr, wb, wl;
    if (typeof prop == "string") {
        style = getComputedStyle(element);
        wt = parseFloat(getPropertyValue(style, prop.replace("*", "top")));
        wr = parseFloat(getPropertyValue(style, prop.replace("*", "right")));
        wb = parseFloat(getPropertyValue(style, prop.replace("*", "bottom")));
        wl = parseFloat(getPropertyValue(style, prop.replace("*", "left")));
    }
    else if (typeof prop == "number") {
        wt = wr = wb = wl = prop;
    }
    return {
        top    : box.top + wt,
        right  : box.right - wr,
        bottom : box.bottom - wb,
        left   : box.left + wl,
        width  : box.right - box.left - wr - wl,
        height : box.bottom - box.top - wb - wt
    };
}

function getTransform(style) {
    var transform = getPropertyValue(style, "transform");
    if (transform == "none") {
        return null;
    }
    var matrix = /^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(transform);
    if (matrix) {
        var origin = getPropertyValue(style, "transform-origin");
        matrix = matrix[1].split(/\s*,\s*/g).map(parseFloat);
        origin = origin.split(/\s+/g).map(parseFloat);
        return {
            matrix: matrix,
            origin: origin
        };
    }
}

function radiansToDegrees(radians) {
    return ((180 * radians) / Math.PI) % 360;
}

function parseAngle(angle) {
    var num = parseFloat(angle);
    if (/grad$/.test(angle)) {
        return Math.PI * num / 200;
    }
    else if (/rad$/.test(angle)) {
        return num;
    }
    else if (/turn$/.test(angle)) {
        return Math.PI * num * 2;
    }
    else if (/deg$/.test(angle)) {
        return Math.PI * num / 180;
    }
}

function setTransform(shape, m) {
    m = new __WEBPACK_IMPORTED_MODULE_0__geometry__["a" /* Matrix */](m[0], m[1], m[2], m[3], m[4], m[5]);
    shape.transform(m);
    return m;
}

function setClipping(shape, clipPath) {
    shape.clip(clipPath);
}

function addArcToPath(path, x, y, options) {
    var points = new __WEBPACK_IMPORTED_MODULE_0__geometry__["d" /* Arc */]([ x, y ], options).curvePoints(), i = 1;
    while (i < points.length) {
        path.curveTo(points[i++], points[i++], points[i++]);
    }
}

function sanitizeRadius(r) {
    if (r.x <= 0 || r.y <= 0) {
        r.x = r.y = 0;
    }
    return r;
}

function adjustBorderRadiusForBox(box, rTL, rTR, rBR, rBL) {
    // adjust border radiuses such that the sum of adjacent
    // radiuses is not bigger than the length of the side.
    // seems the correct algorithm is variant (3) from here:
    // http://www.w3.org/Style/CSS/Tracker/issues/29?changelog
    var tl_x = Math.max(0, rTL.x), tl_y = Math.max(0, rTL.y);
    var tr_x = Math.max(0, rTR.x), tr_y = Math.max(0, rTR.y);
    var br_x = Math.max(0, rBR.x), br_y = Math.max(0, rBR.y);
    var bl_x = Math.max(0, rBL.x), bl_y = Math.max(0, rBL.y);

    var f = Math.min(
        box.width / (tl_x + tr_x),
        box.height / (tr_y + br_y),
        box.width / (br_x + bl_x),
        box.height / (bl_y + tl_y)
    );

    if (f < 1) {
        tl_x *= f; tl_y *= f;
        tr_x *= f; tr_y *= f;
        br_x *= f; br_y *= f;
        bl_x *= f; bl_y *= f;
    }

    return {
        tl: { x: tl_x, y: tl_y },
        tr: { x: tr_x, y: tr_y },
        br: { x: br_x, y: br_y },
        bl: { x: bl_x, y: bl_y }
    };
}

function elementRoundBox(element, box, type) {
    var style = getComputedStyle(element);

    var rTL = getBorderRadius(style, "top-left");
    var rTR = getBorderRadius(style, "top-right");
    var rBL = getBorderRadius(style, "bottom-left");
    var rBR = getBorderRadius(style, "bottom-right");

    if (type == "padding" || type == "content") {
        var bt = getBorder(style, "top");
        var br = getBorder(style, "right");
        var bb = getBorder(style, "bottom");
        var bl = getBorder(style, "left");
        rTL.x -= bl.width; rTL.y -= bt.width;
        rTR.x -= br.width; rTR.y -= bt.width;
        rBR.x -= br.width; rBR.y -= bb.width;
        rBL.x -= bl.width; rBL.y -= bb.width;
        if (type == "content") {
            var pt = parseFloat(getPropertyValue(style, "padding-top"));
            var pr = parseFloat(getPropertyValue(style, "padding-right"));
            var pb = parseFloat(getPropertyValue(style, "padding-bottom"));
            var pl = parseFloat(getPropertyValue(style, "padding-left"));
            rTL.x -= pl; rTL.y -= pt;
            rTR.x -= pr; rTR.y -= pt;
            rBR.x -= pr; rBR.y -= pb;
            rBL.x -= pl; rBL.y -= pb;
        }
    }

    if (typeof type == "number") {
        rTL.x -= type; rTL.y -= type;
        rTR.x -= type; rTR.y -= type;
        rBR.x -= type; rBR.y -= type;
        rBL.x -= type; rBL.y -= type;
    }

    return roundBox(box, rTL, rTR, rBR, rBL);
}

// Create a drawing.Path for a rounded rectangle.  Receives the
// bounding box and the border-radiuses in CSS order (top-left,
// top-right, bottom-right, bottom-left).  The radiuses must be
// objects containing x (horiz. radius) and y (vertical radius).
function roundBox(box, rTL0, rTR0, rBR0, rBL0) {
    var tmp = adjustBorderRadiusForBox(box, rTL0, rTR0, rBR0, rBL0);
    var rTL = tmp.tl;
    var rTR = tmp.tr;
    var rBR = tmp.br;
    var rBL = tmp.bl;
    var path = new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({ fill: null, stroke: null });
    path.moveTo(box.left, box.top + rTL.y);
    if (rTL.x) {
        addArcToPath(path, box.left + rTL.x, box.top + rTL.y, {
            startAngle: -180,
            endAngle: -90,
            radiusX: rTL.x,
            radiusY: rTL.y
        });
    }
    path.lineTo(box.right - rTR.x, box.top);
    if (rTR.x) {
        addArcToPath(path, box.right - rTR.x, box.top + rTR.y, {
            startAngle: -90,
            endAngle: 0,
            radiusX: rTR.x,
            radiusY: rTR.y
        });
    }
    path.lineTo(box.right, box.bottom - rBR.y);
    if (rBR.x) {
        addArcToPath(path, box.right - rBR.x, box.bottom - rBR.y, {
            startAngle: 0,
            endAngle: 90,
            radiusX: rBR.x,
            radiusY: rBR.y
        });
    }
    path.lineTo(box.left + rBL.x, box.bottom);
    if (rBL.x) {
        addArcToPath(path, box.left + rBL.x, box.bottom - rBL.y, {
            startAngle: 90,
            endAngle: 180,
            radiusX: rBL.x,
            radiusY: rBL.y
        });
    }
    return path.close();
}

function formatCounter(val, style) {
    var str = String(parseFloat(val));
    switch (style) {
      case "decimal-leading-zero":
        if (str.length < 2) {
            str = "0" + str;
        }
        return str;
      case "lower-roman":
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["x" /* arabicToRoman */])(val).toLowerCase();
      case "upper-roman":
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["x" /* arabicToRoman */])(val).toUpperCase();
      case "lower-latin":
      case "lower-alpha":
        return alphaNumeral(val - 1);
      case "upper-latin":
      case "upper-alpha":
        return alphaNumeral(val - 1).toUpperCase();
      default:
        return str;
    }
}

function evalPseudoElementContent(element, content) {
    function displayCounter(name, style, separator) {
        if (!separator) {
            return formatCounter(getCounter(name) || 0, style);
        }
        separator = separator.replace(/^\s*(["'])(.*)\1\s*$/, "$2");
        return getAllCounters(name).map(function(val){
            return formatCounter(val, style);
        }).join(separator);
    }
    var a = splitProperty(content, /^\s+/);
    var result = [], m;
    a.forEach(function(el){
        var tmp;
        if ((m = /^\s*(["'])(.*)\1\s*$/.exec(el))) {
            result.push(m[2].replace(/\\([0-9a-f]{4})/gi, function(s, p){
                return String.fromCharCode(parseInt(p, 16));
            }));
        }
        else if ((m = /^\s*counter\((.*?)\)\s*$/.exec(el))) {
            tmp = splitProperty(m[1]);
            result.push(displayCounter(tmp[0], tmp[1]));
        }
        else if ((m = /^\s*counters\((.*?)\)\s*$/.exec(el))) {
            tmp = splitProperty(m[1]);
            result.push(displayCounter(tmp[0], tmp[2], tmp[1]));
        }
        else if ((m = /^\s*attr\((.*?)\)\s*$/.exec(el))) {
            result.push(element.getAttribute(m[1]) || "");
        }
        else {
            result.push(el);
        }
    });
    return result.join("");
}

function getCssText(style) {
    if (style.cssText) {
        return style.cssText;
    }
    // Status: NEW.  Report year: 2002.  Current year: 2014.
    // Nice played, Mozillians.
    // https://bugzilla.mozilla.org/show_bug.cgi?id=137687
    var result = [];
    for (var i = 0; i < style.length; ++i) {
        result.push(style[i] + ": " + getPropertyValue(style, style[i]));
    }
    return result.join(";\n");
}

function _renderWithPseudoElements(element, group) {
    if (element.tagName == KENDO_PSEUDO_ELEMENT) {
        _renderElement(element, group);
        return;
    }
    var fake = [];
    function pseudo(kind, place) {
        var style = getComputedStyle(element, kind);
        updateCounters(style);
        if (style.content && style.content != "normal" && style.content != "none" && style.width != "0px") {
            var psel = element.ownerDocument.createElement(KENDO_PSEUDO_ELEMENT);
            psel.style.cssText = getCssText(style);
            psel.textContent = evalPseudoElementContent(element, style.content);
            element.insertBefore(psel, place);
            fake.push(psel);
        }
    }
    pseudo(":before", element.firstChild);
    pseudo(":after", null);
    var saveClass = element.className;
    element.className += " kendo-pdf-hide-pseudo-elements";
    _renderElement(element, group);
    element.className = saveClass;
    fake.forEach(function(el){ element.removeChild(el); });
}

function _renderElement(element, group) {
    var style = getComputedStyle(element);

    var top = getBorder(style, "top");
    var right = getBorder(style, "right");
    var bottom = getBorder(style, "bottom");
    var left = getBorder(style, "left");

    var rTL0 = getBorderRadius(style, "top-left");
    var rTR0 = getBorderRadius(style, "top-right");
    var rBL0 = getBorderRadius(style, "bottom-left");
    var rBR0 = getBorderRadius(style, "bottom-right");

    var dir = getPropertyValue(style, "direction");

    var backgroundColor = getPropertyValue(style, "background-color");
    backgroundColor = parseColor(backgroundColor);

    var backgroundImage = parseBackgroundImage( getPropertyValue(style, "background-image") );
    var backgroundRepeat = splitProperty( getPropertyValue(style, "background-repeat") );
    var backgroundPosition = splitProperty( getPropertyValue(style, "background-position") );
    var backgroundOrigin = splitProperty( getPropertyValue(style, "background-origin") );
    var backgroundSize = splitProperty( getPropertyValue(style, "background-size") );

    if (browser.msie && browser.version < 10) {
        // IE9 hacks.  getPropertyValue won't return the correct
        // value.  Sucks that we have to do it here, I'd prefer to
        // move it in getPropertyValue, but we don't have the
        // element.
        backgroundPosition = splitProperty(element.currentStyle.backgroundPosition);
    }

    var innerbox = innerBox(element.getBoundingClientRect(), "border-*-width", element);

    // CSS "clip" property - if present, replace the group with a
    // new one which is clipped.  This must happen before drawing
    // the borders and background.
    (function(){
        var clip = getPropertyValue(style, "clip");
        var m = /^\s*rect\((.*)\)\s*$/.exec(clip);
        if (m) {
            var a = m[1].split(/[ ,]+/g);
            var top = a[0] == "auto" ? innerbox.top : parseFloat(a[0]) + innerbox.top;
            var right = a[1] == "auto" ? innerbox.right : parseFloat(a[1]) + innerbox.left;
            var bottom = a[2] == "auto" ? innerbox.bottom : parseFloat(a[2]) + innerbox.top;
            var left = a[3] == "auto" ? innerbox.left : parseFloat(a[3]) + innerbox.left;
            var tmp = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
            var clipPath = new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]()
                .moveTo(left, top)
                .lineTo(right, top)
                .lineTo(right, bottom)
                .lineTo(left, bottom)
                .close();
            setClipping(tmp, clipPath);
            group.append(tmp);
            group = tmp;
            updateClipbox(clipPath);
        }
    })();

    var boxes, i, cells;
    var display = getPropertyValue(style, "display");

    if (display == "table-row") {
        // because of rowspan/colspan, we shouldn't draw background of table row elements on the
        // box given by its getBoundingClientRect, because if we do we risk overwritting a
        // previously rendered cell.  https://github.com/telerik/kendo/issues/4881
        boxes = [];
        for (i = 0, cells = element.children; i < cells.length; ++i) {
            boxes.push(cells[i].getBoundingClientRect());
        }
    } else {
        boxes = element.getClientRects();
        if (boxes.length == 1) {
            // Workaround the missing borders in Chrome!  getClientRects() boxes contains values
            // rounded to integer.  getBoundingClientRect() appears to work fine.  We still need
            // getClientRects() to support cases where there are more boxes (continued inline
            // elements that might have border/background).
            boxes = [ element.getBoundingClientRect() ];
        }
    }

    // This function workarounds another Chrome bug, where boxes returned for a table with
    // border-collapse: collapse will overlap the table border.  Our rendering is not perfect in
    // such case anyway, but with this is better than without it.
    boxes = adjustBoxes(boxes);

    for (i = 0; i < boxes.length; ++i) {
        drawOneBox(boxes[i], i === 0, i == boxes.length - 1);
    }

    // Render links as separate groups.  We can't use boxes returned by element's getClientRects
    // because if display type is "inline" (default for <a>), boxes will not include the height of
    // images inside.  https://github.com/telerik/kendo-ui-core/issues/3359
    if (element.tagName == "A" && element.href && !/^#?$/.test(element.getAttribute("href"))) {
        if (!nodeInfo._avoidLinks || !matches(element, nodeInfo._avoidLinks)) {
            var r = document.createRange();
            r.selectNodeContents(element);
            slice(r.getClientRects()).forEach(function(box){
                var g = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
                g._pdfLink = {
                    url    : element.href,
                    top    : box.top,
                    right  : box.right,
                    bottom : box.bottom,
                    left   : box.left
                };
                group.append(g);
            });
        }
    }

    if (boxes.length > 0 && display == "list-item" && !element.getAttribute("kendo-no-bullet")) {
        drawBullet(boxes[0]);
    }

    // overflow: hidden/auto - if present, replace the group with
    // a new one clipped by the inner box.
    (function(){
        function clipit() {
            var clipPath = elementRoundBox(element, innerbox, "padding");
            var tmp = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
            setClipping(tmp, clipPath);
            group.append(tmp);
            group = tmp;
            updateClipbox(clipPath);
        }
        if (isFormField(element)) {
            clipit();
        } else if (/^(hidden|auto|scroll)/.test(getPropertyValue(style, "overflow"))) {
            clipit();
        } else if (/^(hidden|auto|scroll)/.test(getPropertyValue(style, "overflow-x"))) {
            clipit();
        } else if (/^(hidden|auto|scroll)/.test(getPropertyValue(style, "overflow-y"))) {
            clipit();
        }
    })();

    if (!maybeRenderWidget(element, group)) {
        renderContents(element, group);
    }

    return group; // only utility functions after this line.

    function adjustBoxes(boxes) {
        if (/^td$/i.test(element.tagName)) {
            var table = nodeInfo.table;
            if (table && getPropertyValue(table.style, "border-collapse") == "collapse") {
                var tableBorderLeft = getBorder(table.style, "left").width;
                var tableBorderTop = getBorder(table.style, "top").width;
                // check if we need to adjust
                if (tableBorderLeft === 0 && tableBorderTop === 0) {
                    return boxes; // nope
                }
                var tableBox = table.element.getBoundingClientRect();
                var firstCell = table.element.rows[0].cells[0];
                var firstCellBox = firstCell.getBoundingClientRect();
                if (firstCellBox.top == tableBox.top || firstCellBox.left == tableBox.left) {
                    return slice(boxes).map(function(box){
                        return {
                            left   : box.left + tableBorderLeft,
                            top    : box.top + tableBorderTop,
                            right  : box.right + tableBorderLeft,
                            bottom : box.bottom + tableBorderTop,
                            height : box.height,
                            width  : box.width
                        };
                    });
                }
            }
        }
        return boxes;
    }

    // this function will be called to draw each border.  it
    // draws starting at origin and the resulted path must be
    // translated/rotated to be placed in the proper position.
    //
    // arguments are named as if it draws the top border:
    //
    //    - `len` the length of the edge
    //    - `Wtop` the width of the edge (i.e. border-top-width)
    //    - `Wleft` the width of the left edge (border-left-width)
    //    - `Wright` the width of the right edge
    //    - `rl` and `rl` -- the border radius on the left and right
    //      (objects containing x and y, for horiz/vertical radius)
    //    - `transform` -- transformation to apply
    //
    function drawEdge(color, len, Wtop, Wleft, Wright, rl, rr, transform) {
        if (Wtop <= 0) {
            return;
        }

        var path, edge = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
        setTransform(edge, transform);
        group.append(edge);

        sanitizeRadius(rl);
        sanitizeRadius(rr);

        // draw main border.  this is the area without the rounded corners
        path = new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
            fill: { color: color },
            stroke: null
        });
        edge.append(path);
        path.moveTo(rl.x ? Math.max(rl.x, Wleft) : 0, 0)
            .lineTo(len - (rr.x ? Math.max(rr.x, Wright) : 0), 0)
            .lineTo(len - Math.max(rr.x, Wright), Wtop)
            .lineTo(Math.max(rl.x, Wleft), Wtop)
            .close();

        if (rl.x) {
            drawRoundCorner(Wleft, rl, [ -1, 0, 0, 1, rl.x, 0 ]);
        }

        if (rr.x) {
            drawRoundCorner(Wright, rr, [ 1, 0, 0, 1, len - rr.x, 0 ]);
        }

        // draws one round corner, starting at origin (needs to be
        // translated/rotated to be placed properly).
        function drawRoundCorner(Wright, r, transform) {
            var angle = Math.PI/2 * Wright / (Wright + Wtop);

            // not sanitizing this one, because negative values
            // are useful to fill the box correctly.
            var ri = {
                x: r.x - Wright,
                y: r.y - Wtop
            };

            var path = new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
                fill: { color: color },
                stroke: null
            }).moveTo(0, 0);

            setTransform(path, transform);

            addArcToPath(path, 0, r.y, {
                startAngle: -90,
                endAngle: -radiansToDegrees(angle),
                radiusX: r.x,
                radiusY: r.y
            });

            if (ri.x > 0 && ri.y > 0) {
                path.lineTo(ri.x * Math.cos(angle), r.y - ri.y * Math.sin(angle));
                addArcToPath(path, 0, r.y, {
                    startAngle: -radiansToDegrees(angle),
                    endAngle: -90,
                    radiusX: ri.x,
                    radiusY: ri.y,
                    anticlockwise: true
                });
            }
            else if (ri.x > 0) {
                path.lineTo(ri.x, Wtop)
                    .lineTo(0, Wtop);
            }
            else {
                path.lineTo(ri.x, Wtop)
                    .lineTo(ri.x, 0);
            }

            edge.append(path.close());
        }
    }

    function drawBackground(box) {
        var background = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
        setClipping(background, roundBox(box, rTL0, rTR0, rBR0, rBL0));
        group.append(background);

        if (backgroundColor) {
            var path = new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
                fill: { color: backgroundColor.toCssRgba() },
                stroke: null
            });
            path.moveTo(box.left, box.top)
                .lineTo(box.right, box.top)
                .lineTo(box.right, box.bottom)
                .lineTo(box.left, box.bottom)
                .close();
            background.append(path);
        }

        for (var i = backgroundImage.length; --i >= 0;) {
            drawOneBackground(
                background, box,
                backgroundImage[i],
                backgroundRepeat[i % backgroundRepeat.length],
                backgroundPosition[i % backgroundPosition.length],
                backgroundOrigin[i % backgroundOrigin.length],
                backgroundSize[i % backgroundSize.length]
            );
        }
    }

    function drawOneBackground(group, box, background, backgroundRepeat, backgroundPosition, backgroundOrigin, backgroundSize) {
        if (!background || (background == "none")) {
            return;
        }

        if (background.type == "url") {
            // SVG taints the canvas, can't draw it.
            if (/^url\(\"data:image\/svg/i.test(background.url)) {
                return;
            }
            var img = IMAGE_CACHE[background.url];
            if (img && img.width > 0 && img.height > 0) {
                drawBackgroundImage(group, box, img.width, img.height, function(group, rect){
                    group.append(new __WEBPACK_IMPORTED_MODULE_4__drawing__["g" /* Image */](background.url, rect));
                });
            }
        } else if (background.type == "linear") {
            drawBackgroundImage(group, box, box.width, box.height, gradientRenderer(background));
        } else {
            return;
        }

        function drawBackgroundImage(group, box, img_width, img_height, renderBG) {
            var aspect_ratio = img_width / img_height, f;

            // for background-origin: border-box the box is already appropriate
            var orgBox = box;
            if (backgroundOrigin == "content-box") {
                orgBox = innerBox(orgBox, "border-*-width", element);
                orgBox = innerBox(orgBox, "padding-*", element);
            } else if (backgroundOrigin == "padding-box") {
                orgBox = innerBox(orgBox, "border-*-width", element);
            }

            if (!/^\s*auto(\s+auto)?\s*$/.test(backgroundSize)) {
                if (backgroundSize == "contain") {
                    f = Math.min(orgBox.width / img_width,
                                 orgBox.height / img_height);
                    img_width *= f;
                    img_height *= f;
                }
                else if (backgroundSize == "cover") {
                    f = Math.max(orgBox.width / img_width,
                                 orgBox.height / img_height);
                    img_width *= f;
                    img_height *= f;
                }
                else {
                    var size = backgroundSize.split(/\s+/g);
                    // compute width
                    if (/%$/.test(size[0])) {
                        img_width = orgBox.width * parseFloat(size[0]) / 100;
                    } else {
                        img_width = parseFloat(size[0]);
                    }
                    // compute height
                    if (size.length == 1 || size[1] == "auto") {
                        img_height = img_width / aspect_ratio;
                    } else if (/%$/.test(size[1])) {
                        img_height = orgBox.height * parseFloat(size[1]) / 100;
                    } else {
                        img_height = parseFloat(size[1]);
                    }
                }
            }

            var pos = String(backgroundPosition);

            // IE sometimes reports single-word positions
            // https://github.com/telerik/kendo-ui-core/issues/2786
            //
            // it seems to switch to percentages when the horizontal
            // position is not "center", therefore we don't handle
            // multi-word cases here.  All other browsers return
            // percentages or pixels instead of keywords.  At least
            // for now...
            switch (pos) {
              case "bottom" : pos = "50% 100%"; break;
              case "top"    : pos = "50% 0"; break;
              case "left"   : pos = "0 50%"; break;
              case "right"  : pos = "100% 50%"; break;
              case "center" : pos = "50% 50%"; break;
            }

            pos = pos.split(/\s+/);
            if (pos.length == 1) {
                pos[1] = "50%";
            }

            if (/%$/.test(pos[0])) {
                pos[0] = parseFloat(pos[0]) / 100 * (orgBox.width - img_width);
            } else {
                pos[0] = parseFloat(pos[0]);
            }
            if (/%$/.test(pos[1])) {
                pos[1] = parseFloat(pos[1]) / 100 * (orgBox.height - img_height);
            } else {
                pos[1] = parseFloat(pos[1]);
            }

            var rect = new __WEBPACK_IMPORTED_MODULE_0__geometry__["b" /* Rect */]([ orgBox.left + pos[0], orgBox.top + pos[1] ], [ img_width, img_height ]);

            // XXX: background-repeat could be implemented more
            //      efficiently as a fill pattern (at least for PDF
            //      output, probably SVG too).

            function rewX() {
                while (rect.origin.x > box.left) {
                    rect.origin.x -= img_width;
                }
            }

            function rewY() {
                while (rect.origin.y > box.top) {
                    rect.origin.y -= img_height;
                }
            }

            function repeatX() {
                while (rect.origin.x < box.right) {
                    renderBG(group, rect.clone());
                    rect.origin.x += img_width;
                }
            }

            if (backgroundRepeat == "no-repeat") {
                renderBG(group, rect);
            }
            else if (backgroundRepeat == "repeat-x") {
                rewX();
                repeatX();
            }
            else if (backgroundRepeat == "repeat-y") {
                rewY();
                while (rect.origin.y < box.bottom) {
                    renderBG(group, rect.clone());
                    rect.origin.y += img_height;
                }
            }
            else if (backgroundRepeat == "repeat") {
                rewX();
                rewY();
                var origin = rect.origin.clone();
                while (rect.origin.y < box.bottom) {
                    rect.origin.x = origin.x;
                    repeatX();
                    rect.origin.y += img_height;
                }
            }
        }
    }

    function drawBullet() {
        var listStyleType = getPropertyValue(style, "list-style-type");
        if (listStyleType == "none") {
            return;
        }
        var listStylePosition = getPropertyValue(style, "list-style-position");

        function _drawBullet(f) {
            saveStyle(element, function(){
                element.style.position = "relative";
                var bullet = element.ownerDocument.createElement(KENDO_PSEUDO_ELEMENT);
                bullet.style.position = "absolute";
                bullet.style.boxSizing = "border-box";
                if (listStylePosition == "outside") {
                    bullet.style.width = "6em";
                    bullet.style.left = "-6.8em";
                    bullet.style.textAlign = "right";
                } else {
                    bullet.style.left = "0px";
                }
                f(bullet);
                element.insertBefore(bullet, element.firstChild);
                renderElement(bullet, group);
                element.removeChild(bullet);
            });
        }

        function elementIndex(f) {
            var a = element.parentNode.children;
            var k = element.getAttribute("kendo-split-index");
            if (k != null) {
                return f(k|0, a.length);
            }
            for (var i = 0; i < a.length; ++i) {
                if (a[i] === element) {
                    return f(i, a.length);
                }
            }
        }

        switch (listStyleType) {
          case "circle":
          case "disc":
          case "square":
            _drawBullet(function(bullet){
                // XXX: the science behind these values is called "trial and error".
                bullet.style.fontSize = "60%";
                bullet.style.lineHeight = "200%";
                bullet.style.paddingRight = "0.5em";
                bullet.style.fontFamily = "DejaVu Serif";
                bullet.innerHTML = {
                    "disc"   : "\u25cf",
                    "circle" : "\u25ef",
                    "square" : "\u25a0"
                }[listStyleType];
            });
            break;

          case "decimal":
          case "decimal-leading-zero":
            _drawBullet(function(bullet){
                elementIndex(function(idx){
                    ++idx;
                    if (listStyleType == "decimal-leading-zero" && idx < 10) {
                        idx = "0" + idx;
                    }
                    bullet.innerHTML = idx + ".";
                });
            });
            break;

          case "lower-roman":
          case "upper-roman":
            _drawBullet(function(bullet){
                elementIndex(function(idx){
                    idx = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["x" /* arabicToRoman */])(idx + 1);
                    if (listStyleType == "upper-roman") {
                        idx = idx.toUpperCase();
                    }
                    bullet.innerHTML = idx + ".";
                });
            });
            break;

          case "lower-latin":
          case "lower-alpha":
          case "upper-latin":
          case "upper-alpha":
            _drawBullet(function(bullet){
                elementIndex(function(idx){
                    idx = alphaNumeral(idx);
                    if (/^upper/i.test(listStyleType)) {
                        idx = idx.toUpperCase();
                    }
                    bullet.innerHTML = idx + ".";
                });
            });
            break;
        }
    }

    // draws a single border box
    function drawOneBox(box, isFirst, isLast) {
        if (box.width === 0 || box.height === 0) {
            return;
        }

        drawBackground(box);

        var shouldDrawLeft = (left.width > 0 && ((isFirst && dir == "ltr") || (isLast && dir == "rtl")));
        var shouldDrawRight = (right.width > 0 && ((isLast && dir == "ltr") || (isFirst && dir == "rtl")));

        // The most general case is that the 4 borders have different widths and border
        // radiuses.  The way that is handled is by drawing 3 Paths for each border: the
        // straight line, and two round corners which represent half of the entire rounded
        // corner.  To simplify code those shapes are drawed at origin (by the drawEdge
        // function), then translated/rotated into the right position.
        //
        // However, this leads to poor results due to rounding in the simpler cases where
        // borders are straight lines.  Therefore we handle a few such cases separately with
        // straight lines. C^wC^wC^w -- nope, scratch that.  poor rendering was because of a bug
        // in Chrome (getClientRects() returns rounded integer values rather than exact floats.
        // web dev is still a ghetto.)

        // first, just in case there is no border...
        if (top.width === 0 && left.width === 0 && right.width === 0 && bottom.width === 0) {
            return;
        }

        // START paint borders
        // if all borders have equal colors...
        if (top.color == right.color && top.color == bottom.color && top.color == left.color) {

            // if same widths too, we can draw the whole border by stroking a single path.
            if (top.width == right.width && top.width == bottom.width && top.width == left.width)
            {
                if (shouldDrawLeft && shouldDrawRight) {
                    // reduce box by half the border width, so we can draw it by stroking.
                    box = innerBox(box, top.width/2);

                    // adjust the border radiuses, again by top.width/2, and make the path element.
                    var path = elementRoundBox(element, box, top.width/2);
                    path.options.stroke = {
                        color: top.color,
                        width: top.width
                    };
                    group.append(path);
                    return;
                }
            }
        }

        // if border radiuses are zero and widths are at most one pixel, we can again use simple
        // paths.
        if (rTL0.x === 0 && rTR0.x === 0 && rBR0.x === 0 && rBL0.x === 0) {
            // alright, 1.9px will do as well.  the difference in color blending should not be
            // noticeable.
            if (top.width < 2 && left.width < 2 && right.width < 2 && bottom.width < 2) {
                // top border
                if (top.width > 0) {
                    group.append(
                        new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
                            stroke: { width: top.width, color: top.color }
                        })
                            .moveTo(box.left, box.top + top.width/2)
                            .lineTo(box.right, box.top + top.width/2)
                    );
                }

                // bottom border
                if (bottom.width > 0) {
                    group.append(
                        new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
                            stroke: { width: bottom.width, color: bottom.color }
                        })
                            .moveTo(box.left, box.bottom - bottom.width/2)
                            .lineTo(box.right, box.bottom - bottom.width/2)
                    );
                }

                // left border
                if (shouldDrawLeft) {
                    group.append(
                        new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
                            stroke: { width: left.width, color: left.color }
                        })
                            .moveTo(box.left + left.width/2, box.top)
                            .lineTo(box.left + left.width/2, box.bottom)
                    );
                }

                // right border
                if (shouldDrawRight) {
                    group.append(
                        new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({
                            stroke: { width: right.width, color: right.color }
                        })
                            .moveTo(box.right - right.width/2, box.top)
                            .lineTo(box.right - right.width/2, box.bottom)
                    );
                }

                return;
            }
        }
        // END paint borders

        var tmp = adjustBorderRadiusForBox(box, rTL0, rTR0, rBR0, rBL0);
        var rTL = tmp.tl;
        var rTR = tmp.tr;
        var rBR = tmp.br;
        var rBL = tmp.bl;

        // top border
        drawEdge(top.color,
                 box.width, top.width, left.width, right.width,
                 rTL, rTR,
                 [ 1, 0, 0, 1, box.left, box.top ]);

        // bottom border
        drawEdge(bottom.color,
                 box.width, bottom.width, right.width, left.width,
                 rBR, rBL,
                 [ -1, 0, 0, -1, box.right, box.bottom ]);

        // for left/right borders we need to invert the border-radiuses
        function inv(p) {
            return { x: p.y, y: p.x };
        }

        // left border
        drawEdge(left.color,
                 box.height, left.width, bottom.width, top.width,
                 inv(rBL), inv(rTL),
                 [ 0, -1, 1, 0, box.left, box.bottom ]);

        // right border
        drawEdge(right.color,
                 box.height, right.width, top.width, bottom.width,
                 inv(rTR), inv(rBR),
                 [ 0, 1, -1, 0, box.right, box.top ]);
    }
}

function gradientRenderer(gradient) {
    return function(group, rect) {
        var width = rect.width(), height = rect.height();

        switch (gradient.type) {
          case "linear":

            // figure out the angle.
            var angle = gradient.angle != null ? gradient.angle : Math.PI;
            switch (gradient.to) {
              case "top":
                angle = 0;
                break;
              case "left":
                angle = -Math.PI / 2;
                break;
              case "bottom":
                angle = Math.PI;
                break;
              case "right":
                angle = Math.PI / 2;
                break;
              case "top left": case "left top":
                angle = -Math.atan2(height, width);
                break;
              case "top right": case "right top":
                angle = Math.atan2(height, width);
                break;
              case "bottom left": case "left bottom":
                angle = Math.PI + Math.atan2(height, width);
                break;
              case "bottom right": case "right bottom":
                angle = Math.PI - Math.atan2(height, width);
                break;
            }

            if (gradient.reverse) {
                angle -= Math.PI;
            }

            // limit the angle between 0..2PI
            angle %= 2 * Math.PI;
            if (angle < 0) {
                angle += 2 * Math.PI;
            }

            // compute gradient's start/end points.  here len is the length of the gradient line
            // and x,y is the end point relative to the center of the rectangle in conventional
            // (math) axis direction.

            // this is the original (unscaled) length of the gradient line.  needed to deal with
            // absolutely positioned color stops.  formula from the CSS spec:
            // http://dev.w3.org/csswg/css-images-3/#linear-gradient-syntax
            var pxlen = Math.abs(width * Math.sin(angle)) + Math.abs(height * Math.cos(angle));

            // The math below is pretty simple, but it took a while to figure out.  We compute x
            // and y, the *end* of the gradient line.  However, we want to transform them into
            // element-based coordinates (SVG's gradientUnits="objectBoundingBox").  That means,
            // x=0 is the left edge, x=1 is the right edge, y=0 is the top edge and y=1 is the
            // bottom edge.
            //
            // A naive approach would use the original angle for these calculations.  Say we'd
            // like to draw a gradient angled at 45deg in a 100x400 box.  When we use
            // objectBoundingBox, the renderer will draw it in a 1x1 *square* box, and then
            // scale that to the desired dimensions.  The 45deg angle will look more like 70deg
            // after scaling.  SVG (http://www.w3.org/TR/SVG/pservers.html#LinearGradients) says
            // the following:
            //
            //     When gradientUnits="objectBoundingBox" and 'gradientTransform' is the
            //     identity matrix, the normal of the linear gradient is perpendicular to the
            //     gradient vector in object bounding box space (i.e., the abstract coordinate
            //     system where (0,0) is at the top/left of the object bounding box and (1,1) is
            //     at the bottom/right of the object bounding box). When the object's bounding
            //     box is not square, the gradient normal which is initially perpendicular to
            //     the gradient vector within object bounding box space may render
            //     non-perpendicular relative to the gradient vector in user space. If the
            //     gradient vector is parallel to one of the axes of the bounding box, the
            //     gradient normal will remain perpendicular. This transformation is due to
            //     application of the non-uniform scaling transformation from bounding box space
            //     to user space.
            //
            // which is an extremely long and confusing way to tell what I just said above.
            //
            // For this reason we need to apply the reverse scaling to the original angle, so
            // that when it'll finally be rendered it'll actually be at the desired slope.  Now
            // I'll let you figure out the math yourself.

            var scaledAngle = Math.atan(width * Math.tan(angle) / height);
            var sin = Math.sin(scaledAngle), cos = Math.cos(scaledAngle);
            var len = Math.abs(sin) + Math.abs(cos);
            var x = len/2 * sin;
            var y = len/2 * cos;

            // Because of the arctangent, our scaledAngle ends up between -PI/2..PI/2, possibly
            // losing the intended direction of the gradient.  The following fixes it.
            if (angle > Math.PI/2 && angle <= 3*Math.PI/2) {
                x = -x;
                y = -y;
            }

            // compute the color stops.
            var implicit = [], right = 0;
            var stops = gradient.stops.map(function(s, i){
                var offset = s.percent;
                if (offset) {
                    offset = parseFloat(offset) / 100;
                } else if (s.length) {
                    offset = parseFloat(s.length) / pxlen;
                } else if (i === 0) {
                    offset = 0;
                } else if (i == gradient.stops.length - 1) {
                    offset = 1;
                }
                var stop = {
                    color: s.color.toCssRgba(),
                    offset: offset
                };
                if (offset != null) {
                    right = offset;
                    // fix implicit offsets
                    implicit.forEach(function(s, i){
                        var stop = s.stop;
                        stop.offset = s.left + (right - s.left) * (i + 1) / (implicit.length + 1);
                    });
                    implicit = [];
                } else {
                    implicit.push({ left: right, stop: stop });
                }
                return stop;
            });

            var start = [ 0.5 - x, 0.5 + y ];
            var end = [ 0.5 + x, 0.5 - y ];

            // finally, draw it.
            group.append(
                __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */].fromRect(rect)
                    .stroke(null)
                    .fill(new __WEBPACK_IMPORTED_MODULE_4__drawing__["h" /* LinearGradient */]({
                        start     : start,
                        end       : end,
                        stops     : stops,
                        userSpace : false
                    }))
            );
            break;
          case "radial":
            // XXX:
            if (window.console && window.console.log) {
                window.console.log("Radial gradients are not yet supported in HTML renderer");
            }
            break;
        }
    };
}

function maybeRenderWidget(element, group) {
    var visual;

    if (element._kendoExportVisual) {
        visual = element._kendoExportVisual();
    } else if (window.kendo && window.kendo.jQuery && element.getAttribute(window.kendo.attr("role"))) {
        var widget = window.kendo.widgetInstance(window.kendo.jQuery(element));
        if (widget && (widget.exportDOMVisual || widget.exportVisual)) {
            if (widget.exportDOMVisual) {
                visual = widget.exportDOMVisual();
            } else {
                visual = widget.exportVisual();
            }
        }
    }

    if (!visual) {
        return false;
    }

    var wrap = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
    wrap.children.push(visual);

    var bbox = element.getBoundingClientRect();
    wrap.transform(__WEBPACK_IMPORTED_MODULE_0__geometry__["c" /* transform */]().translate(bbox.left, bbox.top));

    group.append(wrap);

    return true;
}

function renderImage(element, url, group) {
    var box = getContentBox(element);
    var rect = new __WEBPACK_IMPORTED_MODULE_0__geometry__["b" /* Rect */]([ box.left, box.top ], [ box.width, box.height ]);
    var image = new __WEBPACK_IMPORTED_MODULE_4__drawing__["g" /* Image */](url, rect);
    setClipping(image, elementRoundBox(element, box, "content"));
    group.append(image);
}

function zIndexSort(a, b) {
    var sa = getComputedStyle(a);
    var sb = getComputedStyle(b);
    var za = parseFloat(getPropertyValue(sa, "z-index"));
    var zb = parseFloat(getPropertyValue(sb, "z-index"));
    var pa = getPropertyValue(sa, "position");
    var pb = getPropertyValue(sb, "position");
    if (isNaN(za) && isNaN(zb)) {
        if ((/static|absolute/.test(pa)) && (/static|absolute/.test(pb))) {
            return 0;
        }
        if (pa == "static") {
            return -1;
        }
        if (pb == "static") {
            return 1;
        }
        return 0;
    }
    if (isNaN(za)) {
        return zb === 0 ? 0 : zb > 0 ? -1 : 1;
    }
    if (isNaN(zb)) {
        return za === 0 ? 0 : za > 0 ? 1 : -1;
    }
    return parseFloat(za) - parseFloat(zb);
}

function isFormField(element) {
    return /^(?:textarea|select|input)$/i.test(element.tagName);
}

function getSelectedOption(element) {
    if (element.selectedOptions && element.selectedOptions.length > 0) {
        return element.selectedOptions[0];
    }
    return element.options[element.selectedIndex];
}

function renderCheckbox(element, group) {
    var style = getComputedStyle(element);
    var color = getPropertyValue(style, "color");
    var box = element.getBoundingClientRect();
    if (element.type == "checkbox") {
        group.append(
            __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */].fromRect(
                new __WEBPACK_IMPORTED_MODULE_0__geometry__["b" /* Rect */]([ box.left+1, box.top+1 ],
                             [ box.width-2, box.height-2 ])
            ).stroke(color, 1)
        );
        if (element.checked) {
            // fill a rectangle inside?  looks kinda ugly.
            // group.append(
            //     Path.fromRect(
            //         new geo.Rect([ box.left+4, box.top+4 ],
            //                      [ box.width-8, box.height-8])
            //     ).fill(color).stroke(null)
            // );

            // let's draw a checkmark instead.  artistic, eh?
            group.append(
                new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]()
                    .stroke(color, 1.2)
                    .moveTo(box.left + 0.22 * box.width,
                            box.top + 0.55 * box.height)
                    .lineTo(box.left + 0.45 * box.width,
                            box.top + 0.75 * box.height)
                    .lineTo(box.left + 0.78 * box.width,
                            box.top + 0.22 * box.width)
            );
        }
    } else {
        group.append(
            new __WEBPACK_IMPORTED_MODULE_4__drawing__["i" /* Circle */](
                new __WEBPACK_IMPORTED_MODULE_0__geometry__["e" /* Circle */]([
                    (box.left + box.right) / 2,
                    (box.top + box.bottom) / 2
                ], Math.min(box.width-2, box.height-2) / 2)
            ).stroke(color, 1)
        );
        if (element.checked) {
            group.append(
                new __WEBPACK_IMPORTED_MODULE_4__drawing__["i" /* Circle */](
                    new __WEBPACK_IMPORTED_MODULE_0__geometry__["e" /* Circle */]([
                        (box.left + box.right) / 2,
                        (box.top + box.bottom) / 2
                    ], Math.min(box.width-8, box.height-8) / 2)
                ).fill(color).stroke(null)
            );
        }
    }
}

function renderFormField(element, group) {
    var tag = element.tagName.toLowerCase();
    if (tag == "input" && (element.type == "checkbox" || element.type == "radio")) {
        return renderCheckbox(element, group);
    }
    var p = element.parentNode;
    var doc = element.ownerDocument;
    var el = doc.createElement(KENDO_PSEUDO_ELEMENT);
    var option;
    el.style.cssText = getCssText(getComputedStyle(element));
    if (tag == "input") {
        el.style.whiteSpace = "pre";
    }
    if (tag == "select" || tag == "textarea") {
        el.style.overflow = "auto";
    }
    if (tag == "select") {
        if (element.multiple) {
            for (var i = 0; i < element.options.length; ++i) {
                option = doc.createElement(KENDO_PSEUDO_ELEMENT);
                option.style.cssText = getCssText(getComputedStyle(element.options[i]));
                option.style.display = "block"; // IE9 messes up without this
                option.textContent = element.options[i].textContent;
                el.appendChild(option);
            }
        } else {
            option = getSelectedOption(element);
            if (option) {
                el.textContent = option.textContent;
            }
        }
    } else {
        el.textContent = element.value;
    }
    p.insertBefore(el, element);
    el.scrollLeft = element.scrollLeft;
    el.scrollTop = element.scrollTop;

    // must temporarily hide the original element, otherwise it
    // may affect layout of the fake element we want to render.
    element.style.display = "none";

    renderContents(el, group);
    element.style.display = "";
    p.removeChild(el);
}

function renderContents(element, group) {
    if (nodeInfo._stackingContext.element === element) {
        // the group that was set in pushNodeInfo might have
        // changed due to clipping/transforms, update it here.
        nodeInfo._stackingContext.group = group;
    }
    switch (element.tagName.toLowerCase()) {
      case "img":
        renderImage(element, element.src, group);
        break;

      case "canvas":
        try {
            renderImage(element, element.toDataURL("image/png"), group);
        } catch (ex) {
            // tainted; can't draw it, ignore.
        }
        break;

      case "textarea":
      case "input":
      case "select":
        renderFormField(element, group);
        break;

      default:
        var children = [], floats = [], positioned = [];
        for (var i = element.firstChild; i; i = i.nextSibling) {
            switch (i.nodeType) {
              case 3:         // Text
                if (/\S/.test(i.data)) {
                    renderText(element, i, group);
                }
                break;
              case 1:         // Element
                var style = getComputedStyle(i);
                var floating = getPropertyValue(style, "float");
                var position = getPropertyValue(style, "position");
                if (position != "static") {
                    positioned.push(i);
                }
                else if (floating != "none") {
                    floats.push(i);
                } else {
                    children.push(i);
                }
                break;
            }
        }

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["y" /* mergeSort */])(children, zIndexSort).forEach(function(el){ renderElement(el, group); });
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["y" /* mergeSort */])(floats, zIndexSort).forEach(function(el){ renderElement(el, group); });
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util__["y" /* mergeSort */])(positioned, zIndexSort).forEach(function(el){ renderElement(el, group); });
    }
}

function renderText(element, node, group) {
    if (emptyClipbox()) {
        return;
    }
    var style = getComputedStyle(element);

    if (parseFloat(getPropertyValue(style, "text-indent")) < -500) {
        // assume it should not be displayed.  the slider's
        // draggable handle displays a Drag text for some reason,
        // having text-indent: -3333px.
        return;
    }

    var text = node.data;
    var start = 0;
    var end = text.search(/\S\s*$/) + 1;

    if (!end) {
        return; // whitespace-only node
    }

    var fontSize = getPropertyValue(style, "font-size");
    var lineHeight = getPropertyValue(style, "line-height");

    // simply getPropertyValue("font") doesn't work in Firefox :-\
    var font = [
        getPropertyValue(style, "font-style"),
        getPropertyValue(style, "font-variant"),
        getPropertyValue(style, "font-weight"),
        fontSize, // no need for line height here; it breaks layout in FF
        getPropertyValue(style, "font-family")
    ].join(" ");

    fontSize = parseFloat(fontSize);
    lineHeight = parseFloat(lineHeight);

    if (fontSize === 0) {
        return;
    }

    var color = getPropertyValue(style, "color");
    var range = element.ownerDocument.createRange();
    var align = getPropertyValue(style, "text-align");
    var isJustified = align == "justify";
    var columnCount = getPropertyValue(style, "column-count", 1);
    var whiteSpace = getPropertyValue(style, "white-space");
    var textTransform = getPropertyValue(style, "text-transform");

    // IE shrinks the text with text-overflow: ellipsis,
    // apparently because the returned bounding box for the range
    // is limited to the visible area minus space for the dots,
    // instead of being the full width of the text.
    //
    // https://github.com/telerik/kendo/issues/5232
    var textOverflow, saveTextOverflow;
    if (browser.msie || browser.edge) {
        textOverflow = style.textOverflow;             // computed style
        if (textOverflow == "ellipsis") {
            saveTextOverflow = element.style.textOverflow; // own style.
            element.style.textOverflow = "clip";
        }
    }

    // A line of 500px, with a font of 12px, contains an average of 80 characters, but since we
    // err, we'd like to guess a bigger number rather than a smaller one.  Multiplying by 5
    // seems to be a good option.
    var estimateLineLength = element.getBoundingClientRect().width / fontSize * 5;
    if (estimateLineLength === 0) {
        estimateLineLength = 500;
    }

    // we'll maintain this so we can workaround bugs in Chrome's Range.getClientRects
    // https://github.com/telerik/kendo/issues/5740
    var prevLineBottom = null;

    var underline = nodeInfo["underline"];
    var lineThrough = nodeInfo["line-through"];
    var overline = nodeInfo["overline"];
    var hasDecoration = underline || lineThrough || overline;

    // doChunk returns true when all text has been rendered
    while (!doChunk()) {}

    if ((browser.msie || browser.edge) && textOverflow == "ellipsis") {
        element.style.textOverflow = saveTextOverflow;
    }

    if (hasDecoration) {
        range.selectNode(node);
        slice(range.getClientRects()).forEach(decorate);
    }

    return;                 // only function declarations after this line

    function actuallyGetRangeBoundingRect(range) {
        // XXX: to be revised when this Chrome bug is fixed:
        // https://bugs.chromium.org/p/chromium/issues/detail?id=612459
        if (browser.msie || browser.edge || browser.chrome) {
            // Workaround browser bugs: IE and Chrome would sometimes
            // return 0 or 1-width rectangles before or after the main
            // one.  https://github.com/telerik/kendo/issues/4674

            // Actually Chrome 50 got worse, since the rectangles can now have the width of a
            // full character, making it hard to tell whether it's a bogus rectangle or valid
            // selection location.  The workaround is to ignore rectangles that fall on the
            // previous line.  https://github.com/telerik/kendo/issues/5740
            var rectangles = range.getClientRects(), box = {
                top    :  Infinity,
                right  : -Infinity,
                bottom : -Infinity,
                left   :  Infinity
            };
            for (var i = 0; i < rectangles.length; ++i) {
                var b = rectangles[i];
                if (b.width <= 1 || b.bottom === prevLineBottom) {
                    continue;   // bogus rectangle
                }
                box.left   = Math.min(b.left   , box.left);
                box.top    = Math.min(b.top    , box.top);
                box.right  = Math.max(b.right  , box.right);
                box.bottom = Math.max(b.bottom , box.bottom);
            }
            box.width = box.right - box.left;
            box.height = box.bottom - box.top;
            return box;
        }
        return range.getBoundingClientRect();
    }

    // Render a chunk of text, typically one line (but for justified text we render each word as
    // a separate Text object, because spacing is variable).  Returns true when it finished the
    // current node.  After each chunk it updates `start` to just after the last rendered
    // character.
    function doChunk() {
        var origStart = start;
        var box, pos = text.substr(start).search(/\S/);
        start += pos;
        if (pos < 0 || start >= end) {
            return true;
        }

        // Select a single character to determine the height of a line of text.  The box.bottom
        // will be essential for us to figure out where the next line begins.
        range.setStart(node, start);
        range.setEnd(node, start + 1);
        box = actuallyGetRangeBoundingRect(range);

        // for justified text we must split at each space, because space has variable width.
        var found = false;
        if (isJustified || columnCount > 1) {
            pos = text.substr(start).search(/\s/);
            if (pos >= 0) {
                // we can only split there if it's on the same line, otherwise we'll fall back
                // to the default mechanism (see findEOL below).
                range.setEnd(node, start + pos);
                var r = actuallyGetRangeBoundingRect(range);
                if (r.bottom == box.bottom) {
                    box = r;
                    found = true;
                    start += pos;
                }
            }
        }

        if (!found) {
            // This code does three things: (1) it selects one line of text in `range`, (2) it
            // leaves the bounding rect of that line in `box` and (3) it returns the position
            // just after the EOL.  We know where the line starts (`start`) but we don't know
            // where it ends.  To figure this out, we select a piece of text and look at the
            // bottom of the bounding box.  If it changes, we have more than one line selected
            // and should retry with a smaller selection.
            //
            // To speed things up, we first try to select all text in the node (`start` ->
            // `end`).  If there's more than one line there, then select only half of it.  And
            // so on.  When we find a value for `end` that fits in one line, we try increasing
            // it (also in halves) until we get to the next line.  The algorithm stops when the
            // right side of the bounding box does not change.
            //
            // One more thing to note is that everything happens in a single Text DOM node.
            // There's no other tags inside it, therefore the left/top coordinates of the
            // bounding box will not change.
            pos = (function findEOL(min, eol, max){
                range.setEnd(node, eol);
                var r = actuallyGetRangeBoundingRect(range);
                if (r.bottom != box.bottom && min < eol) {
                    return findEOL(min, (min + eol) >> 1, eol);
                } else if (r.right != box.right) {
                    box = r;
                    if (eol < max) {
                        return findEOL(eol, (eol + max) >> 1, max);
                    } else {
                        return eol;
                    }
                } else {
                    return eol;
                }
            })(start, Math.min(end, start + estimateLineLength), end);

            if (pos == start) {
                // if EOL is at the start, then no more text fits on this line.  Skip the
                // remainder of this node entirely to avoid a stack overflow.
                return true;
            }
            start = pos;

            pos = range.toString().search(/\s+$/);
            if (pos === 0) {
                return false; // whitespace only; we should not get here.
            }
            if (pos > 0) {
                // eliminate trailing whitespace
                range.setEnd(node, range.startOffset + pos);
                box = actuallyGetRangeBoundingRect(range);
            }
        }

        // another workaround for IE: if we rely on getBoundingClientRect() we'll overlap with the bullet for LI
        // elements.  Calling getClientRects() and using the *first* rect appears to give us the correct location.
        // Note: not to be used in Chrome as it randomly returns a zero-width rectangle from the previous line.
        if (browser.msie || browser.edge) {
            box = range.getClientRects()[0];
        }

        var str = range.toString();
        if (!/^(?:pre|pre-wrap)$/i.test(whiteSpace)) {
            // node with non-significant space -- collapse whitespace.
            str = str.replace(/\s+/g, " ");
        }
        else if (/\t/.test(str)) {
            // with significant whitespace we need to do something about literal TAB characters.
            // There's no TAB glyph in a font so they would be rendered in PDF as an empty box,
            // and the whole text will stretch to fill the original width.  The core PDF lib
            // does not have sufficient context to deal with it.

            // calculate the starting column here, since we initially discarded any whitespace.
            var cc = 0;
            for (pos = origStart; pos < range.startOffset; ++pos) {
                var code = text.charCodeAt(pos);
                if (code == 9) {
                    // when we meet a TAB we must round up to the next tab stop.
                    // in all browsers TABs seem to be 8 characters.
                    cc += 8 - cc % 8;
                } else if (code == 10 || code == 13) {
                    // just in case we meet a newline we must restart.
                    cc = 0;
                } else {
                    // ordinary character --> advance one column
                    cc++;
                }
            }

            // based on starting column, replace any TAB characters in the string we actually
            // have to display with spaces so that they align to columns multiple of 8.
            while ((pos = str.search("\t")) >= 0) {
                var indent = "        ".substr(0, 8 - (cc + pos) % 8);
                str = str.substr(0, pos) + indent + str.substr(pos + 1);
            }
        }

        if (!found) {
            prevLineBottom = box.bottom;
        }
        drawText(str, box);
    }

    function drawText(str, box) {
        // In IE the box height will be approximately lineHeight, while in
        // other browsers it'll (correctly) be the height of the bounding
        // box for the current text/font.  Which is to say, IE sucks again.
        // The only good solution I can think of is to measure the text
        // ourselves and center the bounding box.
        if ((browser.msie || browser.edge) && !isNaN(lineHeight)) {
            var height = getFontHeight(font);
            var top = (box.top + box.bottom - height) / 2;
            box = {
                top    : top,
                right  : box.right,
                bottom : top + height,
                left   : box.left,
                height : height,
                width  : box.right - box.left
            };
        }

        // var path = new Path({ stroke: { color: "red" }});
        // path.moveTo(box.left, box.top)
        //     .lineTo(box.right, box.top)
        //     .lineTo(box.right, box.bottom)
        //     .lineTo(box.left, box.bottom)
        //     .close();
        // group.append(path);

        switch (textTransform) {
          case "uppercase":
            str = str.toUpperCase();
            break;
          case "lowercase":
            str = str.toLowerCase();
            break;
          case "capitalize":
            str = str.replace(/(?:^|\s)\S/g, function (l) { return l.toUpperCase(); });
            break;
        }

        var text = new TextRect(
            str, new __WEBPACK_IMPORTED_MODULE_0__geometry__["b" /* Rect */]([ box.left, box.top ],
                              [ box.width, box.height ]),
            {
                font: font,
                fill: { color: color }
            }
        );
        group.append(text);
    }

    function decorate(box) {
        line(underline, box.bottom);
        line(lineThrough, box.bottom - box.height / 2.7);
        line(overline, box.top);
        function line(color, ypos) {
            if (color) {
                var width = fontSize / 12;
                var path = new __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */]({ stroke: {
                    width: width,
                    color: color
                }});

                ypos -= width;
                path.moveTo(box.left, ypos)
                    .lineTo(box.right, ypos);
                group.append(path);
            }
        }
    }
}

function groupInStackingContext(element, group, zIndex) {
    var main;
    if (zIndex != "auto") {
        // use the current stacking context
        main = nodeInfo._stackingContext.group;
        zIndex = parseFloat(zIndex);
    } else {
        // normal flow — use given container.  we still have to
        // figure out where should we insert this element with the
        // assumption that its z-index is zero, as the group might
        // already contain elements with higher z-index.
        main = group;
        zIndex = 0;
    }
    var a = main.children;
    for (var i = 0; i < a.length; ++i) {
        if (a[i]._dom_zIndex != null && a[i]._dom_zIndex > zIndex) {
            break;
        }
    }

    var tmp = new __WEBPACK_IMPORTED_MODULE_4__drawing__["a" /* Group */]();
    main.insert(i, tmp);
    tmp._dom_zIndex = zIndex;

    if (main !== group) {
        // console.log("Placing", element, "in", nodeInfo._stackingContext.element, "at position", i, " / ", a.length);
        // console.log(a.slice(i+1));

        // if (nodeInfo._matrix) {
        //     tmp.transform(nodeInfo._matrix);
        // }
        if (nodeInfo._clipbox) {
            var m = nodeInfo._matrix.invert();
            var r = nodeInfo._clipbox.transformCopy(m);
            setClipping(tmp, __WEBPACK_IMPORTED_MODULE_4__drawing__["f" /* Path */].fromRect(r));
            // console.log(r);
            // tmp.append(Path.fromRect(r));
            // tmp.append(new Text(element.className || element.id, r.topLeft()));
        }
    }

    return tmp;
}

function renderElement(element, container) {
    var style = getComputedStyle(element);

    updateCounters(style);

    if (/^(style|script|link|meta|iframe|svg|col|colgroup)$/i.test(element.tagName)) {
        return;
    }

    if (nodeInfo._clipbox == null) {
        return;
    }

    var opacity = parseFloat(getPropertyValue(style, "opacity"));
    var visibility = getPropertyValue(style, "visibility");
    var display = getPropertyValue(style, "display");

    if (opacity === 0 || visibility == "hidden" || display == "none") {
        return;
    }

    var tr = getTransform(style);
    var group;

    var zIndex = getPropertyValue(style, "z-index");
    if ((tr || opacity < 1) && zIndex == "auto") {
        zIndex = 0;
    }
    group = groupInStackingContext(element, container, zIndex);

    // XXX: remove at some point
    // group._pdfElement = element;
    // group.options._pdfDebug = "";
    // if (element.id) {
    //     group.options._pdfDebug = "#" + element.id;
    // }
    // if (element.className) {
    //     group.options._pdfDebug += "." + element.className.split(" ").join(".");
    // }

    if (opacity < 1) {
        group.opacity(opacity * group.opacity());
    }

    pushNodeInfo(element, style, group);

    if (!tr) {
        _renderWithPseudoElements(element, group);
    }
    else {
        saveStyle(element, function(){
            // must clear transform, so getBoundingClientRect returns correct values.
            pleaseSetPropertyValue(element.style, "transform", "none", "important");

            // must also clear transitions, so correct values are returned *immediately*
            pleaseSetPropertyValue(element.style, "transition", "none", "important");

            // the presence of any transform makes it behave like it had position: relative,
            // because why not.
            // http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/
            if (getPropertyValue(style, "position") == "static") {
                // but only if it's not already positioned. :-/
                pleaseSetPropertyValue(element.style, "position", "relative", "important");
            }

            // must translate to origin before applying the CSS
            // transformation, then translate back.
            var bbox = element.getBoundingClientRect();
            var x = bbox.left + tr.origin[0];
            var y = bbox.top + tr.origin[1];
            var m = [ 1, 0, 0, 1, -x, -y ];
            m = mmul(m, tr.matrix);
            m = mmul(m, [ 1, 0, 0, 1, x, y ]);
            m = setTransform(group, m);

            nodeInfo._matrix = nodeInfo._matrix.multiplyCopy(m);

            _renderWithPseudoElements(element, group);
        });
    }

    popNodeInfo();

    //drawDebugBox(element.getBoundingClientRect(), container);
}

// function drawDebugBox(box, group, color) {
//     var path = Path.fromRect(new geo.Rect([ box.left, box.top ], [ box.width, box.height ]));
//     if (color) {
//         path.stroke(color);
//     }
//     group.append(path);
// }

// function dumpTextNode(node) {
//     var txt = node.data.replace(/^\s+/, "");
//     if (txt.length < 100) {
//         console.log(node.data.length + ": |" + txt);
//     } else {
//         console.log(node.data.length + ": |" + txt.substr(0, 50) + "|...|" + txt.substr(-50));
//     }
// }

function mmul(a, b) {
    var a1 = a[0], b1 = a[1], c1 = a[2], d1 = a[3], e1 = a[4], f1 = a[5];
    var a2 = b[0], b2 = b[1], c2 = b[2], d2 = b[3], e2 = b[4], f2 = b[5];
    return [
        a1*a2 + b1*c2,          a1*b2 + b1*d2,
        c1*a2 + d1*c2,          c1*b2 + d1*d2,
        e1*a2 + f1*c2 + e2,     e1*b2 + f1*d2 + f2
    ];
}




//# sourceMappingURL=core.js.map


/***/ }),
/* 697 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__drawing__ = __webpack_require__(95);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pdf__ = __webpack_require__(227);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__html__ = __webpack_require__(695);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__html__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__pdf__["a"]; });
/* unused harmony reexport exportImage */
/* unused harmony reexport exportSVG */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common__ = __webpack_require__(8);
/* unused harmony reexport animationFrame */
/* unused harmony reexport Class */
/* unused harmony reexport Color */
/* unused harmony reexport htmlEncode */
/* unused harmony reexport logToConsole */
/* unused harmony reexport Observable */
/* unused harmony reexport saveAs */
/* unused harmony reexport support */
/* unused harmony reexport template */
/* unused harmony reexport throttle */
/* unused harmony reexport Animation */
/* unused harmony reexport AnimationFactory */
/* unused harmony reexport Arc */
/* unused harmony reexport BaseNode */
/* unused harmony reexport Circle */
/* unused harmony reexport Element */
/* unused harmony reexport Gradient */
/* unused harmony reexport GradientStop */
/* unused harmony reexport Group */
/* unused harmony reexport Image */
/* unused harmony reexport Layout */
/* unused harmony reexport LinearGradient */
/* unused harmony reexport MultiPath */
/* unused harmony reexport ObserversMixin */
/* unused harmony reexport OptionsStore */
/* unused harmony reexport Path */
/* unused harmony reexport PathParser */
/* unused harmony reexport QuadNode */
/* unused harmony reexport RadialGradient */
/* unused harmony reexport Rect */
/* unused harmony reexport ShapesQuadTree */
/* unused harmony reexport Surface */
/* unused harmony reexport SurfaceFactory */
/* unused harmony reexport Text */
/* unused harmony reexport align */
/* unused harmony reexport fit */
/* unused harmony reexport stack */
/* unused harmony reexport vAlign */
/* unused harmony reexport vStack */
/* unused harmony reexport vWrap */
/* unused harmony reexport wrap */
/* unused harmony reexport drawing */
/* unused harmony reexport geometry */
/* unused harmony reexport pdf */















//# sourceMappingURL=main.js.map


/***/ }),
/* 698 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shapes_multi_path__ = __webpack_require__(441);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shapes_path__ = __webpack_require__(141);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shape_map__ = __webpack_require__(699);






var SEGMENT_REGEX = /([a-df-z]{1})([^a-df-z]*)(z)?/gi;
var SPLIT_REGEX = /[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;
var MOVE = "m";
var CLOSE = "z";

function parseParameters(str) {
    var parameters = [];
    str.replace(SPLIT_REGEX, function(match, number) {
        parameters.push(parseFloat(number));
    });
    return parameters;
}

var PathParser = (function (Class) {
    function PathParser () {
        Class.apply(this, arguments);
    }

    if ( Class ) PathParser.__proto__ = Class;
    PathParser.prototype = Object.create( Class && Class.prototype );
    PathParser.prototype.constructor = PathParser;

    PathParser.prototype.parse = function parse (str, options) {
        var multiPath = new __WEBPACK_IMPORTED_MODULE_1__shapes_multi_path__["a" /* default */](options);
        var position = new __WEBPACK_IMPORTED_MODULE_3__geometry_point__["a" /* default */]();
        var previousCommand;

        str.replace(SEGMENT_REGEX, function (match, element, params, closePath) {
            var command = element.toLowerCase();
            var isRelative = command === element;
            var parameters = parseParameters(params.trim());

            if (command === MOVE) {
                if (isRelative) {
                    position.x += parameters[0];
                    position.y += parameters[1];
                } else {
                    position.x = parameters[0];
                    position.y = parameters[1];
                }

                multiPath.moveTo(position.x, position.y);

                if (parameters.length > 2) {
                    command = "l";
                    parameters.splice(0, 2);
                }
            }

            if (__WEBPACK_IMPORTED_MODULE_4__shape_map__["a" /* default */][command]) {
                __WEBPACK_IMPORTED_MODULE_4__shape_map__["a" /* default */][command](
                    multiPath, {
                        parameters: parameters,
                        position: position,
                        isRelative: isRelative,
                        previousCommand: previousCommand
                    }
                );

                if (closePath && closePath.toLowerCase() === CLOSE) {
                    multiPath.close();
                }
            } else if (command !== MOVE) {
                throw new Error("Error while parsing SVG path. Unsupported command: " + command);
            }

            previousCommand = command;
        });

        return multiPath;
    };

    return PathParser;
}(__WEBPACK_IMPORTED_MODULE_0__common__["d" /* Class */]));

PathParser.current = new PathParser();

__WEBPACK_IMPORTED_MODULE_2__shapes_path__["a" /* default */].parse = function(str, options) {
    return PathParser.current.parse(str, options);
};

/* unused harmony default export */ var _unused_webpack_default_export = (PathParser);
//# sourceMappingURL=path-parser.js.map


/***/ }),
/* 699 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(5);



var ShapeMap = {
    l: function(path, options) {
        var parameters = options.parameters;
        var position = options.position;

        for (var i = 0; i < parameters.length; i += 2) {
            var point = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i], parameters[i + 1]);

            if (options.isRelative) {
                point.translateWith(position);
            }

            path.lineTo(point.x, point.y);

            position.x = point.x;
            position.y = point.y;
        }
    },

    c: function(path, options) {
        var parameters = options.parameters;
        var position = options.position;

        for (var i = 0; i < parameters.length; i += 6) {
            var controlOut = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i], parameters[i + 1]);
            var controlIn = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i + 2], parameters[i + 3]);
            var point = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i + 4], parameters[i + 5]);
            if (options.isRelative) {
                controlIn.translateWith(position);
                controlOut.translateWith(position);
                point.translateWith(position);
            }

            path.curveTo(controlOut, controlIn, point);

            position.x = point.x;
            position.y = point.y;
        }
    },

    v: function(path, options) {
        var value = options.isRelative ? 0 : options.position.x;

        toLineParamaters(options.parameters, true, value);
        this.l(path, options);
    },

    h: function(path, options) {
        var value = options.isRelative ? 0 : options.position.y;

        toLineParamaters(options.parameters, false, value);
        this.l(path, options);
    },

    a: function(path, options) {
        var parameters = options.parameters;
        var position = options.position;

        for (var i = 0; i < parameters.length; i += 7) {
            var radiusX = parameters[i];
            var radiusY = parameters[i + 1];
            var rotation = parameters[i + 2];
            var largeArc = parameters[i + 3];
            var swipe = parameters[i + 4];
            var endPoint = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i + 5], parameters[i + 6]);

            if (options.isRelative) {
                endPoint.translateWith(position);
            }
            if (position.x !== endPoint.x || position.y !== endPoint.y) {
                path.arcTo(endPoint, radiusX, radiusY, largeArc, swipe, rotation);

                position.x = endPoint.x;
                position.y = endPoint.y;
            }
        }
    },

    s: function(path, options) {
        var parameters = options.parameters;
        var position = options.position;
        var previousCommand = options.previousCommand;
        var lastControlIn;

        if (previousCommand === "s" || previousCommand === "c") {
            lastControlIn = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["u" /* last */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["u" /* last */])(path.paths).segments).controlIn();
        }

        for (var i = 0; i < parameters.length; i += 4) {
            var controlIn = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i], parameters[i + 1]);
            var endPoint = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i + 2], parameters[i + 3]);
            var controlOut;

            if (options.isRelative) {
                controlIn.translateWith(position);
                endPoint.translateWith(position);
            }

            if (lastControlIn) {
                controlOut = reflectionPoint(lastControlIn, position);
            } else {
                controlOut = position.clone();
            }

            lastControlIn = controlIn;

            path.curveTo(controlOut, controlIn, endPoint);

            position.x = endPoint.x;
            position.y = endPoint.y;
        }
    },

    q: function(path, options) {
        var parameters = options.parameters;
        var position = options.position;

        for (var i = 0; i < parameters.length; i += 4) {
            var controlPoint = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i], parameters[i + 1]);
            var endPoint = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i + 2], parameters[i + 3]);

            if (options.isRelative) {
                controlPoint.translateWith(position);
                endPoint.translateWith(position);
            }

            var cubicControlPoints = quadraticToCubicControlPoints(position, controlPoint, endPoint);

            path.curveTo(cubicControlPoints.controlOut, cubicControlPoints.controlIn, endPoint);

            position.x = endPoint.x;
            position.y = endPoint.y;
        }
    },

    t: function(path, options) {
        var parameters = options.parameters;
        var position = options.position;
        var previousCommand = options.previousCommand;
        var controlPoint;

        if (previousCommand === "q" || previousCommand === "t") {
            var lastSegment = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["u" /* last */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__["u" /* last */])(path.paths).segments);
            controlPoint = lastSegment.controlIn().clone()
                .translateWith(position.scaleCopy(-1 / 3))
                .scale(3 / 2);
        }

        for (var i = 0; i < parameters.length; i += 2) {
            var endPoint = new __WEBPACK_IMPORTED_MODULE_0__geometry_point__["a" /* default */](parameters[i], parameters[i + 1]);
            if (options.isRelative) {
                endPoint.translateWith(position);
            }

            if (controlPoint) {
                controlPoint = reflectionPoint(controlPoint, position);
            } else {
                controlPoint = position.clone();
            }

            var cubicControlPoints = quadraticToCubicControlPoints(position, controlPoint, endPoint);

            path.curveTo(cubicControlPoints.controlOut, cubicControlPoints.controlIn, endPoint);

            position.x = endPoint.x;
            position.y = endPoint.y;
        }
    }
};

function toLineParamaters(parameters, isVertical, value) {
    var insertPosition = isVertical ? 0 : 1;

    for (var i = 0; i < parameters.length; i += 2) {
        parameters.splice(i + insertPosition, 0, value);
    }
}

function reflectionPoint(point, center) {
    if (point && center) {
        return center.scaleCopy(2).translate(-point.x, -point.y);
    }
}

var third = 1 / 3;

function quadraticToCubicControlPoints(position, controlPoint, endPoint) {
    var scaledPoint = controlPoint.clone().scale(2 / 3);
    return {
        controlOut: scaledPoint.clone().translateWith(position.scaleCopy(third)),
        controlIn: scaledPoint.translateWith(endPoint.scaleCopy(third))
    };
}

/* harmony default export */ __webpack_exports__["a"] = (ShapeMap);
//# sourceMappingURL=shape-map.js.map


/***/ }),
/* 700 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return deflate; });
/* harmony export (immutable) */ __webpack_exports__["a"] = supportsDeflate;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pako_dist_pako_deflate__ = __webpack_require__(806);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pako_dist_pako_deflate___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_pako_dist_pako_deflate__);


var deflate = __WEBPACK_IMPORTED_MODULE_0_pako_dist_pako_deflate__["deflate"];

function supportsDeflate() {
    return true;
}


//# sourceMappingURL=deflate.js.map


/***/ }),
/* 701 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return exportPDF; });
/* unused harmony export saveAs */
/* unused harmony export toDataURL */
/* unused harmony export toBlob */
/* unused harmony export render */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__core__ = __webpack_require__(433);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__drawing__ = __webpack_require__(95);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry__ = __webpack_require__(53);
/* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */
/* eslint-disable space-infix-ops, space-before-function-paren, array-bracket-spacing, object-curly-spacing */
/* eslint-disable no-nested-ternary, max-params, default-case, no-else-return, no-empty */
/* eslint-disable no-param-reassign, no-var, block-scoped-var */







var TEXT_RENDERING_MODE = __WEBPACK_IMPORTED_MODULE_2__core__["a" /* TEXT_RENDERING_MODE */];

var DASH_PATTERNS = {
    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          : []
};

var LINE_CAP = {
    butt   : 0,
    round  : 1,
    square : 2
};

var LINE_JOIN = {
    miter : 0,
    round : 1,
    bevel : 2
};

function render(group, callback) {
    var fonts = [], images = {}, options = group.options;

    function getOption(name, defval, hash) {
        if (!hash) {
            hash = options;
        }
        if (hash.pdf && hash.pdf[name] != null) {
            return hash.pdf[name];
        }
        return defval;
    }

    var multiPage = getOption("multiPage");
    var imgDPI = getOption("imgDPI");

    if (imgDPI) {
        __WEBPACK_IMPORTED_MODULE_2__core__["b" /* clearImageCache */]();
    }

    group.traverse(function(element){
        dispatch({
            Image: function(element) {
                var url = element.src();
                if (imgDPI) {
                    var box = element.bbox().size;
                    var prev = images[url];
                    box = {
                        width: Math.ceil(box.width * imgDPI / 72),
                        height: Math.ceil(box.height * imgDPI / 72)
                    };
                    if (prev) {
                        box.width = Math.max(prev.width, box.width);
                        box.height = Math.max(prev.height, box.height);
                    }
                    images[url] = box;
                } else {
                    images[url] = null;
                }
            },
            Text: function(element) {
                var style = __WEBPACK_IMPORTED_MODULE_2__core__["c" /* parseFontDef */](element.options.font);
                var url = __WEBPACK_IMPORTED_MODULE_2__core__["d" /* getFontURL */](style);
                if (fonts.indexOf(url) < 0) {
                    fonts.push(url);
                }
            }
        }, element);
    });

    function doIt() {
        if (--count > 0) {
            return;
        }

        var pdf = new (__WEBPACK_IMPORTED_MODULE_2__core__["e" /* Document */])({
            producer  : getOption("producer"),
            title     : getOption("title"),
            author    : getOption("author"),
            subject   : getOption("subject"),
            keywords  : getOption("keywords"),
            creator   : getOption("creator"),
            date      : getOption("date")
        });

        function drawPage(group) {
            var options = group.options;

            var tmp = optimize(group);
            var bbox = tmp.bbox;
            group = tmp.root;
            // var tmp, bbox;

            var paperSize = getOption("paperSize", getOption("paperSize", "auto"), options), addMargin = false;
            if (paperSize == "auto") {
                if (bbox) {
                    var size = bbox.getSize();
                    paperSize = [ size.width, size.height ];
                    addMargin = true;
                    var origin = bbox.getOrigin();
                    tmp = new __WEBPACK_IMPORTED_MODULE_3__drawing__["a" /* Group */]();
                    tmp.transform(new __WEBPACK_IMPORTED_MODULE_4__geometry__["a" /* Matrix */](1, 0, 0, 1, -origin.x, -origin.y));
                    tmp.append(group);
                    group = tmp;
                }
                else {
                    paperSize = "A4";
                }
            }

            var page;
            page = pdf.addPage({
                paperSize : paperSize,
                margin    : getOption("margin", getOption("margin"), options),
                addMargin : addMargin,
                landscape : getOption("landscape", getOption("landscape", false), options)
            });
            drawElement(group, page, pdf);
        }

        if (multiPage) {
            group.children.forEach(drawPage);
        } else {
            drawPage(group);
        }

        callback(pdf.render(), pdf);
    }

    var count = 2;
    __WEBPACK_IMPORTED_MODULE_2__core__["f" /* loadFonts */](fonts, doIt);
    __WEBPACK_IMPORTED_MODULE_2__core__["g" /* loadImages */](images, doIt);
}

function toDataURL(group, callback) {
    render(group, function(data){
        callback("data:application/pdf;base64," + data.base64());
    });
}

function toBlob(group, callback) {
    render(group, function(data){
        callback(new window.Blob([ data.get() ], { type: "application/pdf" }));
    });
}

function saveAs(group, filename, proxy, callback) {
    // XXX: Safari has Blob, but does not support the download attribute
    //      so we'd end up converting to dataURL and using the proxy anyway.
    if (window.Blob && !__WEBPACK_IMPORTED_MODULE_1__common__["a" /* support */].browser.safari) {
        toBlob(group, function(blob){
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common__["b" /* saveAs */])({ dataURI: blob, fileName: filename });
            if (callback) {
                callback(blob);
            }
        });
    } else {
        toDataURL(group, function(dataURL){
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common__["b" /* saveAs */])({ dataURI: dataURL, fileName: filename, proxyURL: proxy });
            if (callback) {
                callback(dataURL);
            }
        });
    }
}

function dispatch(handlers, element) {
    var handler = handlers[element.nodeType];
    if (handler) {
        return handler.call.apply(handler, arguments);
    }
    return element;
}

function drawElement(element, page, pdf) {
    if (element.options._pdfDebug) {
        page.comment("BEGIN: " + element.options._pdfDebug);
    }

    var transform = element.transform();
    var opacity = element.opacity();

    page.save();

    if (opacity != null && opacity < 1) {
        page.setOpacity(opacity);
    }

    setStrokeOptions(element, page, pdf);
    setFillOptions(element, page, pdf);

    if (transform) {
        var m = transform.matrix();
        page.transform(m.a, m.b, m.c, m.d, m.e, m.f);
    }

    setClipping(element, page, pdf);

    dispatch({
        Path      : drawPath,
        MultiPath : drawMultiPath,
        Circle    : drawCircle,
        Arc       : drawArc,
        Text      : drawText,
        Image     : drawImage,
        Group     : drawGroup,
        Rect      : drawRect
    }, element, page, pdf);

    page.restore();

    if (element.options._pdfDebug) {
        page.comment("END: " + element.options._pdfDebug);
    }
}

function setStrokeOptions(element, page) {
    var stroke = element.stroke && element.stroke();
    if (!stroke) {
        return;
    }

    var color = stroke.color;
    if (color) {
        color = parseColor(color);
        if (color == null) {
            return; // no stroke
        }
        page.setStrokeColor(color.r, color.g, color.b);
        if (color.a != 1) {
            page.setStrokeOpacity(color.a);
        }
    }

    var width = stroke.width;
    if (width != null) {
        if (width === 0) {
            return; // no stroke
        }
        page.setLineWidth(width);
    }

    var dashType = stroke.dashType;
    if (dashType) {
        page.setDashPattern(DASH_PATTERNS[dashType], 0);
    }

    var lineCap = stroke.lineCap;
    if (lineCap) {
        page.setLineCap(LINE_CAP[lineCap]);
    }

    var lineJoin = stroke.lineJoin;
    if (lineJoin) {
        page.setLineJoin(LINE_JOIN[lineJoin]);
    }

    var opacity = stroke.opacity;
    if (opacity != null) {
        page.setStrokeOpacity(opacity);
    }
}

function setFillOptions(element, page) {
    var fill = element.fill && element.fill();
    if (!fill) {
        return;
    }

    if (fill instanceof __WEBPACK_IMPORTED_MODULE_3__drawing__["b" /* Gradient */]) {
        return;
    }

    var color = fill.color;
    if (color) {
        color = parseColor(color);
        if (color == null) {
            return; // no fill
        }
        page.setFillColor(color.r, color.g, color.b);
        if (color.a != 1) {
            page.setFillOpacity(color.a);
        }
    }

    var opacity = fill.opacity;
    if (opacity != null) {
        page.setFillOpacity(opacity);
    }
}

function setClipping(element, page, pdf) {
    // XXX: only Path supported at the moment.
    var clip = element.clip();
    if (clip) {
        _drawPath(clip, page, pdf);
        page.clip();
        // page.setStrokeColor(Math.random(), Math.random(), Math.random());
        // page.setLineWidth(1);
        // page.stroke();
    }
}

function shouldDraw(thing) {
    return (thing &&
            (thing instanceof __WEBPACK_IMPORTED_MODULE_3__drawing__["b" /* Gradient */] ||
             (thing.color && !/^(none|transparent)$/i.test(thing.color) &&
              (thing.width == null || thing.width > 0) &&
              (thing.opacity == null || thing.opacity > 0))));
}

function maybeGradient(element, page, pdf, stroke) {
    var fill = element.fill();
    if (fill instanceof __WEBPACK_IMPORTED_MODULE_3__drawing__["b" /* Gradient */]) {
        if (stroke) {
            page.clipStroke();
        } else {
            page.clip();
        }
        var isRadial = fill instanceof __WEBPACK_IMPORTED_MODULE_3__drawing__["c" /* RadialGradient */];
        var start, end;
        if (isRadial) {
            start = { x: fill.center().x , y: fill.center().y , r: 0 };
            end   = { x: fill.center().x , y: fill.center().y , r: fill.radius() };
        } else {
            start = { x: fill.start().x , y: fill.start().y };
            end   = { x: fill.end().x   , y: fill.end().y   };
        }

        var stops = fill.stops.elements().map(function(stop){
            var offset = stop.offset();
            if (/%$/.test(offset)) {
                offset = parseFloat(offset) / 100;
            } else {
                offset = parseFloat(offset);
            }
            var color = parseColor(stop.color());
            color.a *= stop.opacity();
            return {
                offset: offset,
                color: color
            };
        });

        // Duplicats first and last stop to fix
        // https://github.com/telerik/kendo-ui-core/issues/1782
        stops.unshift(stops[0]);
        stops.push(stops[stops.length - 1]);

        var gradient = {
            userSpace : fill.userSpace(),
            type      : isRadial ? "radial" : "linear",
            start     : start,
            end       : end,
            stops     : stops
        };
        var box = element.rawBBox();
        var tl = box.topLeft(), size = box.getSize();
        box = {
            left   : tl.x,
            top    : tl.y,
            width  : size.width,
            height : size.height
        };
        page.gradient(gradient, box);
        return true;
    }
}

function maybeFillStroke(element, page, pdf) {
    if (shouldDraw(element.fill()) && shouldDraw(element.stroke())) {
        if (!maybeGradient(element, page, pdf, true)) {
            page.fillStroke();
        }
    } else if (shouldDraw(element.fill())) {
        if (!maybeGradient(element, page, pdf, false)) {
            page.fill();
        }
    } else if (shouldDraw(element.stroke())) {
        page.stroke();
    } else {
        // we should not get here; the path should have been
        // optimized away.  but let's be prepared.
        page.nop();
    }
}

function maybeDrawRect(path, page) {
    var segments = path.segments;
    if (segments.length == 4 && path.options.closed) {
        // detect if this path looks like a rectangle parallel to the axis
        var a = [];
        for (var i = 0; i < segments.length; ++i) {
            if (segments[i].controlIn()) { // has curve?
                return false;
            }
            a[i] = segments[i].anchor();
        }
        // it's a rectangle if the y/x/y/x or x/y/x/y coords of
        // consecutive points are the same.
        var isRect = (
            a[0].y == a[1].y && a[1].x == a[2].x && a[2].y == a[3].y && a[3].x == a[0].x
        ) || (
            a[0].x == a[1].x && a[1].y == a[2].y && a[2].x == a[3].x && a[3].y == a[0].y
        );
        if (isRect) {
            // this saves a bunch of instructions in PDF:
            // moveTo, lineTo, lineTo, lineTo, close -> rect.
            page.rect(a[0].x, a[0].y,
                      a[2].x - a[0].x /*width*/,
                      a[2].y - a[0].y /*height*/);
            return true;
        }
    }
}

function _drawPath(element, page, pdf) {
    var segments = element.segments;
    if (segments.length === 0) {
        return;
    }
    if (!maybeDrawRect(element, page, pdf)) {
        for (var prev, i = 0; i < segments.length; ++i) {
            var seg = segments[i];
            var anchor = seg.anchor();
            if (!prev) {
                page.moveTo(anchor.x, anchor.y);
            } else {
                var prevOut = prev.controlOut();
                var controlIn = seg.controlIn();
                if (prevOut && controlIn) {
                    page.bezier(
                        prevOut.x   , prevOut.y,
                        controlIn.x , controlIn.y,
                        anchor.x    , anchor.y
                    );
                } else {
                    page.lineTo(anchor.x, anchor.y);
                }
            }
            prev = seg;
        }
        if (element.options.closed) {
            page.close();
        }
    }
}

function drawPath(element, page, pdf) {
    _drawPath(element, page, pdf);
    maybeFillStroke(element, page, pdf);
}

function drawMultiPath(element, page, pdf) {
    var paths = element.paths;
    for (var i = 0; i < paths.length; ++i) {
        _drawPath(paths[i], page, pdf);
    }
    maybeFillStroke(element, page, pdf);
}

function drawCircle(element, page, pdf) {
    var g = element.geometry();
    page.circle(g.center.x, g.center.y, g.radius);
    maybeFillStroke(element, page, pdf);
}

function drawArc(element, page, pdf) {
    var points = element.geometry().curvePoints();
    page.moveTo(points[0].x, points[0].y);
    for (var i = 1; i < points.length;) {
        page.bezier(
            points[i].x, points[i++].y,
            points[i].x, points[i++].y,
            points[i].x, points[i++].y
        );
    }
    maybeFillStroke(element, page, pdf);
}

function drawText(element, page) {
    var style = __WEBPACK_IMPORTED_MODULE_2__core__["c" /* parseFontDef */](element.options.font);
    var pos = element._position;
    var mode;
    if (element.fill() && element.stroke()) {
        mode = TEXT_RENDERING_MODE.fillAndStroke;
    } else if (element.fill()) {
        mode = TEXT_RENDERING_MODE.fill;
    } else if (element.stroke()) {
        mode = TEXT_RENDERING_MODE.stroke;
    }

    page.transform(1, 0, 0, -1, pos.x, pos.y + style.fontSize);
    page.beginText();
    page.setFont(__WEBPACK_IMPORTED_MODULE_2__core__["d" /* getFontURL */](style), style.fontSize);
    page.setTextRenderingMode(mode);
    page.showText(element.content(), element._pdfRect ? element._pdfRect.width() : null);
    page.endText();
}

function drawGroup(element, page, pdf) {
    if (element._pdfLink) {
        page.addLink(element._pdfLink.url, element._pdfLink);
    }
    var children = element.children;
    for (var i = 0; i < children.length; ++i) {
        drawElement(children[i], page, pdf);
    }
}

function drawImage(element, page) {
    var url = element.src();
    if (!url) {
        return;
    }

    var rect = element.rect();
    var tl = rect.getOrigin();
    var sz = rect.getSize();
    page.transform(sz.width, 0, 0, -sz.height, tl.x, tl.y + sz.height);
    page.drawImage(url);
}

function drawRect(element, page, pdf) {
    var geometry = element.geometry();
    page.rect(geometry.origin.x, geometry.origin.y, geometry.size.width, geometry.size.height);
    maybeFillStroke(element, page, pdf);
}

function parseColor(value) {
    var color = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common__["c" /* parseColor */])(value, true);
    return color ? color.toRGB() : null;
}

function optimize(root) {
    var clipbox = false;
    var matrix = __WEBPACK_IMPORTED_MODULE_4__geometry__["a" /* Matrix */].unit();
    var currentBox = null;
    var changed;
    do {
        changed = false;
        root = opt(root);
    } while (root && changed);
    return { root: root, bbox: currentBox };

    function change(newShape) {
        changed = true;
        return newShape;
    }

    function visible(shape) {
        return (shape.visible() && shape.opacity() > 0 &&
                ( shouldDraw(shape.fill()) ||
                  shouldDraw(shape.stroke()) ));
    }

    function optArray(a) {
        var b = [];
        for (var i = 0; i < a.length; ++i) {
            var el = opt(a[i]);
            if (el != null) {
                b.push(el);
            }
        }
        return b;
    }

    function withClipping(shape, f) {
        var saveclipbox = clipbox;
        var savematrix = matrix;

        if (shape.transform()) {
            matrix = matrix.multiplyCopy(shape.transform().matrix());
        }

        var clip = shape.clip();
        if (clip) {
            clip = clip.bbox();
            if (clip) {
                clip = clip.bbox(matrix);
                clipbox = clipbox ? __WEBPACK_IMPORTED_MODULE_4__geometry__["b" /* Rect */].intersect(clipbox, clip) : clip;
            }
        }

        try {
            return f();
        }
        finally {
            clipbox = saveclipbox;
            matrix = savematrix;
        }
    }

    function inClipbox(shape) {
        if (clipbox == null) {
            return false;
        }
        var box = shape.rawBBox().bbox(matrix);
        if (clipbox && box) {
            box = __WEBPACK_IMPORTED_MODULE_4__geometry__["b" /* Rect */].intersect(box, clipbox);
        }
        return box;
    }

    function opt(shape) {
        return withClipping(shape, function(){
            if (!(shape instanceof __WEBPACK_IMPORTED_MODULE_3__drawing__["a" /* Group */] || shape instanceof __WEBPACK_IMPORTED_MODULE_3__drawing__["d" /* MultiPath */])) {
                var box = inClipbox(shape);
                if (!box) {
                    return change(null);
                }
                currentBox = currentBox ? __WEBPACK_IMPORTED_MODULE_4__geometry__["b" /* Rect */].union(currentBox, box) : box;
            }
            return dispatch({
                Path: function(shape) {
                    if (shape.segments.length === 0 || !visible(shape)) {
                        return change(null);
                    }
                    return shape;
                },
                MultiPath: function(shape) {
                    if (!visible(shape)) {
                        return change(null);
                    }
                    var el = new __WEBPACK_IMPORTED_MODULE_3__drawing__["d" /* MultiPath */](shape.options);
                    el.paths = optArray(shape.paths);
                    if (el.paths.length === 0) {
                        return change(null);
                    }
                    return el;
                },
                Circle: function(shape) {
                    if (!visible(shape)) {
                        return change(null);
                    }
                    return shape;
                },
                Arc: function(shape) {
                    if (!visible(shape)) {
                        return change(null);
                    }
                    return shape;
                },
                Text: function(shape) {
                    if (!/\S/.test(shape.content()) || !visible(shape)) {
                        return change(null);
                    }
                    return shape;
                },
                Image: function(shape) {
                    if (!(shape.visible() && shape.opacity() > 0)) {
                        return change(null);
                    }
                    return shape;
                },
                Group: function(shape) {
                    var el = new __WEBPACK_IMPORTED_MODULE_3__drawing__["a" /* Group */](shape.options);
                    el.children = optArray(shape.children);
                    el._pdfLink = shape._pdfLink;
                    if (shape !== root && el.children.length === 0 && !shape._pdfLink) {
                        return change(null);
                    }
                    return el;
                },
                Rect: function(shape) {
                    if (!visible(shape)) {
                        return change(null);
                    }
                    return shape;
                }
            }, shape);
        });
    }
}

function exportPDF(group, options) {
    var promise = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* createPromise */])();

    for (var i in options) {
        if (i == "margin" && group.options.pdf && group.options.pdf._ignoreMargin) {
            // This hackish option is set by the page breaking code in drawDOM.  The idea is
            // that margin is already taken into account there (that's required to do proper
            // page breaking) and we don't want to set it again here, as it would double the
            // top-left margin, and truncate the content on bottom/right.
            continue;
        }
        group.options.set("pdf." + i, options[i]);
    }

    toDataURL(group, promise.resolve);

    return promise;
}



//# sourceMappingURL=drawing.js.map


/***/ }),
/* 702 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TTFFont; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(434);
/* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */
/* eslint-disable space-infix-ops, space-before-function-paren, array-bracket-spacing, object-curly-spacing */
/* eslint-disable no-nested-ternary, max-params, default-case, no-else-return, no-empty */
/* eslint-disable no-param-reassign, no-var, block-scoped-var */

/*****************************************************************************\
 *
 * The code in this file, although written from scratch, is influenced by the
 * TrueType parser/encoder in PDFKit -- http://pdfkit.org/ (a CoffeeScript
 * library for producing PDF files).
 *
 * PDFKit is (c) Devon Govett 2014 and released under the MIT License.
 *
\*****************************************************************************/



function hasOwnProperty(obj, key) {
    return Object.prototype.hasOwnProperty.call(obj, key);
}

function sortedKeys(obj) {
    return Object.keys(obj).sort(function(a, b){ return a - b; }).map(parseFloat);
}

///

function Directory(data) {
    this.raw = data;
    this.scalerType = data.readLong();
    this.tableCount = data.readShort();
    this.searchRange = data.readShort();
    this.entrySelector = data.readShort();
    this.rangeShift = data.readShort();

    var tables = this.tables = {};
    for (var i = 0; i < this.tableCount; ++i) {
        var entry = {
            tag      : data.readString(4),
            checksum : data.readLong(),
            offset   : data.readLong(),
            length   : data.readLong()
        };
        tables[entry.tag] = entry;
    }
}

Directory.prototype = {

    readTable: function(name, Ctor) {
        var def = this.tables[name];
        if (!def) {
            throw new Error("Table " + name + " not found in directory");
        }
        return (this[name] = def.table = new Ctor(this, def));
    },

    render: function(tables) {
        var this$1 = this;

        var tableCount = Object.keys(tables).length;

        var maxpow2 = Math.pow(2, Math.floor(Math.log(tableCount) / Math.LN2));
        var searchRange = maxpow2 * 16;
        var entrySelector = Math.floor(Math.log(maxpow2) / Math.LN2);
        var rangeShift = tableCount * 16 - searchRange;

        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        out.writeLong(this.scalerType);
        out.writeShort(tableCount);
        out.writeShort(searchRange);
        out.writeShort(entrySelector);
        out.writeShort(rangeShift);

        var directoryLength = tableCount * 16;
        var offset = out.offset() + directoryLength;
        var headOffset = null;
        var tableData = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();

        for (var tag in tables) {
            if (hasOwnProperty(tables, tag)) {
                var table = tables[tag];

                out.writeString(tag);
                out.writeLong(this$1.checksum(table));
                out.writeLong(offset);
                out.writeLong(table.length);

                tableData.write(table);
                if (tag == "head") {
                    headOffset = offset;
                }
                offset += table.length;

                while (offset % 4) {
                    tableData.writeByte(0);
                    offset++;
                }
            }
        }

        out.write(tableData.get());
        var sum = this.checksum(out.get());
        var adjustment = 0xB1B0AFBA - sum;

        out.offset(headOffset + 8);
        out.writeLong(adjustment);
        return out.get();
    },

    checksum: function(data) {
        data = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(data);
        var sum = 0;
        while (!data.eof()) {
            sum += data.readLong();
        }
        return sum & 0xFFFFFFFF;
    }
};

function deftable(methods) {
    function Ctor(file, def) {
        this.definition = def;
        this.length = def.length;
        this.offset = def.offset;
        this.file = file;
        this.rawData = file.raw;
        this.parse(file.raw);
    }
    Ctor.prototype.raw = function() {
        return this.rawData.slice(this.offset, this.length);
    };
    for (var i in methods) {
        if (hasOwnProperty(methods, i)) {
            Ctor[i] = Ctor.prototype[i] = methods[i];
        }
    }
    return Ctor;
}

var HeadTable = deftable({
    parse: function(data) {
        data.offset(this.offset);
        this.version             = data.readLong();
        this.revision            = data.readLong();
        this.checkSumAdjustment  = data.readLong();
        this.magicNumber         = data.readLong();
        this.flags               = data.readShort();
        this.unitsPerEm          = data.readShort();
        this.created             = data.read(8);
        this.modified            = data.read(8);

        this.xMin = data.readShort_();
        this.yMin = data.readShort_();
        this.xMax = data.readShort_();
        this.yMax = data.readShort_();

        this.macStyle           = data.readShort();
        this.lowestRecPPEM      = data.readShort();
        this.fontDirectionHint  = data.readShort_();
        this.indexToLocFormat   = data.readShort_();
        this.glyphDataFormat    = data.readShort_();
    },
    render: function(indexToLocFormat) {
        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        out.writeLong(this.version);
        out.writeLong(this.revision);
        out.writeLong(0);       // checksum adjustment; shall be computed later
        out.writeLong(this.magicNumber);
        out.writeShort(this.flags);
        out.writeShort(this.unitsPerEm);
        out.write(this.created);
        out.write(this.modified);
        out.writeShort_(this.xMin);
        out.writeShort_(this.yMin);
        out.writeShort_(this.xMax);
        out.writeShort_(this.yMax);
        out.writeShort(this.macStyle);
        out.writeShort(this.lowestRecPPEM);
        out.writeShort_(this.fontDirectionHint);
        out.writeShort_(indexToLocFormat); // this will depend on the `loca` table
        out.writeShort_(this.glyphDataFormat);
        return out.get();
    }
});

var LocaTable = deftable({
    parse: function(data) {
        data.offset(this.offset);
        var format = this.file.head.indexToLocFormat;
        if (format === 0) {
            this.offsets = data.times(this.length / 2, function(){
                return 2 * data.readShort();
            });
        } else {
            this.offsets = data.times(this.length / 4, data.readLong);
        }
    },
    offsetOf: function(id) {
        return this.offsets[id];
    },
    lengthOf: function(id) {
        return this.offsets[id + 1] - this.offsets[id];
    },
    render: function(offsets) {
        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        var needsLongFormat = offsets[offsets.length - 1] > 0xFFFF;
        for (var i = 0; i < offsets.length; ++i) {
            if (needsLongFormat) {
                out.writeLong(offsets[i]);
            } else {
                out.writeShort(offsets[i] / 2);
            }
        }
        return {
            format: needsLongFormat ? 1 : 0,
            table: out.get()
        };
    }
});

var HheaTable = deftable({
    parse: function(data) {
        data.offset(this.offset);

        this.version              = data.readLong();
        this.ascent               = data.readShort_();
        this.descent              = data.readShort_();
        this.lineGap              = data.readShort_();
        this.advanceWidthMax      = data.readShort();
        this.minLeftSideBearing   = data.readShort_();
        this.minRightSideBearing  = data.readShort_();
        this.xMaxExtent           = data.readShort_();
        this.caretSlopeRise       = data.readShort_();
        this.caretSlopeRun        = data.readShort_();
        this.caretOffset          = data.readShort_();

        data.skip(4 * 2);       // reserved

        this.metricDataFormat     = data.readShort_();
        this.numOfLongHorMetrics  = data.readShort();
    },
    render: function(ids) {
        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        out.writeLong(this.version);
        out.writeShort_(this.ascent);
        out.writeShort_(this.descent);
        out.writeShort_(this.lineGap);
        out.writeShort(this.advanceWidthMax);
        out.writeShort_(this.minLeftSideBearing);
        out.writeShort_(this.minRightSideBearing);
        out.writeShort_(this.xMaxExtent);
        out.writeShort_(this.caretSlopeRise);
        out.writeShort_(this.caretSlopeRun);
        out.writeShort_(this.caretOffset);

        out.write([ 0, 0, 0, 0, 0, 0, 0, 0 ]); // reserved bytes

        out.writeShort_(this.metricDataFormat);
        out.writeShort(ids.length);
        return out.get();
    }
});

var MaxpTable = deftable({
    parse: function(data) {
        data.offset(this.offset);
        this.version = data.readLong();
        this.numGlyphs = data.readShort();
        this.maxPoints = data.readShort();
        this.maxContours = data.readShort();
        this.maxComponentPoints = data.readShort();
        this.maxComponentContours = data.readShort();
        this.maxZones = data.readShort();
        this.maxTwilightPoints = data.readShort();
        this.maxStorage = data.readShort();
        this.maxFunctionDefs = data.readShort();
        this.maxInstructionDefs = data.readShort();
        this.maxStackElements = data.readShort();
        this.maxSizeOfInstructions = data.readShort();
        this.maxComponentElements = data.readShort();
        this.maxComponentDepth = data.readShort();
    },
    render: function(glyphIds) {
        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        out.writeLong(this.version);
        out.writeShort(glyphIds.length);
        out.writeShort(this.maxPoints);
        out.writeShort(this.maxContours);
        out.writeShort(this.maxComponentPoints);
        out.writeShort(this.maxComponentContours);
        out.writeShort(this.maxZones);
        out.writeShort(this.maxTwilightPoints);
        out.writeShort(this.maxStorage);
        out.writeShort(this.maxFunctionDefs);
        out.writeShort(this.maxInstructionDefs);
        out.writeShort(this.maxStackElements);
        out.writeShort(this.maxSizeOfInstructions);
        out.writeShort(this.maxComponentElements);
        out.writeShort(this.maxComponentDepth);
        return out.get();
    }
});

var HmtxTable = deftable({
    parse: function(data) {
        data.offset(this.offset);
        var dir = this.file, hhea = dir.hhea;
        this.metrics = data.times(hhea.numOfLongHorMetrics, function(){
            return {
                advance: data.readShort(),
                lsb: data.readShort_()
            };
        });
        var lsbCount = dir.maxp.numGlyphs - dir.hhea.numOfLongHorMetrics;
        this.leftSideBearings = data.times(lsbCount, data.readShort_);
    },
    forGlyph: function(id) {
        var metrics = this.metrics;
        var n = metrics.length;
        if (id < n) {
            return metrics[id];
        }
        return {
            advance: metrics[n - 1].advance,
            lsb: this.leftSideBearings[id - n]
        };
    },
    render: function(glyphIds) {
        var this$1 = this;

        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
        for (var i = 0; i < glyphIds.length; ++i) {
            var m = this$1.forGlyph(glyphIds[i]);
            out.writeShort(m.advance);
            out.writeShort_(m.lsb);
        }
        return out.get();
    }
});

var GlyfTable = (function(){

    function SimpleGlyph(raw) {
        this.raw = raw;
    }
    SimpleGlyph.prototype = {
        compound: false,
        render: function() {
            return this.raw.get();
        }
    };

    var ARG_1_AND_2_ARE_WORDS     = 0x0001;
    var WE_HAVE_A_SCALE           = 0x0008;
    var MORE_COMPONENTS           = 0x0020;
    var WE_HAVE_AN_X_AND_Y_SCALE  = 0x0040;
    var WE_HAVE_A_TWO_BY_TWO      = 0x0080;
    //var WE_HAVE_INSTRUCTIONS      = 0x0100;

    function CompoundGlyph(data) {
        this.raw = data;
        var ids = this.glyphIds = [];
        var offsets = this.idOffsets = [];
        while (true) {          // eslint-disable-line no-constant-condition
            var flags = data.readShort();
            offsets.push(data.offset());
            ids.push(data.readShort());

            if (!(flags & MORE_COMPONENTS)) {
                break;
            }

            data.skip(flags & ARG_1_AND_2_ARE_WORDS ? 4 : 2);

            if (flags & WE_HAVE_A_TWO_BY_TWO) {
                data.skip(8);
            } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
                data.skip(4);
            } else if (flags & WE_HAVE_A_SCALE) {
                data.skip(2);
            }
        }
    }

    CompoundGlyph.prototype = {
        compound: true,
        render: function(old2new) {
            var this$1 = this;

            var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(this.raw.get());
            for (var i = 0; i < this.glyphIds.length; ++i) {
                var id = this$1.glyphIds[i];
                out.offset(this$1.idOffsets[i]);
                out.writeShort(old2new[id]);
            }
            return out.get();
        }
    };

    return deftable({
        parse: function() {
            this.cache = {};
        },
        glyphFor: function(id) {
            var cache = this.cache;
            if (hasOwnProperty(cache, id)) {
                return cache[id];
            }

            var loca = this.file.loca;
            var length = loca.lengthOf(id);

            if (length === 0) {
                return (cache[id] = null);
            }

            var data = this.rawData;
            var offset = this.offset + loca.offsetOf(id);
            var raw = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(data.slice(offset, length));

            var numberOfContours = raw.readShort_();
            var xMin = raw.readShort_();
            var yMin = raw.readShort_();
            var xMax = raw.readShort_();
            var yMax = raw.readShort_();

            var glyph = cache[id] = numberOfContours == -1 ? new CompoundGlyph(raw) : new SimpleGlyph(raw);

            glyph.numberOfContours = numberOfContours;
            glyph.xMin = xMin;
            glyph.yMin = yMin;
            glyph.xMax = xMax;
            glyph.yMax = yMax;

            return glyph;
        },
        render: function(glyphs, oldIds, old2new) {
            var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(), offsets = [];
            for (var i = 0; i < oldIds.length; ++i) {
                var id = oldIds[i];
                var glyph = glyphs[id];
                offsets.push(out.offset());
                if (glyph) {
                    out.write(glyph.render(old2new));
                }
            }
            offsets.push(out.offset());
            return {
                table: out.get(),
                offsets: offsets
            };
        }
    });

}());

var NameTable = (function(){

    function NameEntry(text, entry) {
        this.text = text;
        this.length = text.length;
        this.platformID = entry.platformID;
        this.platformSpecificID = entry.platformSpecificID;
        this.languageID = entry.languageID;
        this.nameID = entry.nameID;
    }

    return deftable({
        parse: function(data) {
            data.offset(this.offset);
            data.readShort();   // format
            var count = data.readShort();
            var stringOffset = this.offset + data.readShort();
            var nameRecords = data.times(count, function(){
                return {
                    platformID         : data.readShort(),
                    platformSpecificID : data.readShort(),
                    languageID         : data.readShort(),
                    nameID             : data.readShort(),
                    length             : data.readShort(),
                    offset             : data.readShort() + stringOffset
                };
            });
            var strings = this.strings = {};
            for (var i = 0; i < nameRecords.length; ++i) {
                var rec = nameRecords[i];
                data.offset(rec.offset);
                var text = data.readString(rec.length);
                if (!strings[rec.nameID]) {
                    strings[rec.nameID] = [];
                }
                strings[rec.nameID].push(new NameEntry(text, rec));
            }
            this.postscriptEntry = strings[6][0];
            this.postscriptName = this.postscriptEntry.text.replace(/[^\x20-\x7F]/g, "");
        },

        render: function(psName) {
            var this$1 = this;

            var strings = this.strings;
            var strCount = 0;
            for (var i in strings) {
                if (hasOwnProperty(strings, i)) {
                    strCount += strings[i].length;
                }
            }
            var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
            var strTable = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();

            out.writeShort(0);  // format
            out.writeShort(strCount);
            out.writeShort(6 + 12 * strCount); // stringOffset

            for (i in strings) {
                if (hasOwnProperty(strings, i)) {
                    var list = i == 6 ? [
                        new NameEntry(psName, this$1.postscriptEntry)
                    ] : strings[i];
                    for (var j = 0; j < list.length; ++j) {
                        var str = list[j];
                        out.writeShort(str.platformID);
                        out.writeShort(str.platformSpecificID);
                        out.writeShort(str.languageID);
                        out.writeShort(str.nameID);
                        out.writeShort(str.length);
                        out.writeShort(strTable.offset());

                        strTable.writeString(str.text);
                    }
                }
            }

            out.write(strTable.get());

            return out.get();
        }
    });

})();

var PostTable = (function(){

    var POSTSCRIPT_GLYPHS = ".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 deftable({
        parse: function(data) {
            var this$1 = this;

            data.offset(this.offset);

            this.format = data.readLong();
            this.italicAngle = data.readFixed_();
            this.underlinePosition = data.readShort_();
            this.underlineThickness = data.readShort_();
            this.isFixedPitch = data.readLong();
            this.minMemType42 = data.readLong();
            this.maxMemType42 = data.readLong();
            this.minMemType1 = data.readLong();
            this.maxMemType1 = data.readLong();

            var numberOfGlyphs;

            switch (this.format) {
              case 0x00010000:
              case 0x00030000:
                break;

              case 0x00020000:
                numberOfGlyphs = data.readShort();
                this.glyphNameIndex = data.times(numberOfGlyphs, data.readShort);
                this.names = [];
                var limit = this.offset + this.length;
                while (data.offset() < limit) {
                    this$1.names.push(data.readString(data.readByte()));
                }
                break;

              case 0x00025000:
                numberOfGlyphs = data.readShort();
                this.offsets = data.read(numberOfGlyphs);
                break;

              case 0x00040000:
                this.map = data.times(this.file.maxp.numGlyphs, data.readShort);
                break;
            }
        },
        glyphFor: function(code) {
            switch (this.format) {
              case 0x00010000:
                return POSTSCRIPT_GLYPHS[code] || ".notdef";

              case 0x00020000:
                var index = this.glyphNameIndex[code];
                if (index < POSTSCRIPT_GLYPHS.length) {
                    return POSTSCRIPT_GLYPHS[index];
                }
                return this.names[index - POSTSCRIPT_GLYPHS.length] || ".notdef";

              case 0x00025000:

              case 0x00030000:
                return ".notdef";

              case 0x00040000:
                return this.map[code] || 0xFFFF;
            }
        },
        render: function(mapping) {
            var this$1 = this;

            if (this.format == 0x00030000) {
                return this.raw();
            }

            // keep original header, but set format to 2.0
            var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(this.rawData.slice(this.offset, 32));
            out.writeLong(0x00020000);
            out.offset(32);

            var indexes = [];
            var strings = [];

            for (var i = 0; i < mapping.length; ++i) {
                var id = mapping[i];
                var post = this$1.glyphFor(id);
                var index = POSTSCRIPT_GLYPHS.indexOf(post);
                if (index >= 0) {
                    indexes.push(index);
                } else {
                    indexes.push(POSTSCRIPT_GLYPHS.length + strings.length);
                    strings.push(post);
                }
            }

            out.writeShort(mapping.length);

            for (i = 0; i < indexes.length; ++i) {
                out.writeShort(indexes[i]);
            }

            for (i = 0; i < strings.length; ++i) {
                out.writeByte(strings[i].length);
                out.writeString(strings[i]);
            }

            return out.get();
        }
    });
})();

var CmapTable = (function(){

    function CmapEntry(data, offset, codeMap) {
        var self = this;
        self.platformID = data.readShort();
        self.platformSpecificID = data.readShort();
        self.offset = offset + data.readLong();

        data.saveExcursion(function(){
            var code;
            data.offset(self.offset);
            self.format = data.readShort();

            switch (self.format) {
              case 0:
                self.length = data.readShort();
                self.language = data.readShort();
                for (var i = 0; i < 256; ++i) {
                    codeMap[i] = data.readByte();
                }
                break;

              case 4:
                self.length = data.readShort();
                self.language = data.readShort();
                var segCount = data.readShort() / 2;

                data.skip(6);       // searchRange, entrySelector, rangeShift
                var endCode = data.times(segCount, data.readShort);
                data.skip(2);       // reserved pad
                var startCode = data.times(segCount, data.readShort);
                var idDelta = data.times(segCount, data.readShort_);
                var idRangeOffset = data.times(segCount, data.readShort);

                var count = (self.length + self.offset - data.offset()) / 2;
                var glyphIds = data.times(count, data.readShort);

                for (i = 0; i < segCount; ++i) {
                    var start = startCode[i], end = endCode[i];
                    for (code = start; code <= end; ++code) {
                        var glyphId;
                        if (idRangeOffset[i] === 0) {
                            glyphId = code + idDelta[i];
                        } else {
                            ///
                            // When non-zero, idRangeOffset contains for each segment the byte offset of the Glyph ID
                            // into the glyphIds table, from the *current* `i` cell of idRangeOffset.  In other words,
                            // this offset spans from the first into the second array.  This works, because the arrays
                            // are consecutive in the TTF file:
                            //
                            //     [ ...idRangeOffset... ][ ...glyphIds... ]
                            //       ...... 48 ......       .... ID ....
                            //              ^----- 48 bytes -----^
                            //
                            // (but I can't stop wondering why is it not just a plain index, possibly incremented by 1
                            // so that we can have that special `zero` value.)
                            //
                            // The elements of idRangeOffset are even numbers, because both arrays contain 16-bit words,
                            // yet the offset is in bytes.  That is why we divide it by 2.  Then we subtract the
                            // remaining segments (segCount-i), and add the code-start offset, to which we need to add
                            // the corresponding delta to get the actual glyph ID.
                            ///
                            var index = idRangeOffset[i] / 2 - (segCount - i) + (code - start);
                            glyphId = glyphIds[index] || 0;
                            if (glyphId !== 0) {
                                glyphId += idDelta[i];
                            }
                        }
                        codeMap[code] = glyphId & 0xFFFF;
                    }
                }
                break;

              case 6:
                self.length = data.readShort();
                self.language = data.readShort();
                code = data.readShort();
                var length = data.readShort();
                while (length-- > 0) {
                    codeMap[code++] = data.readShort();
                }
                break;

              case 12:
                data.readShort(); // reserved
                self.length = data.readLong();
                self.language = data.readLong();
                var ngroups = data.readLong();
                while (ngroups-- > 0) {
                    code = data.readLong();
                    var endCharCode = data.readLong();
                    var glyphCode = data.readLong();
                    while (code <= endCharCode) {
                        codeMap[code++] = glyphCode++;
                    }
                }
                break;

              default:
                if (window.console) {
                    window.console.error("Unhandled CMAP format: " + self.format);
                }
            }
        });
    }

    function renderCharmap(ncid2ogid, ogid2ngid) {
        var codes = sortedKeys(ncid2ogid);
        var startCodes = [];
        var endCodes = [];
        var last = null;
        var diff = null;

        function new_gid(charcode) {
            return ogid2ngid[ncid2ogid[charcode]];
        }

        for (var i = 0; i < codes.length; ++i) {
            var code = codes[i];
            var gid = new_gid(code);
            var delta = gid - code;
            if (last == null || delta !== diff) {
                if (last) {
                    endCodes.push(last);
                }
                startCodes.push(code);
                diff = delta;
            }
            last = code;
        }

        if (last) {
            endCodes.push(last);
        }
        endCodes.push(0xFFFF);
        startCodes.push(0xFFFF);

        var segCount = startCodes.length;
        var segCountX2 = segCount * 2;
        var searchRange = 2 * Math.pow(2, Math.floor(Math.log(segCount) / Math.LN2));
        var entrySelector = Math.log(searchRange / 2) / Math.LN2;
        var rangeShift = segCountX2 - searchRange;

        var deltas = [];
        var rangeOffsets = [];
        var glyphIds = [];

        for (i = 0; i < segCount; ++i) {
            var startCode = startCodes[i];
            var endCode = endCodes[i];
            if (startCode == 0xFFFF) {
                deltas.push(0);
                rangeOffsets.push(0);
                break;
            }
            var startGlyph = new_gid(startCode);
            if (startCode - startGlyph >= 0x8000) {
                deltas.push(0);
                rangeOffsets.push(2 * (glyphIds.length + segCount - i));
                for (var j = startCode; j <= endCode; ++j) {
                    glyphIds.push(new_gid(j));
                }
            } else {
                deltas.push(startGlyph - startCode);
                rangeOffsets.push(0);
            }
        }

        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();

        out.writeShort(3);      // platformID
        out.writeShort(1);      // platformSpecificID
        out.writeLong(12);      // offset
        out.writeShort(4);      // format
        out.writeShort(16 + segCount * 8 + glyphIds.length * 2); // length
        out.writeShort(0);      // language
        out.writeShort(segCountX2);
        out.writeShort(searchRange);
        out.writeShort(entrySelector);
        out.writeShort(rangeShift);

        endCodes.forEach(out.writeShort);
        out.writeShort(0);      // reserved pad
        startCodes.forEach(out.writeShort);
        deltas.forEach(out.writeShort_);
        rangeOffsets.forEach(out.writeShort);
        glyphIds.forEach(out.writeShort);

        return out.get();
    }

    return deftable({
        parse: function(data) {
            var self = this;
            var offset = self.offset;
            data.offset(offset);
            self.codeMap = {};
            self.version = data.readShort();
            var tableCount = data.readShort();
            self.tables = data.times(tableCount, function(){
                return new CmapEntry(data, offset, self.codeMap);
            });
        },
        render: function(ncid2ogid, ogid2ngid) {
            var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])();
            out.writeShort(0);  // version
            out.writeShort(1);  // tableCount
            out.write(renderCharmap(ncid2ogid, ogid2ngid));
            return out.get();
        }
    });

})();

var OS2Table = deftable({
    parse: function(data) {
        data.offset(this.offset);
        this.version = data.readShort();
        this.averageCharWidth = data.readShort_();
        this.weightClass = data.readShort();
        this.widthClass = data.readShort();
        this.type = data.readShort();
        this.ySubscriptXSize = data.readShort_();
        this.ySubscriptYSize = data.readShort_();
        this.ySubscriptXOffset = data.readShort_();
        this.ySubscriptYOffset = data.readShort_();
        this.ySuperscriptXSize = data.readShort_();
        this.ySuperscriptYSize = data.readShort_();
        this.ySuperscriptXOffset = data.readShort_();
        this.ySuperscriptYOffset = data.readShort_();
        this.yStrikeoutSize = data.readShort_();
        this.yStrikeoutPosition = data.readShort_();
        this.familyClass = data.readShort_();

        this.panose = data.times(10, data.readByte);
        this.charRange = data.times(4, data.readLong);

        this.vendorID = data.readString(4);
        this.selection = data.readShort();
        this.firstCharIndex = data.readShort();
        this.lastCharIndex = data.readShort();

        if (this.version > 0) {
            this.ascent = data.readShort_();
            this.descent = data.readShort_();
            this.lineGap = data.readShort_();
            this.winAscent = data.readShort();
            this.winDescent = data.readShort();
            this.codePageRange = data.times(2, data.readLong);

            if (this.version > 1) {
                this.xHeight = data.readShort();
                this.capHeight = data.readShort();
                this.defaultChar = data.readShort();
                this.breakChar = data.readShort();
                this.maxContext = data.readShort();
            }
        }
    },
    render: function() {
        return this.raw();
    }
});

var subsetTag = 100000;

function nextSubsetTag() {
    var ret = "", n = String(subsetTag);
    for (var i = 0; i < n.length; ++i) {
        ret += String.fromCharCode(n.charCodeAt(i) - 48 + 65);
    }
    ++subsetTag;
    return ret;
}

function Subfont(font) {
    this.font = font;
    this.subset = {};
    this.unicodes = {};
    this.ogid2ngid = { 0: 0 };
    this.ngid2ogid = { 0: 0 };
    this.ncid2ogid = {};
    this.next = this.firstChar = 1;
    this.nextGid = 1;
    this.psName = nextSubsetTag() + "+" + this.font.psName;
}

Subfont.prototype = {
    use: function(ch) {
        var self = this;
        if (typeof ch == "string") {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* ucs2decode */])(ch).reduce(function(ret, code){
                return ret + String.fromCharCode(self.use(code));
            }, "");
        }
        var code = self.unicodes[ch];
        if (!code) {
            code = self.next++;
            self.subset[code] = ch;
            self.unicodes[ch] = code;

            // generate new GID (glyph ID) and maintain newGID ->
            // oldGID and back mappings
            var old_gid = self.font.cmap.codeMap[ch];
            if (old_gid) {
                self.ncid2ogid[code] = old_gid;
                if (self.ogid2ngid[old_gid] == null) {
                    var new_gid = self.nextGid++;
                    self.ogid2ngid[old_gid] = new_gid;
                    self.ngid2ogid[new_gid] = old_gid;
                }
            }
        }
        return code;
    },
    encodeText: function(text) {
        return this.use(text);
    },
    glyphIds: function() {
        return sortedKeys(this.ogid2ngid);
    },
    glyphsFor: function(glyphIds, result) {
        var this$1 = this;

        if (!result) {
            result = {};
        }
        for (var i = 0; i < glyphIds.length; ++i) {
            var id = glyphIds[i];
            if (!result[id]) {
                var glyph = result[id] = this$1.font.glyf.glyphFor(id);
                if (glyph && glyph.compound) {
                    this$1.glyphsFor(glyph.glyphIds, result);
                }
            }
        }
        return result;
    },
    render: function() {
        var this$1 = this;

        var glyphs = this.glyphsFor(this.glyphIds());

        // add missing sub-glyphs
        for (var old_gid in glyphs) {
            if (hasOwnProperty(glyphs, old_gid)) {
                old_gid = parseInt(old_gid, 10);
                if (this$1.ogid2ngid[old_gid] == null) {
                    var new_gid = this$1.nextGid++;
                    this$1.ogid2ngid[old_gid] = new_gid;
                    this$1.ngid2ogid[new_gid] = old_gid;
                }
            }
        }

        // must obtain old_gid_ids in an order matching sorted
        // new_gid_ids
        var new_gid_ids = sortedKeys(this.ngid2ogid);
        var old_gid_ids = new_gid_ids.map(function(id){
            return this.ngid2ogid[id];
        }, this);

        var font = this.font;
        var glyf = font.glyf.render(glyphs, old_gid_ids, this.ogid2ngid);
        var loca = font.loca.render(glyf.offsets);

        this.lastChar = this.next - 1;

        var tables = {
            "cmap" : CmapTable.render(this.ncid2ogid, this.ogid2ngid),
            "glyf" : glyf.table,
            "loca" : loca.table,
            "hmtx" : font.hmtx.render(old_gid_ids),
            "hhea" : font.hhea.render(old_gid_ids),
            "maxp" : font.maxp.render(old_gid_ids),
            "post" : font.post.render(old_gid_ids),
            "name" : font.name.render(this.psName),
            "head" : font.head.render(loca.format),
            "OS/2" : font.os2.render()
        };

        return this.font.directory.render(tables);
    },
    cidToGidMap: function() {
        var this$1 = this;

        var out = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(), len = 0;
        for (var cid = this.firstChar; cid < this.next; ++cid) {
            while (len < cid) {
                out.writeShort(0);
                len++;
            }
            var old_gid = this$1.ncid2ogid[cid];
            if (old_gid) {
                var new_gid = this$1.ogid2ngid[old_gid];
                out.writeShort(new_gid);
            } else {
                out.writeShort(0);
            }
            len++;
        }
        return out.get();
    }
};

function TTFFont(rawData, name) {
    var self = this;
    var data = self.contents = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* BinaryStream */])(rawData);
    if (data.readString(4) == "ttcf") {
        var offset;
        var parse = function() {
            data.offset(offset);
            self.parse();
        };
        if (!name) {
            throw new Error("Must specify a name for TTC files");
        }
        data.readLong();        // version
        var numFonts = data.readLong();
        for (var i = 0; i < numFonts; ++i) {
            offset = data.readLong();
            data.saveExcursion(parse);
            if (self.psName == name) {
                return;
            }
        }
        throw new Error("Font " + name + " not found in collection");
    } else {
        data.offset(0);
        self.parse();
    }
}

TTFFont.prototype = {
    parse: function() {
        var dir = this.directory = new Directory(this.contents);

        this.head = dir.readTable("head", HeadTable);
        this.loca = dir.readTable("loca", LocaTable);
        this.hhea = dir.readTable("hhea", HheaTable);
        this.maxp = dir.readTable("maxp", MaxpTable);
        this.hmtx = dir.readTable("hmtx", HmtxTable);
        this.glyf = dir.readTable("glyf", GlyfTable);
        this.name = dir.readTable("name", NameTable);
        this.post = dir.readTable("post", PostTable);
        this.cmap = dir.readTable("cmap", CmapTable);
        this.os2  = dir.readTable("OS/2", OS2Table);

        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 = 1000 / this.head.unitsPerEm;
    },
    widthOfGlyph: function(glyph) {
        return this.hmtx.forGlyph(glyph).advance * this.scale;
    },
    makeSubset: function() {
        return new Subfont(this);
    }
};



//# sourceMappingURL=ttf.js.map


/***/ }),
/* 703 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_arc__ = __webpack_require__(221);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__path__ = __webpack_require__(141);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_paintable__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_measurable__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__accessors_define_geometry_accessors__ = __webpack_require__(133);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(5);








var DEFAULT_STROKE = "#000";

var Arc = (function (Element) {
    function Arc(geometry, options) {
        if ( geometry === void 0 ) geometry = new __WEBPACK_IMPORTED_MODULE_0__geometry_arc__["a" /* default */]();
        if ( options === void 0 ) options = {};

        Element.call(this, options);

        this.geometry(geometry);

        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["e" /* defined */])(this.options.stroke)) {
            this.stroke(DEFAULT_STROKE);
        }
    }

    if ( Element ) Arc.__proto__ = Element;
    Arc.prototype = Object.create( Element && Element.prototype );
    Arc.prototype.constructor = Arc;

    Arc.prototype._bbox = function _bbox (matrix) {
        return this._geometry.bbox(matrix);
    };

    Arc.prototype.rawBBox = function rawBBox () {
        return this.geometry().bbox();
    };

    Arc.prototype.toPath = function toPath () {
        var path = new __WEBPACK_IMPORTED_MODULE_2__path__["a" /* default */]();
        var curvePoints = this.geometry().curvePoints();

        if (curvePoints.length > 0) {
            path.moveTo(curvePoints[0].x, curvePoints[0].y);

            for (var i = 1; i < curvePoints.length; i += 3) {
                path.curveTo(curvePoints[i], curvePoints[i + 1], curvePoints[i + 2]);
            }
        }

        return path;
    };

    Arc.prototype._containsPoint = function _containsPoint (point) {
        return this.geometry().containsPoint(point);
    };

    Arc.prototype._isOnPath = function _isOnPath (point) {
        return this.geometry()._isOnPath(point, this.options.stroke.width / 2);
    };

    return Arc;
}(__WEBPACK_IMPORTED_MODULE_1__element__["a" /* default */]));

Arc.prototype.nodeType = "Arc";

__WEBPACK_IMPORTED_MODULE_3__mixins_paintable__["a" /* default */].extend(Arc.prototype);
__WEBPACK_IMPORTED_MODULE_4__mixins_measurable__["a" /* default */].extend(Arc.prototype);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__accessors_define_geometry_accessors__["a" /* default */])(Arc.prototype, [ "geometry" ]);

/* unused harmony default export */ var _unused_webpack_default_export = (Arc);
//# sourceMappingURL=arc.js.map


/***/ }),
/* 704 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__geometry_circle__ = __webpack_require__(424);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_paintable__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_measurable__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__accessors_define_geometry_accessors__ = __webpack_require__(133);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(5);







var DEFAULT_STROKE = "#000";

var Circle = (function (Element) {
    function Circle(geometry, options) {
        if ( geometry === void 0 ) geometry = new __WEBPACK_IMPORTED_MODULE_0__geometry_circle__["a" /* default */]();
        if ( options === void 0 ) options = {};

        Element.call(this, options);
        this.geometry(geometry);

        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["e" /* defined */])(this.options.stroke)) {
            this.stroke(DEFAULT_STROKE);
        }
    }

    if ( Element ) Circle.__proto__ = Element;
    Circle.prototype = Object.create( Element && Element.prototype );
    Circle.prototype.constructor = Circle;

    Circle.prototype.rawBBox = function rawBBox () {
        return this._geometry.bbox();
    };

    Circle.prototype._bbox = function _bbox (matrix) {
        return this._geometry.bbox(matrix);
    };

    Circle.prototype._containsPoint = function _containsPoint (point) {
        return this.geometry().containsPoint(point);
    };

    Circle.prototype._isOnPath = function _isOnPath (point) {
        return this.geometry()._isOnPath(point, this.options.stroke.width / 2);
    };

    return Circle;
}(__WEBPACK_IMPORTED_MODULE_4__element__["a" /* default */]));

Circle.prototype.nodeType = "Circle";

__WEBPACK_IMPORTED_MODULE_1__mixins_paintable__["a" /* default */].extend(Circle.prototype);
__WEBPACK_IMPORTED_MODULE_2__mixins_measurable__["a" /* default */].extend(Circle.prototype);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__accessors_define_geometry_accessors__["a" /* default */])(Circle.prototype, [ "geometry" ]);

/* harmony default export */ __webpack_exports__["a"] = (Circle);
//# sourceMappingURL=circle.js.map


/***/ }),
/* 705 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_geometry_accessors__ = __webpack_require__(133);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry_rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__geometry_to_matrix__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util__ = __webpack_require__(5);






var Image = (function (Element) {
    function Image(src, rect, options) {
        if ( rect === void 0 ) rect = new __WEBPACK_IMPORTED_MODULE_2__geometry_rect__["a" /* default */]();
        if ( options === void 0 ) options = {};

        Element.call(this, options);

        this.src(src);
        this.rect(rect);
    }

    if ( Element ) Image.__proto__ = Element;
    Image.prototype = Object.create( Element && Element.prototype );
    Image.prototype.constructor = Image;

    Image.prototype.src = function src (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util__["e" /* defined */])(value)) {
            this.options.set("src", value);
            return this;
        }

        return this.options.get("src");
    };

    Image.prototype.bbox = function bbox (transformation) {
        var combinedMatrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__geometry_to_matrix__["a" /* default */])(this.currentTransform(transformation));
        return this._rect.bbox(combinedMatrix);
    };

    Image.prototype.rawBBox = function rawBBox () {
        return this._rect.bbox();
    };

    Image.prototype._containsPoint = function _containsPoint (point) {
        return this._rect.containsPoint(point);
    };

    Image.prototype._hasFill = function _hasFill () {
        return this.src();
    };

    return Image;
}(__WEBPACK_IMPORTED_MODULE_1__element__["a" /* default */]));

Image.prototype.nodeType = "Image";

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_geometry_accessors__["a" /* default */])(Image.prototype, [ "rect" ]);

/* harmony default export */ __webpack_exports__["a"] = (Image);
//# sourceMappingURL=image.js.map


/***/ }),
/* 706 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group__ = __webpack_require__(98);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_size__ = __webpack_require__(140);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry_rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry_transform__ = __webpack_require__(39);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__alignment_translate_to_point__ = __webpack_require__(135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__alignment_align_start__ = __webpack_require__(413);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__alignment_align_start_reverse__ = __webpack_require__(658);









var DEFAULT_OPTIONS = {
    alignContent: "start",
    justifyContent: "start",
    alignItems: "start",
    spacing: 0,
    orientation: "horizontal",
    lineSpacing: 0,
    wrap: true,
    revers: false
};

var forEach = function (elements, callback) {
    elements.forEach(callback);
};

var forEachReverse = function (elements, callback) {
    var length = elements.length;

    for (var idx = length - 1; idx >= 0; idx--) {
        callback(elements[idx], idx);
    }
};

var Layout = (function (Group) {
    function Layout(rect, options) {
        Group.call(this, Object.assign({}, DEFAULT_OPTIONS, options));
        this._rect = rect;
        this._fieldMap = {};
    }

    if ( Group ) Layout.__proto__ = Group;
    Layout.prototype = Object.create( Group && Group.prototype );
    Layout.prototype.constructor = Layout;

    Layout.prototype.rect = function rect (value) {
        if (value) {
            this._rect = value;
            return this;
        }

        return this._rect;
    };

    Layout.prototype._initMap = function _initMap () {
        var options = this.options;
        var fieldMap = this._fieldMap;
        if (options.orientation === "horizontal") {
            fieldMap.sizeField = "width";
            fieldMap.groupsSizeField = "height";
            fieldMap.groupAxis = "x";
            fieldMap.groupsAxis = "y";
        } else {
            fieldMap.sizeField = "height";
            fieldMap.groupsSizeField = "width";
            fieldMap.groupAxis = "y";
            fieldMap.groupsAxis = "x";
        }

        if (options.reverse) {
            this.forEach = forEachReverse;
            this.justifyAlign = __WEBPACK_IMPORTED_MODULE_7__alignment_align_start_reverse__["a" /* default */];
        } else {
            this.forEach = forEach;
            this.justifyAlign = __WEBPACK_IMPORTED_MODULE_6__alignment_align_start__["a" /* default */];
        }
    };

    Layout.prototype.reflow = function reflow () {
        var this$1 = this;

        if (!this._rect || this.children.length === 0) {
            return;
        }
        this._initMap();

        if (this.options.transform) {
            this.transform(null);
        }

        var options = this.options;
        var rect = this._rect;
        var ref = this._initGroups();
        var groups = ref.groups;
        var groupsSize = ref.groupsSize;
        var ref$1 = this._fieldMap;
        var sizeField = ref$1.sizeField;
        var groupsSizeField = ref$1.groupsSizeField;
        var groupAxis = ref$1.groupAxis;
        var groupsAxis = ref$1.groupsAxis;
        var groupOrigin = new __WEBPACK_IMPORTED_MODULE_3__geometry_point__["a" /* default */]();
        var elementOrigin = new __WEBPACK_IMPORTED_MODULE_3__geometry_point__["a" /* default */]();
        var size = new __WEBPACK_IMPORTED_MODULE_1__geometry_size__["a" /* default */]();
        var groupStart = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__alignment_align_start__["a" /* default */])(groupsSize, rect, options.alignContent, groupsAxis, groupsSizeField);
        var elementStart, group, groupBox;

        var arrangeElements = function (bbox, idx) {
            var element = group.elements[idx];

            elementOrigin[groupAxis] = elementStart;
            elementOrigin[groupsAxis] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__alignment_align_start__["a" /* default */])(bbox.size[groupsSizeField], groupBox, options.alignItems, groupsAxis, groupsSizeField);
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__alignment_translate_to_point__["a" /* default */])(elementOrigin, bbox, element);
            elementStart += bbox.size[sizeField] + options.spacing;
        };

        for (var groupIdx = 0; groupIdx < groups.length; groupIdx++) {
            group = groups[groupIdx];
            groupOrigin[groupAxis] = elementStart = this$1.justifyAlign(group.size, rect, options.justifyContent, groupAxis, sizeField);
            groupOrigin[groupsAxis] = groupStart;
            size[sizeField] = group.size;
            size[groupsSizeField] = group.lineSize;
            groupBox = new __WEBPACK_IMPORTED_MODULE_2__geometry_rect__["a" /* default */](groupOrigin, size);
            this$1.forEach(group.bboxes, arrangeElements);

            groupStart += group.lineSize + options.lineSpacing;
        }

        if (!options.wrap && group.size > rect.size[sizeField]) {
            var scale = rect.size[sizeField] / groupBox.size[sizeField];
            var scaledStart = groupBox.topLeft().scale(scale, scale);
            var scaledSize = groupBox.size[groupsSizeField] * scale;
            var newStart = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__alignment_align_start__["a" /* default */])(scaledSize, rect, options.alignContent, groupsAxis, groupsSizeField);
            var transform = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__geometry_transform__["a" /* default */])();
            if (groupAxis === "x") {
                transform.translate(rect.origin.x - scaledStart.x, newStart - scaledStart.y);
            } else {
                transform.translate(newStart - scaledStart.x, rect.origin.y - scaledStart.y);
            }
            transform.scale(scale, scale);

            this.transform(transform);
        }
    };

    Layout.prototype._initGroups = function _initGroups () {
        var this$1 = this;

        var ref = this;
        var options = ref.options;
        var children = ref.children;
        var lineSpacing = options.lineSpacing;
        var wrap = options.wrap;
        var spacing = options.spacing;
        var sizeField = this._fieldMap.sizeField;
        var group = this._newGroup();
        var groups = [];
        var addGroup = function() {
            groups.push(group);
            groupsSize += group.lineSize + lineSpacing;
        };
        var groupsSize = -lineSpacing;

        for (var idx = 0; idx < children.length; idx++) {
            var element = children[idx];
            var bbox = children[idx].clippedBBox();
            if (element.visible() && bbox) {
                if (wrap && group.size + bbox.size[sizeField] + spacing > this$1._rect.size[sizeField]) {
                    if (group.bboxes.length === 0) {
                        this$1._addToGroup(group, bbox, element);
                        addGroup();
                        group = this$1._newGroup();
                    } else {
                        addGroup();
                        group = this$1._newGroup();
                        this$1._addToGroup(group, bbox, element);
                    }
                } else {
                    this$1._addToGroup(group, bbox, element);
                }
            }
        }

        if (group.bboxes.length) {
            addGroup();
        }

        return {
            groups: groups,
            groupsSize: groupsSize
        };
    };

    Layout.prototype._addToGroup = function _addToGroup (group, bbox, element) {
        group.size += bbox.size[this._fieldMap.sizeField] + this.options.spacing;
        group.lineSize = Math.max(bbox.size[this._fieldMap.groupsSizeField], group.lineSize);
        group.bboxes.push(bbox);
        group.elements.push(element);
    };

    Layout.prototype._newGroup = function _newGroup () {
        return {
            lineSize: 0,
            size: -this.options.spacing,
            bboxes: [],
            elements: []
        };
    };

    return Layout;
}(__WEBPACK_IMPORTED_MODULE_0__group__["a" /* default */]));

/* unused harmony default export */ var _unused_webpack_default_export = (Layout);
//# sourceMappingURL=layout.js.map


/***/ }),
/* 707 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__accessors_define_geometry_accessors__ = __webpack_require__(133);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_paintable__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_measurable__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry_rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util__ = __webpack_require__(5);







var Rect = (function (Element) {
    function Rect(geometry, options) {
        if ( geometry === void 0 ) geometry = new __WEBPACK_IMPORTED_MODULE_4__geometry_rect__["a" /* default */]();
        if ( options === void 0 ) options = {};

        Element.call(this, options);
        this.geometry(geometry);

        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util__["e" /* defined */])(this.options.stroke)) {
            this.stroke("#000");
        }
    }

    if ( Element ) Rect.__proto__ = Element;
    Rect.prototype = Object.create( Element && Element.prototype );
    Rect.prototype.constructor = Rect;

    Rect.prototype._bbox = function _bbox (matrix) {
        return this._geometry.bbox(matrix);
    };

    Rect.prototype.rawBBox = function rawBBox () {
        return this._geometry.bbox();
    };

    Rect.prototype._containsPoint = function _containsPoint (point) {
        return this._geometry.containsPoint(point);
    };

    Rect.prototype._isOnPath = function _isOnPath (point) {
        return this.geometry()._isOnPath(point, this.options.stroke.width / 2);
    };

    return Rect;
}(__WEBPACK_IMPORTED_MODULE_1__element__["a" /* default */]));

Rect.prototype.nodeType = "Rect";

__WEBPACK_IMPORTED_MODULE_2__mixins_paintable__["a" /* default */].extend(Rect.prototype);
__WEBPACK_IMPORTED_MODULE_3__mixins_measurable__["a" /* default */].extend(Rect.prototype);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__accessors_define_geometry_accessors__["a" /* default */])(Rect.prototype, [ "geometry" ]);

/* unused harmony default export */ var _unused_webpack_default_export = (Rect);


//# sourceMappingURL=rect.js.map


/***/ }),
/* 708 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__element__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__geometry_point__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__geometry_rect__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__geometry_to_matrix__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_paintable__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__accessors_define_point_accessors__ = __webpack_require__(134);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util__ = __webpack_require__(5);








var DEFAULT_FONT = "12px sans-serif";
var DEFAULT_FILL = "#000";

var Text = (function (Element) {
    function Text(content, position, options) {
        if ( position === void 0 ) position = new __WEBPACK_IMPORTED_MODULE_1__geometry_point__["a" /* default */]();
        if ( options === void 0 ) options = {};

        Element.call(this, options);

        this.content(content);
        this.position(position);

        if (!this.options.font) {
            this.options.font = DEFAULT_FONT;
        }

        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["e" /* defined */])(this.options.fill)) {
            this.fill(DEFAULT_FILL);
        }
    }

    if ( Element ) Text.__proto__ = Element;
    Text.prototype = Object.create( Element && Element.prototype );
    Text.prototype.constructor = Text;

    Text.prototype.content = function content (value) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["e" /* defined */])(value)) {
            this.options.set("content", value);
            return this;
        }

        return this.options.get("content");
    };

    Text.prototype.measure = function measure () {
        var metrics = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util__["w" /* measureText */])(this.content(), {
            font: this.options.get("font")
        });

        return metrics;
    };

    Text.prototype.rect = function rect () {
        var size = this.measure();
        var pos = this.position().clone();
        return new __WEBPACK_IMPORTED_MODULE_2__geometry_rect__["a" /* default */](pos, [ size.width, size.height ]);
    };

    Text.prototype.bbox = function bbox (transformation) {
        var combinedMatrix = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__geometry_to_matrix__["a" /* default */])(this.currentTransform(transformation));
        return this.rect().bbox(combinedMatrix);
    };

    Text.prototype.rawBBox = function rawBBox () {
        return this.rect().bbox();
    };

    Text.prototype._containsPoint = function _containsPoint (point) {
        return this.rect().containsPoint(point);
    };

    return Text;
}(__WEBPACK_IMPORTED_MODULE_0__element__["a" /* default */]));

Text.prototype.nodeType = "Text";

__WEBPACK_IMPORTED_MODULE_4__mixins_paintable__["a" /* default */].extend(Text.prototype);

__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__accessors_define_point_accessors__["a" /* default */])(Text.prototype, [ "position" ]);

/* harmony default export */ __webpack_exports__["a"] = (Text);
//# sourceMappingURL=text.js.map


/***/ }),
/* 709 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__svg_surface__ = __webpack_require__(717);
/* unused harmony reexport Surface */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__svg_root_node__ = __webpack_require__(228);
/* unused harmony reexport RootNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__svg_node__ = __webpack_require__(45);
/* unused harmony reexport Node */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__svg_group_node__ = __webpack_require__(713);
/* unused harmony reexport GroupNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__svg_arc_node__ = __webpack_require__(710);
/* unused harmony reexport ArcNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__svg_circle_node__ = __webpack_require__(711);
/* unused harmony reexport CircleNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__svg_rect_node__ = __webpack_require__(716);
/* unused harmony reexport RectNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__svg_image_node__ = __webpack_require__(714);
/* unused harmony reexport ImageNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__svg_text_node__ = __webpack_require__(718);
/* unused harmony reexport TextNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__svg_path_node__ = __webpack_require__(55);
/* unused harmony reexport PathNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__svg_multi_path_node__ = __webpack_require__(715);
/* unused harmony reexport MultiPathNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__svg_definition_node__ = __webpack_require__(445);
/* unused harmony reexport DefinitionNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__svg_clip_node__ = __webpack_require__(444);
/* unused harmony reexport ClipNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__svg_gradient_stop_node__ = __webpack_require__(448);
/* unused harmony reexport GradientStopNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__svg_linear_gradient_node__ = __webpack_require__(449);
/* unused harmony reexport LinearGradientNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__svg_radial_gradient_node__ = __webpack_require__(450);
/* unused harmony reexport RadialGradientNode */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__svg_export_group__ = __webpack_require__(446);
/* unused harmony reexport exportGroup */




















//# sourceMappingURL=svg.js.map


/***/ }),
/* 710 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(55);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(41);



var ArcNode = (function (PathNode) {
    function ArcNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) ArcNode.__proto__ = PathNode;
    ArcNode.prototype = Object.create( PathNode && PathNode.prototype );
    ArcNode.prototype.constructor = ArcNode;

    ArcNode.prototype.renderData = function renderData () {
        return this.printPath(this.srcElement.toPath());
    };

    return ArcNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Arc = ArcNode;

/* unused harmony default export */ var _unused_webpack_default_export = (ArcNode);
//# sourceMappingURL=arc-node.js.map


/***/ }),
/* 711 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(55);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(41);



var CircleNode = (function (PathNode) {
    function CircleNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) CircleNode.__proto__ = PathNode;
    CircleNode.prototype = Object.create( PathNode && PathNode.prototype );
    CircleNode.prototype.constructor = CircleNode;

    CircleNode.prototype.geometryChange = function geometryChange () {
        var center = this.center();
        this.attr("cx", center.x);
        this.attr("cy", center.y);
        this.attr("r", this.radius());
        this.invalidate();
    };

    CircleNode.prototype.center = function center () {
        return this.srcElement.geometry().center;
    };

    CircleNode.prototype.radius = function radius () {
        return this.srcElement.geometry().radius;
    };

    CircleNode.prototype.template = function template () {
        return "<circle " + (this.renderId()) + " " + (this.renderStyle()) + " " + (this.renderOpacity()) +
                    "cx='" + (this.center().x) + "' cy='" + (this.center().y) + "' r='" + (this.radius()) + "'" +
                    (this.renderStroke()) + " " + (this.renderFill()) + " " + (this.renderDefinitions()) +
                    (this.renderTransform()) + " ></circle>";
    };

    return CircleNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Circle = CircleNode;

/* unused harmony default export */ var _unused_webpack_default_export = (CircleNode);
//# sourceMappingURL=circle-node.js.map


/***/ }),
/* 712 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__export_group__ = __webpack_require__(446);



function exportSVG(group, options) {
    var svg = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__export_group__["a" /* default */])(group);

    if (!options || !options.raw) {
        svg = "data:image/svg+xml;base64," + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["c" /* encodeBase64 */])(svg);
    }

    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__["a" /* createPromise */])().resolve(svg);
}

//# sourceMappingURL=export-svg.js.map


/***/ }),
/* 713 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node__ = __webpack_require__(45);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(41);



var GroupNode = (function (Node) {
    function GroupNode () {
        Node.apply(this, arguments);
    }

    if ( Node ) GroupNode.__proto__ = Node;
    GroupNode.prototype = Object.create( Node && Node.prototype );
    GroupNode.prototype.constructor = GroupNode;

    GroupNode.prototype.template = function template () {
        return ("<g" + (this.renderId() + this.renderTransform() + this.renderStyle() + this.renderOpacity() + this.renderDefinitions()) + ">" + (this.renderChildren()) + "</g>");
    };

    GroupNode.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "transform") {
            this.transformChange(e.value);
        }

        Node.prototype.optionsChange.call(this, e);
    };

    return GroupNode;
}(__WEBPACK_IMPORTED_MODULE_0__node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Group = GroupNode;

/* unused harmony default export */ var _unused_webpack_default_export = (GroupNode);
//# sourceMappingURL=group-node.js.map


/***/ }),
/* 714 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(55);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_render_all_attributes__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common__ = __webpack_require__(8);





var ImageNode = (function (PathNode) {
    function ImageNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) ImageNode.__proto__ = PathNode;
    ImageNode.prototype = Object.create( PathNode && PathNode.prototype );
    ImageNode.prototype.constructor = ImageNode;

    ImageNode.prototype.geometryChange = function geometryChange () {
        this.allAttr(this.mapPosition());
        this.invalidate();
    };

    ImageNode.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "src") {
            this.allAttr(this.mapSource());
        }

        PathNode.prototype.optionsChange.call(this, e);
    };

    ImageNode.prototype.mapPosition = function mapPosition () {
        var rect = this.srcElement.rect();
        var tl = rect.topLeft();

        return [
            [ "x", tl.x ],
            [ "y", tl.y ],
            [ "width", rect.width() + "px" ],
            [ "height", rect.height() + "px" ]
        ];
    };

    ImageNode.prototype.renderPosition = function renderPosition () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_all_attributes__["a" /* default */])(this.mapPosition());
    };

    ImageNode.prototype.mapSource = function mapSource (encode) {
        var src = this.srcElement.src();

        if (encode) {
            src = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common__["i" /* htmlEncode */])(src);
        }

        return [ [ "xlink:href", src ] ];
    };

    ImageNode.prototype.renderSource = function renderSource () {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_all_attributes__["a" /* default */])(this.mapSource(true));
    };

    ImageNode.prototype.template = function template () {
        return "<image preserveAspectRatio='none' " + (this.renderId()) + " " + (this.renderStyle()) + " " + (this.renderTransform()) + " " + (this.renderOpacity()) +
               (this.renderPosition()) + " " + (this.renderSource()) + " " + (this.renderDefinitions()) + ">" +
               "</image>";
    };

    return ImageNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Image = ImageNode;

/* unused harmony default export */ var _unused_webpack_default_export = (ImageNode);
//# sourceMappingURL=image-node.js.map


/***/ }),
/* 715 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(55);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(41);



var MultiPathNode = (function (PathNode) {
    function MultiPathNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) MultiPathNode.__proto__ = PathNode;
    MultiPathNode.prototype = Object.create( PathNode && PathNode.prototype );
    MultiPathNode.prototype.constructor = MultiPathNode;

    MultiPathNode.prototype.renderData = function renderData () {
        var this$1 = this;

        var paths = this.srcElement.paths;

        if (paths.length > 0) {
            var result = [];

            for (var i = 0; i < paths.length; i++) {
                result.push(this$1.printPath(paths[i]));
            }

            return result.join(" ");
        }
    };

    return MultiPathNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].MultiPath = MultiPathNode;

/* unused harmony default export */ var _unused_webpack_default_export = (MultiPathNode);
//# sourceMappingURL=multi-path-node.js.map


/***/ }),
/* 716 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(55);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_map__ = __webpack_require__(41);



var RectNode = (function (PathNode) {
    function RectNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) RectNode.__proto__ = PathNode;
    RectNode.prototype = Object.create( PathNode && PathNode.prototype );
    RectNode.prototype.constructor = RectNode;

    RectNode.prototype.geometryChange = function geometryChange () {
        var geometry = this.srcElement.geometry();
        this.attr("x", geometry.origin.x);
        this.attr("y", geometry.origin.y);
        this.attr("width", geometry.size.width);
        this.attr("height", geometry.size.height);
        this.invalidate();
    };

    RectNode.prototype.size = function size () {
        return this.srcElement.geometry().size;
    };

    RectNode.prototype.origin = function origin () {
        return this.srcElement.geometry().origin;
    };

    RectNode.prototype.template = function template () {
        return "<rect " + (this.renderId()) + " " + (this.renderStyle()) + " " + (this.renderOpacity()) + " x='" + (this.origin().x) + "' y='" + (this.origin().y) + "' " +
                    "width='" + (this.size().width) + "' height='" + (this.size().height) + "' " + (this.renderStroke()) + " " +
                    (this.renderFill()) + " " + (this.renderDefinitions()) + " " + (this.renderTransform()) + " />";
    };

    return RectNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_1__node_map__["a" /* default */].Rect = RectNode;

/* unused harmony default export */ var _unused_webpack_default_export = (RectNode);
//# sourceMappingURL=rect-node.js.map


/***/ }),
/* 717 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_surface__ = __webpack_require__(220);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__core_surface_factory__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__root_node__ = __webpack_require__(228);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__shapes_group__ = __webpack_require__(98);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__geometry_transform__ = __webpack_require__(39);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_render_svg__ = __webpack_require__(452);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(99);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(5);









var RTL = 'rtl';

function alignToScreen(element) {
    var ctm;

    try {
        ctm = element.getScreenCTM ? element.getScreenCTM() : null;
    } catch (e) { } // eslint-disable-line no-empty

    if (ctm) {
        var left = - ctm.e % 1;
        var top = - ctm.f % 1;
        var style = element.style;

        if (left !== 0 || top !== 0) {
            style.left = left + "px";
            style.top = top + "px";
        }
    }
}

var Surface = (function (BaseSurface) {
    function Surface(element, options) {
        BaseSurface.call(this, element, options);

        this._root = new __WEBPACK_IMPORTED_MODULE_2__root_node__["a" /* default */](Object.assign({
            rtl: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["p" /* elementStyles */])(element, 'direction').direction === RTL
        }, this.options));

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_render_svg__["a" /* default */])(this.element, this._template());

        this._rootElement = this.element.firstElementChild;

        alignToScreen(this._rootElement);

        this._root.attachTo(this._rootElement);

        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["l" /* bindEvents */])(this.element, {
            click: this._click,
            mouseover: this._mouseenter,
            mouseout: this._mouseleave,
            mousemove: this._mousemove
        });

        this.resize();
    }

    if ( BaseSurface ) Surface.__proto__ = BaseSurface;
    Surface.prototype = Object.create( BaseSurface && BaseSurface.prototype );
    Surface.prototype.constructor = Surface;

    Surface.prototype.destroy = function destroy () {
        if (this._root) {
            this._root.destroy();
            this._root = null;
            this._rootElement = null;
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__util__["m" /* unbindEvents */])(this.element, {
                click: this._click,
                mouseover: this._mouseenter,
                mouseout: this._mouseleave,
                mousemove: this._mousemove
            });
        }

        BaseSurface.prototype.destroy.call(this);
    };

    Surface.prototype.translate = function translate (offset) {
        var viewBox = (Math.round(offset.x)) + " " + (Math.round(offset.y)) + " " + (this._size.width) + " " + (this._size.height);

        this._offset = offset;
        this._rootElement.setAttribute("viewBox", viewBox);
    };

    Surface.prototype.draw = function draw (element) {
        BaseSurface.prototype.draw.call(this, element);
        this._root.load([ element ]);
    };

    Surface.prototype.clear = function clear () {
        BaseSurface.prototype.clear.call(this);
        this._root.clear();
    };

    Surface.prototype.svg = function svg () {
        return "<?xml version='1.0' ?>" + this._template();
    };

    Surface.prototype.exportVisual = function exportVisual () {
        var ref = this;
        var visual = ref._visual;
        var offset = ref._offset;

        if (offset) {
            var wrap = new __WEBPACK_IMPORTED_MODULE_3__shapes_group__["a" /* default */]();
            wrap.children.push(visual);

            wrap.transform(
                __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__geometry_transform__["a" /* default */])().translate(-offset.x, -offset.y)
            );

            visual = wrap;
        }

        return visual;
    };

    Surface.prototype._resize = function _resize () {
        if (this._offset) {
            this.translate(this._offset);
        }
    };

    Surface.prototype._template = function _template () {
        return ("<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='" + __WEBPACK_IMPORTED_MODULE_6__constants__["a" /* SVG_NS */] + "' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>" + (this._root.render()) + "</svg>");
    };

    return Surface;
}(__WEBPACK_IMPORTED_MODULE_0__core_surface__["a" /* default */]));

Surface.prototype.type = "svg";

if (typeof document !== "undefined" && document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")) {
    __WEBPACK_IMPORTED_MODULE_0__core_surface__["a" /* default */].support.svg = true;
    __WEBPACK_IMPORTED_MODULE_1__core_surface_factory__["a" /* default */].current.register("svg", Surface, 10);
}

/* unused harmony default export */ var _unused_webpack_default_export = (Surface);
//# sourceMappingURL=surface.js.map


/***/ }),
/* 718 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__path_node__ = __webpack_require__(55);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_render_style__ = __webpack_require__(451);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_render_attribute__ = __webpack_require__(100);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__node_map__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__text_metrics__ = __webpack_require__(453);







var ENTITY_REGEX = /&(?:[a-zA-Z]+|#\d+);/g;

function decodeEntities(text) {
    if (!text || typeof text !== "string" || !ENTITY_REGEX.test(text)) {
        return text;
    }

    var element = decodeEntities._element;
    ENTITY_REGEX.lastIndex = 0;

    return text.replace(ENTITY_REGEX, function (match) {
        element.innerHTML = match;

        return element.textContent || element.innerText;
    });
}

if (typeof document !== "undefined") {
    decodeEntities._element = document.createElement("span");
}

var TextNode = (function (PathNode) {
    function TextNode () {
        PathNode.apply(this, arguments);
    }

    if ( PathNode ) TextNode.__proto__ = PathNode;
    TextNode.prototype = Object.create( PathNode && PathNode.prototype );
    TextNode.prototype.constructor = TextNode;

    TextNode.prototype.geometryChange = function geometryChange () {
        var pos = this.pos();
        this.attr("x", pos.x);
        this.attr("y", pos.y);
        this.invalidate();
    };

    TextNode.prototype.optionsChange = function optionsChange (e) {
        if (e.field === "font") {
            this.attr("style", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_render_style__["a" /* default */])(this.mapStyle()));
            this.geometryChange();
        } else if (e.field === "content") {
            PathNode.prototype.content.call(this, this.srcElement.content());
        }

        PathNode.prototype.optionsChange.call(this, e);
    };

    TextNode.prototype.mapStyle = function mapStyle (encode) {
        var style = PathNode.prototype.mapStyle.call(this, encode);
        var font = this.srcElement.options.font;

        if (encode) {
            font = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common__["i" /* htmlEncode */])(font);
        }

        style.push([ "font", font ], [ "white-space", "pre" ]);

        return style;
    };

    TextNode.prototype.pos = function pos () {
        var pos = this.srcElement.position();
        var size = this.srcElement.measure();
        return pos.clone().setY(pos.y + size.baseline);
    };

    TextNode.prototype.renderContent = function renderContent () {
        var content = this.srcElement.content();
        content = decodeEntities(content);
        content = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common__["i" /* htmlEncode */])(content);

        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__text_metrics__["a" /* normalizeText */])(content);
    };

    TextNode.prototype.renderTextAnchor = function renderTextAnchor () {
        var anchor;

        if ((this.options || {}).rtl && !(__WEBPACK_IMPORTED_MODULE_4__common__["a" /* support */].browser.msie || __WEBPACK_IMPORTED_MODULE_4__common__["a" /* support */].browser.edge)) {
            anchor = 'end';
        }

        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_render_attribute__["a" /* default */])("text-anchor", anchor);
    };

    TextNode.prototype.template = function template () {
        return "<text " + (this.renderId()) + " " + (this.renderTextAnchor()) + " " + (this.renderStyle()) + " " + (this.renderOpacity()) +
                    "x='" + (this.pos().x) + "' y='" + (this.pos().y) + "' " + (this.renderStroke()) + " " + (this.renderTransform()) + " " + (this.renderDefinitions()) +
                    (this.renderFill()) + ">" + (this.renderContent()) + "</text>";
    };

    return TextNode;
}(__WEBPACK_IMPORTED_MODULE_0__path_node__["a" /* default */]));

__WEBPACK_IMPORTED_MODULE_3__node_map__["a" /* default */].Text = TextNode;

/* unused harmony default export */ var _unused_webpack_default_export = (TextNode);
//# sourceMappingURL=text-node.js.map


/***/ }),
/* 719 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = measureText;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__text_metrics__ = __webpack_require__(455);


function measureText(text, style, measureBox) {
    return __WEBPACK_IMPORTED_MODULE_0__text_metrics__["a" /* default */].current.measure(text, style, measureBox);
}

//# sourceMappingURL=measure-text.js.map


/***/ }),
/* 720 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = append;
function append(first, second) {
    first.push.apply(first, second);
    return first;
}
//# sourceMappingURL=append.js.map


/***/ }),
/* 721 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = arabicToRoman;
/* eslint-disable key-spacing,no-multi-spaces,no-param-reassign */

var literals = {
    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",
    1000 : "m"
};

function arabicToRoman(n) {
    var values = [ 1000,
                   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 ];

    var roman = "";
    while (n > 0) {
        if (n < values[0]) {
            values.shift();
        } else {
            roman += literals[values[0]];
            n -= values[0];
        }
    }
    return roman;
}
//# sourceMappingURL=arabic-to-roman.js.map


/***/ }),
/* 722 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = bindEvents;
function bindEvents(element, events) {
    for (var eventName in events) {
        var eventNames = eventName.trim().split(" ");
        for (var idx = 0; idx < eventNames.length; idx++) {
            element.addEventListener(eventNames[idx], events[eventName], false);
        }
    }
}
//# sourceMappingURL=bind-events.js.map


/***/ }),
/* 723 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = createPromise;
function createPromise() {
    var resolveFn, rejectFn;
    var promise = new Promise(function (resolve, reject) {
        resolveFn = function (data) {
            promise._state = "resolved";
            resolve(data);
            return promise;
        };
        rejectFn = function (data) {
            promise._state = "rejected";
            reject(data);

            return promise;
        };
    });
    promise._state = "pending";
    promise.resolve = resolveFn;
    promise.reject = rejectFn;
    promise.state = function () { return promise._state; };

    return promise;
}

//# sourceMappingURL=create-promise.js.map


/***/ }),
/* 724 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = definitionId;
var defId = 1;

function definitionId() {
    return "kdef" + defId++;
}
//# sourceMappingURL=definition-id.js.map


/***/ }),
/* 725 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = deg;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(229);


function deg(radians) {
    return radians / __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* DEG_TO_RAD */];
}
//# sourceMappingURL=deg.js.map


/***/ }),
/* 726 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = elementOffset;
function elementOffset(element) {
    var box = element.getBoundingClientRect();

    var documentElement = document.documentElement;

    return {
        top: box.top + (window.pageYOffset || documentElement.scrollTop) - (documentElement.clientTop || 0),
        left: box.left + (window.pageXOffset || documentElement.scrollLeft) - (documentElement.clientLeft || 0)
    };
}
//# sourceMappingURL=element-offset.js.map


/***/ }),
/* 727 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = elementSize;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__element_styles__ = __webpack_require__(457);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defined__ = __webpack_require__(101);



function getPixels(value) {
    if (isNaN(value)) {
        return value;
    }
    return value + "px";
}

function elementSize(element, size) {
    if (size) {
        var width = size.width;
        var height = size.height;

        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__defined__["a" /* default */])(width)) {
            element.style.width = getPixels(width);
        }

        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__defined__["a" /* default */])(height)) {
            element.style.height = getPixels(height);
        }

    } else {
        var size$1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__element_styles__["a" /* default */])(element, [ 'width', 'height' ]);

        return {
            width: parseInt(size$1.width, 10),
            height: parseInt(size$1.height, 10)
        };
    }
}
//# sourceMappingURL=element-size.js.map


/***/ }),
/* 728 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = encodeBase64;
var KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var fromCharCode = String.fromCharCode;

function encodeUTF8(input) {
    var output = "";

    for (var i = 0; i < input.length; i++) {
        var c = input.charCodeAt(i);

        if (c < 0x80) {
            // One byte
            output += fromCharCode(c);
        } else if (c < 0x800) {
            // Two bytes
            output += fromCharCode(0xC0 | (c >>> 6));
            output += fromCharCode(0x80 | (c & 0x3f));
        } else if (c < 0x10000) {
            // Three bytes
            output += fromCharCode(0xE0 | (c >>> 12));
            output += fromCharCode(0x80 | (c >>> 6 & 0x3f));
            output += fromCharCode(0x80 | (c & 0x3f));
        }
    }

    return output;
}

function encodeBase64(input) {
    var output = "";
    var i = 0;

    var utfInput = encodeUTF8(input);

    while (i < utfInput.length) {
        var chr1 = utfInput.charCodeAt(i++);
        var chr2 = utfInput.charCodeAt(i++);
        var chr3 = utfInput.charCodeAt(i++);

        var enc1 = chr1 >> 2;
        var enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        var enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        var enc4 = chr3 & 63;

        if (isNaN(chr2)) {
            enc3 = enc4 = 64;
        } else if (isNaN(chr3)) {
            enc4 = 64;
        }

        output = output +
            KEY_STR.charAt(enc1) + KEY_STR.charAt(enc2) +
            KEY_STR.charAt(enc3) + KEY_STR.charAt(enc4);
    }

    return output;
}
//# sourceMappingURL=encode-base64.js.map


/***/ }),
/* 729 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = eventCoordinates;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defined__ = __webpack_require__(101);


function eventCoordinates(e) {
    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defined__["a" /* default */])((e.x || {}).location)) {
        return {
            x: e.x.location,
            y: e.y.location
        };
    }

    return {
        x: e.pageX || e.clientX || 0,
        y: e.pageY || e.clientY || 0
    };
}
//# sourceMappingURL=event-coordinates.js.map


/***/ }),
/* 730 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = eventElement;
function eventElement(e) {
    if ( e === void 0 ) e = {};

    return e.touch ? e.touch.initialTouch : e.target;
}
//# sourceMappingURL=event-element.js.map


/***/ }),
/* 731 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = isTransparent;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defined__ = __webpack_require__(101);


function isTransparent(color) {
    return color === "" || color === null || color === "none" || color === "transparent" || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defined__["a" /* default */])(color);
}
//# sourceMappingURL=is-transparent.js.map


/***/ }),
/* 732 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = last;
function last(array) {
    if (array) {
        return array[array.length - 1];
    }
}
//# sourceMappingURL=last.js.map


/***/ }),
/* 733 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = limitValue;
function limitValue(value, min, max) {
    return Math.max(Math.min(value, max), min);
}
//# sourceMappingURL=limit-value.js.map


/***/ }),
/* 734 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = mergeSort;
/* eslint-disable no-multi-spaces, key-spacing, indent, camelcase, space-before-blocks, eqeqeq, brace-style */
/* eslint-disable space-infix-ops, space-before-function-paren, array-bracket-spacing, object-curly-spacing */
/* eslint-disable no-nested-ternary, max-params, default-case, no-else-return, no-empty */
/* eslint-disable no-param-reassign, no-var, block-scoped-var */

// mergeSort is stable.
function mergeSort(a, cmp) {
    if (a.length < 2) {
        return a.slice();
    }
    function merge(a, b) {
        var r = [], ai = 0, bi = 0, i = 0;
        while (ai < a.length && bi < b.length) {
            if (cmp(a[ai], b[bi]) <= 0) {
                r[i++] = a[ai++];
            } else {
                r[i++] = b[bi++];
            }
        }
        if (ai < a.length) {
            r.push.apply(r, a.slice(ai));
        }
        if (bi < b.length) {
            r.push.apply(r, b.slice(bi));
        }
        return r;
    }
    return (function sort(a) {
        if (a.length <= 1) {
            return a;
        }
        var m = Math.floor(a.length / 2);
        var left = a.slice(0, m);
        var right = a.slice(m);
        left = sort(left);
        right = sort(right);
        return merge(left, right);
    })(a);
}
//# sourceMappingURL=merge-sort.js.map


/***/ }),
/* 735 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = promiseAll;
function promiseAll(promises) {
    return Promise.all(promises);
}
//# sourceMappingURL=promise-all.js.map


/***/ }),
/* 736 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = rad;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(229);


function rad(degrees) {
    return degrees * __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* DEG_TO_RAD */];
}

//# sourceMappingURL=rad.js.map


/***/ }),
/* 737 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = round;
function pow(p) {
    if (p) {
        return Math.pow(10, p);
    }

    return 1;
}

function round(value, precision) {
    var power = pow(precision);
    return Math.round(value * power) / power;
}
//# sourceMappingURL=round.js.map


/***/ }),
/* 738 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = unbindEvents;
function unbindEvents(element, events) {
    if ( events === void 0 ) events = {};

    for (var name in events) {
        var eventNames = name.trim().split(" ");
        for (var idx = 0; idx < eventNames.length; idx++) {
            element.removeEventListener(eventNames[idx], events[name], false);
        }
    }
}
//# sourceMappingURL=unbind-events.js.map


/***/ }),
/* 739 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = valueOrDefault;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defined__ = __webpack_require__(101);


function valueOrDefault(value, defaultValue) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defined__["a" /* default */])(value) ? value : defaultValue;
}
//# sourceMappingURL=value-or-default.js.map


/***/ }),
/* 740 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dist_es_main__ = __webpack_require__(697);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__dist_es_main__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__dist_es_main__["b"]; });


/***/ }),
/* 741 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export encodeBase64 */
var KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var fromCharCode = String.fromCharCode;

function encodeBase64(plainText) {
  var input = encodeUTF8(plainText);
  var output = "";
  var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  var i = 0;

  while (i < input.length) {
    chr1 = input.charCodeAt(i++);
    chr2 = input.charCodeAt(i++);
    chr3 = input.charCodeAt(i++);

    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;

    if (isNaN(chr2)) {
      enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
      enc4 = 64;
    }

    output = output +
      KEY_STR.charAt(enc1) + KEY_STR.charAt(enc2) +
      KEY_STR.charAt(enc3) + KEY_STR.charAt(enc4);
  }

  return output;
}

function encodeUTF8(input) {
  var output = "";

  for (var i = 0; i < input.length; i++) {
    var c = input.charCodeAt(i);

    if (c < 0x80) {
      // One byte
      output += fromCharCode(c);
    } else if (c < 0x800) {
      // Two bytes
      output += fromCharCode(0xC0 | (c >>> 6));
      output += fromCharCode(0x80 | (c & 0x3f));
    } else if (c < 0x10000) {
      // Three bytes
      output += fromCharCode(0xE0 | (c >>> 12));
      output += fromCharCode(0x80 | (c >>> 6 & 0x3f));
      output += fromCharCode(0x80 | (c & 0x3f));
    }
  }

  return output;
}

//# sourceMappingURL=base64.js.map


/***/ }),
/* 742 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = saveAs;
function saveAs(data, fileName, options) {
  if ( options === void 0 ) options = {};

  var save = postToProxy;

  if (options.forceProxy && !options.proxyURL) {
    throw new Error('No proxyURL is set, but forceProxy is true');
  }

  if (!options.forceProxy) {
    if (canDownload()) {
      save = saveAsDataURI;
    }

    if (navigator.msSaveBlob) {
      save = saveAsBlob;
    }
  }

  save(data, fileName, options);
}

var anchor = function () { return document.createElement('a'); };
var canDownload = function () { return 'download' in anchor(); };

function saveAsBlob(data, fileName) {
  var blob = data; // could be a Blob object

  if (typeof data === 'string') {
    var parts = data.split(';base64,');
    var contentType = parts[0];
    var base64 = atob(parts[1]);
    var array = new Uint8Array(base64.length);

    for (var idx = 0; idx < base64.length; idx++) {
      array[idx] = base64.charCodeAt(idx);
    }

    blob = new Blob([ array.buffer ], { type: contentType });
  }

  navigator.msSaveBlob(blob, fileName);
}

function saveAsDataURI(data, fileName) {
  var dataURI = data;
  if (window.Blob && data instanceof Blob) {
    dataURI = URL.createObjectURL(data);
  }

  var fileSaver = anchor();
  fileSaver.download = fileName;
  fileSaver.href = dataURI;

  var e = document.createEvent('MouseEvents');
  e.initMouseEvent('click', true, false, window,
  0, 0, 0, 0, 0, false, false, false, false, 0, null);

  fileSaver.dispatchEvent(e);
  setTimeout(function () { return URL.revokeObjectURL(dataURI); });
}

function postToProxy(dataURI, fileName, options) {
  if (!options.proxyURL) {
    return;
  }

  var form = document.createElement('form');
  form.setAttribute('action', options.proxyURL);
  form.setAttribute('method', 'POST');
  form.setAttribute('target', options.proxyTarget || '_self');

  var formData = options.proxyData || {};
  formData.fileName = fileName;

  var parts = dataURI.split(";base64,");
  formData.contentType = parts[0].replace("data:", "");
  formData.base64 = parts[1];

  for (var name in formData) {
    if (formData.hasOwnProperty(name)) {
      var input = document.createElement('input');
      input.setAttribute('type', 'hidden');
      input.setAttribute('name', name);
      input.setAttribute('value', formData[name]);

      form.appendChild(input);
    }
  }

  document.body.appendChild(form);
  form.submit();
  document.body.removeChild(form);
}


//# sourceMappingURL=save-as.js.map


/***/ }),
/* 743 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__services_template_service__ = __webpack_require__(460);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_getter__ = __webpack_require__(747);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_map__ = __webpack_require__(461);




function defaultGroupHeaderTemplate(data) {
    return ((data.title) + ": " + (data.value));
}

function createArray(length, callback) {
    var result = [];

    for (var idx = 0; idx < length; idx++) {
        result.push(callback(idx));
    }

    return result;
}

var ExcelExporter = function ExcelExporter(options) {
    options.columns = this._trimColumns(options.columns || []);

    this.allColumns = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_map__["a" /* default */])(this._leafColumns(options.columns || []), this._prepareColumn);

    this.columns = this.allColumns.filter(function(column) { return !column.hidden; });

    this.options = options;
    this.data = options.data || [];
    this.aggregates = options.aggregates || {};
    this.groups = [].concat(options.groups || []);
    this.hierarchy = options.hierarchy;
};

ExcelExporter.prototype.workbook = function workbook () {
    var workbook = {
        sheets: [ {
            columns: this._columns(),
            rows: this._rows(),
            freezePane: this._freezePane(),
            filter: this._filter()
        } ]
    };

    return workbook;
};

ExcelExporter.prototype._trimColumns = function _trimColumns (columns) {
        var this$1 = this;

    return columns.filter(function (column) {
        var result = Boolean(column.field);

        if (!result && column.columns) {
            result = this$1._trimColumns(column.columns).length > 0;
        }

        return result;
    });
};

ExcelExporter.prototype._leafColumns = function _leafColumns (columns) {
        var this$1 = this;

    var result = [];

    for (var idx = 0; idx < columns.length; idx++) {
        if (!columns[idx].columns) {
            result.push(columns[idx]);
        } else {
            result = result.concat(this$1._leafColumns(columns[idx].columns));
        }
    }

    return result;
};

ExcelExporter.prototype._prepareColumn = function _prepareColumn (column) {
    if (!column.field) {
        return null;
    }

    var value = function(dataItem) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_getter__["a" /* default */])(column.field)(dataItem);
    };

    var values = null;

    if (column.values) {
        values = {};

        column.values.forEach(function(item) {
            values[item.value] = item.text;
        });

        value = function(dataItem) {
            return values[__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_getter__["a" /* default */])(column.field)(dataItem)];
        };
    }

    return Object.assign({}, column, {
        value: value,
        values: values,
        groupHeaderTemplate: column.groupHeaderTemplate ? __WEBPACK_IMPORTED_MODULE_0__services_template_service__["a" /* default */].compile(column.groupHeaderTemplate) : defaultGroupHeaderTemplate,
        groupFooterTemplate: column.groupFooterTemplate ? __WEBPACK_IMPORTED_MODULE_0__services_template_service__["a" /* default */].compile(column.groupFooterTemplate) : null,
        footerTemplate: column.footerTemplate ? __WEBPACK_IMPORTED_MODULE_0__services_template_service__["a" /* default */].compile(column.footerTemplate) : null
    });
};

ExcelExporter.prototype._filter = function _filter () {
    if (!this.options.filterable) {
        return null;
    }

    var depth = this._depth();

    return {
        from: depth,
        to: depth + this.columns.length - 1
    };
};

ExcelExporter.prototype._createPaddingCells = function _createPaddingCells (length) {
        var this$1 = this;

    return createArray(length, function () { return Object.assign({
        background: "#dfdfdf",
        color: "#333"
    }, this$1.options.paddingCellOptions); });
};

ExcelExporter.prototype._dataRow = function _dataRow (dataItem, itemLevel, depth) {
        var this$1 = this;

    var level = itemLevel;
    if (this.hierarchy) {
        level = this.hierarchy.itemLevel(dataItem) + 1;
    }

    var cells = this._createPaddingCells(level);

    // grouped
    if (depth && dataItem.items) {
        var column = this.allColumns.filter(function(column) {
            return column.field === dataItem.field;
        })[0];

        var title = column && column.title ? column.title : dataItem.field;
        var template = column ? column.groupHeaderTemplate : null;
        var group = Object.assign({
            title: title,
            field: dataItem.field,
            value: column && column.values ? column.values[dataItem.value] : dataItem.value,
            aggregates: dataItem.aggregates,
            items: dataItem.items
        }, dataItem.aggregates[dataItem.field]);

        var value = title + ": " + (dataItem.value);

        if (template) {
            value = template(group);
        }

        cells.push(Object.assign({
            value: value,
            background: "#dfdfdf",
            color: "#333",
            colSpan: this.columns.length + depth - level
        }, (column || {}).groupHeaderCellOptions));

        var rows = this._dataRows(dataItem.items, level + 1);

        rows.unshift({
            type: "group-header",
            cells: cells
        });

        return rows.concat(this._footer(dataItem));
    }

    var dataCells = [];

    for (var cellIdx = 0; cellIdx < this.columns.length; cellIdx++) {
        dataCells[cellIdx] = this$1._cell(dataItem, this$1.columns[cellIdx]);
    }

    if (this.hierarchy) {
        dataCells[0].colSpan = depth - level + 1;
    }

    return [ {
        type: "data",
        cells: cells.concat(dataCells)
    } ];
};

ExcelExporter.prototype._dataRows = function _dataRows (dataItems, level) {
        var this$1 = this;

    var depth = this._depth();
    var rows = [];

    for (var idx = 0; idx < dataItems.length; idx++) {
        rows.push.apply(rows, this$1._dataRow(dataItems[idx], level, depth));
    }

    return rows;
};

ExcelExporter.prototype._footer = function _footer (dataItem) {
        var this$1 = this;

    var rows = [];
    var footer = false;

    var cells = this.columns.map(function (column) {
        if (column.groupFooterTemplate) {
            var templateData = Object.assign({}, this$1.aggregates, dataItem.aggregates, dataItem.aggregates[column.field], {
                group: {
                    items: dataItem.items,
                    field: dataItem.field,
                    value: dataItem.value
                }
            });

            // https://github.com/telerik/kendo-ui-core/issues/3024
            // https://github.com/telerik/kendo-ui-core/issues/3095
            templateData[dataItem.field] = templateData;

            footer = true;
            return Object.assign({
                background: "#dfdfdf",
                color: "#333",
                value: column.groupFooterTemplate(templateData)
            }, column.groupFooterCellOptions);
        }

        return Object.assign({
            background: "#dfdfdf",
            color: "#333"
        }, column.groupFooterCellOptions);
    });

    if (footer) {
        rows.push({
            type: "group-footer",
            cells: this._createPaddingCells(this.groups.length).concat(cells)
        });
    }

    return rows;
};

ExcelExporter.prototype._isColumnVisible = function _isColumnVisible (column) {
    return this._visibleColumns([ column ]).length > 0 && (column.field || column.columns);
};

ExcelExporter.prototype._visibleColumns = function _visibleColumns (columns) {
        var this$1 = this;

    return columns.filter(function (column) {
        var result = !column.hidden;
        if (result && column.columns) {
            result = this$1._visibleColumns(column.columns).length > 0;
        }
        return result;
    });
};

ExcelExporter.prototype._headerRow = function _headerRow (row, groups) {
        var this$1 = this;

    var headers = row.cells.map(function(cell) {
        return Object.assign(cell, {
            colSpan: cell.colSpan > 1 ? cell.colSpan : 1,
            rowSpan: row.rowSpan > 1 && !cell.colSpan ? row.rowSpan : 1
        });
    });

    if (this.hierarchy) {
        headers[0].colSpan = this._depth() + 1;
    }

    return {
        type: "header",
        cells: createArray(groups.length, function () { return Object.assign({
            background: "#7a7a7a",
            color: "#fff"
        }, this$1.options.headerPaddingCellOptions); }).concat(headers)
    };
};

ExcelExporter.prototype._prependHeaderRows = function _prependHeaderRows (rows) {
        var this$1 = this;

    var groups = this.groups;

    var headerRows = [ { rowSpan: 1, cells: [], index: 0 } ];

    this._prepareHeaderRows(headerRows, this.options.columns);

    for (var idx = headerRows.length - 1; idx >= 0; idx--) {
        rows.unshift(this$1._headerRow(headerRows[idx], groups));
    }
};

ExcelExporter.prototype._prepareHeaderRows = function _prepareHeaderRows (rows, columns, parentCell, parentRow) {
        var this$1 = this;

    var row = parentRow || rows[rows.length - 1];
    var childRow = rows[row.index + 1];
    var totalColSpan = 0;

    for (var idx = 0; idx < columns.length; idx++) {
        var column = columns[idx];
        if (this$1._isColumnVisible(column)) {

            var cell = Object.assign({
                background: "#7a7a7a",
                color: "#fff",
                value: column.title || column.field,
                colSpan: 0
            }, column.headerCellOptions);
            row.cells.push(cell);

            if (column.columns && column.columns.length) {
                if (!childRow) {
                    childRow = { rowSpan: 0, cells: [], index: rows.length };
                    rows.push(childRow);
                }
                cell.colSpan = this$1._trimColumns(this$1._visibleColumns(column.columns)).length;
                this$1._prepareHeaderRows(rows, column.columns, cell, childRow);
                totalColSpan += cell.colSpan - 1;
                row.rowSpan = rows.length - row.index;
            }
        }
    }

    if (parentCell) {
        parentCell.colSpan += totalColSpan;
    }
};

ExcelExporter.prototype._rows = function _rows () {
        var this$1 = this;

    var rows = this._dataRows(this.data, 0);

    if (this.columns.length) {
        this._prependHeaderRows(rows);
        var footer = false;

        var cells = this.columns.map(function (column) {
            if (column.footerTemplate) {
                footer = true;

                return Object.assign({
                    background: "#dfdfdf",
                    color: "#333",
                    value: column.footerTemplate(Object.assign({}, this$1.aggregates, this$1.aggregates[column.field]))
                }, column.footerCellOptions);
            }

            return Object.assign({
                background: "#dfdfdf",
                color: "#333"
            }, column.footerCellOptions);
        });

        if (footer) {
            rows.push({
                type: "footer",
                cells: this._createPaddingCells(this.groups.length).concat(cells)
            });
        }
    }

    return rows;
};

ExcelExporter.prototype._headerDepth = function _headerDepth (columns) {
        var this$1 = this;

    var result = 1;
    var max = 0;

    for (var idx = 0; idx < columns.length; idx++) {
        if (columns[idx].columns) {
            var temp = this$1._headerDepth(columns[idx].columns);
            if (temp > max) {
                max = temp;
            }
        }
    }
    return result + max;
};

ExcelExporter.prototype._freezePane = function _freezePane () {
    var columns = this._visibleColumns(this.options.columns || []);

    var colSplit = this._visibleColumns(this._trimColumns(this._leafColumns(columns.filter(function(column) {
        return column.locked;
    })))).length;

    return {
        rowSplit: this._headerDepth(columns),
        colSplit: colSplit ? colSplit + this.groups.length : 0
    };
};

ExcelExporter.prototype._cell = function _cell (dataItem, column) {
    return Object.assign({
        value: column.value(dataItem)
    }, column.cellOptions);
};

ExcelExporter.prototype._depth = function _depth () {
    var depth = 0;

    if (this.hierarchy) {
        depth = this.hierarchy.depth;
    } else {
        depth = this.groups.length;
    }

    return depth;
};

ExcelExporter.prototype._columns = function _columns () {
    var depth = this._depth();
    var columns = createArray(depth, function () { return ({ width: 20 }); });

    return columns.concat(this.columns.map(function(column) {
        return {
            width: parseInt(column.width, 10),
            autoWidth: column.width ? false : true
        };
    }));
};

/* harmony default export */ __webpack_exports__["a"] = (ExcelExporter);

//# sourceMappingURL=excel-exporter.js.map


/***/ }),
/* 744 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Workbook; });
/* unused harmony export Worksheet */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_map__ = __webpack_require__(461);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_create_zip__ = __webpack_require__(746);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_intl_service__ = __webpack_require__(459);




var DATA_URL_PREFIX = "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,";
var DATA_URL_OPTIONS = { compression: "DEFLATE", type: "base64" };
var MS_PER_MINUTE = 60000;
var MS_PER_DAY = 86400000;

/* eslint-disable key-spacing, no-arrow-condition, indent, no-nested-ternary, consistent-return */

function toDataURL(content) {
    return DATA_URL_PREFIX + content;
}

function indexOf(thing, array) {
    return array.indexOf(thing);
}

var parseJSON = JSON.parse.bind(JSON);

function ESC(val) {
    return String(val)
        .replace(/&/g, "&amp;")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;")
        .replace(/\"/g, "&quot;")
        .replace(/\'/g, "&#39;");
}

function repeat(count, func) {
    var str = "";
    for (var i = 0; i < count; ++i) {
        str += func(i);
    }
    return str;
}

function foreach(arr, func) {
    var str = "";
    for (var i = 0; i < arr.length; ++i) {
        str += func(arr[i], i);
    }
    return str;
}

var XMLHEAD = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r';

var RELS = XMLHEAD + "\n            <Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n               <Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\n               <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>\n               <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>\n            </Relationships>";

var CORE = function (ref) {
  var creator = ref.creator;
  var lastModifiedBy = ref.lastModifiedBy;
  var created = ref.created;
  var modified = ref.modified;

  return (XMLHEAD + "\n <cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\"\n   xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\"\n   xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n   <dc:creator>" + (ESC(creator)) + "</dc:creator>\n   <cp:lastModifiedBy>" + (ESC(lastModifiedBy)) + "</cp:lastModifiedBy>\n   <dcterms:created xsi:type=\"dcterms:W3CDTF\">" + (ESC(created)) + "</dcterms:created>\n   <dcterms:modified xsi:type=\"dcterms:W3CDTF\">" + (ESC(modified)) + "</dcterms:modified>\n</cp:coreProperties>");
};

var APP = function (ref) {
  var sheets = ref.sheets;

  return (XMLHEAD + "\n<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\n  <Application>Microsoft Excel</Application>\n  <DocSecurity>0</DocSecurity>\n  <ScaleCrop>false</ScaleCrop>\n  <HeadingPairs>\n    <vt:vector size=\"2\" baseType=\"variant\">\n      <vt:variant>\n        <vt:lpstr>Worksheets</vt:lpstr>\n      </vt:variant>\n      <vt:variant>\n        <vt:i4>" + (sheets.length) + "</vt:i4>\n      </vt:variant>\n    </vt:vector>\n  </HeadingPairs>\n  <TitlesOfParts>\n    <vt:vector size=\"" + (sheets.length) + "\" baseType=\"lpstr\">" + (foreach(sheets, function (sheet, i) { return sheet.options.title
          ? ("<vt:lpstr>" + (ESC(sheet.options.title)) + "</vt:lpstr>")
          : ("<vt:lpstr>Sheet" + (i + 1) + "</vt:lpstr>"); }
      )) + "</vt:vector>\n  </TitlesOfParts>\n  <LinksUpToDate>false</LinksUpToDate>\n  <SharedDoc>false</SharedDoc>\n  <HyperlinksChanged>false</HyperlinksChanged>\n  <AppVersion>14.0300</AppVersion>\n</Properties>");
};

var CONTENT_TYPES = function (ref) {
  var count = ref.count;

  return (XMLHEAD + "\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n  <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" />\n  <Default Extension=\"xml\" ContentType=\"application/xml\" />\n  <Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\" />\n  <Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/>\n  <Override PartName=\"/xl/sharedStrings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\"/>\n  " + (repeat(count, function (idx) { return ("<Override PartName=\"/xl/worksheets/sheet" + (idx + 1) + ".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\" />"); })) + "\n  <Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\n  <Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" />\n</Types>");
};

var WORKBOOK = function (ref) {
  var sheets = ref.sheets;
  var filterNames = ref.filterNames;
  var userNames = ref.userNames;

  return (XMLHEAD + "\n<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">\n  <fileVersion appName=\"xl\" lastEdited=\"5\" lowestEdited=\"5\" rupBuild=\"9303\" />\n  <workbookPr defaultThemeVersion=\"124226\" />\n  <bookViews>\n    <workbookView xWindow=\"240\" yWindow=\"45\" windowWidth=\"18195\" windowHeight=\"7995\" />\n  </bookViews>\n  <sheets>\n  " + (foreach(sheets, function (ref, i) {
    var options = ref.options;

    var name = options.name || options.title || ("Sheet" + (i + 1));
    return ("<sheet name=\"" + (ESC(name)) + "\" sheetId=\"" + (i + 1) + "\" r:id=\"rId" + (i + 1) + "\" />");
  })) + "\n  </sheets>\n  " + (filterNames.length || userNames.length ? ("\n    <definedNames>\n      " + (foreach(filterNames, function (f) { return ("\n          <definedName name=\"_xlnm._FilterDatabase\" hidden=\"1\" localSheetId=\"" + (f.localSheetId) + "\">" + (ESC(f.name)) + "!$" + (ESC(f.from)) + ":$" + (ESC(f.to)) + "</definedName>"); })) + "\n      " + (foreach(userNames, function (f) { return ("\n         <definedName name=\"" + (f.name) + "\" hidden=\"" + (f.hidden ? 1 : 0) + "\"" + (f.localSheetId != null ? ("localSheetId=\"" + (f.localSheetId) + "\"") : '') + "</definedName>"); })) + "\n    </definedNames>") : '') + "\n  <calcPr fullCalcOnLoad=\"1\" calcId=\"145621\" />\n</workbook>");
};

var WORKSHEET = function (ref) {
  var frozenColumns = ref.frozenColumns;
  var frozenRows = ref.frozenRows;
  var columns = ref.columns;
  var defaults = ref.defaults;
  var data = ref.data;
  var index = ref.index;
  var mergeCells = ref.mergeCells;
  var autoFilter = ref.autoFilter;
  var filter = ref.filter;
  var showGridLines = ref.showGridLines;
  var hyperlinks = ref.hyperlinks;
  var validations = ref.validations;
  var defaultCellStyleId = ref.defaultCellStyleId;
  var rtl = ref.rtl;

  return (XMLHEAD + "\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\">\n   <dimension ref=\"A1\" />\n\n   <sheetViews>\n     <sheetView " + (rtl ? 'rightToLeft="1"' : '') + " " + (index === 0 ? 'tabSelected="1"' : '') + " workbookViewId=\"0\" " + (showGridLines === false ? 'showGridLines="0"' : '') + ">\n     " + (frozenRows || frozenColumns ? ("\n       <pane state=\"frozen\"\n         " + (frozenColumns ? ("xSplit=\"" + frozenColumns + "\"") : '') + "\n         " + (frozenRows ? ("ySplit=\"" + frozenRows + "\"") : '') + "\n         topLeftCell=\"" + (String.fromCharCode(65 + (frozenColumns || 0)) + ((frozenRows || 0) + 1)) + "\"\n       />") : '') + "\n     </sheetView>\n   </sheetViews>\n\n   <sheetFormatPr x14ac:dyDescent=\"0.25\" defaultRowHeight=\"" + (defaults.rowHeight ? defaults.rowHeight * 0.75 : 15) + "\"\n     " + (defaults.columnWidth ? ("defaultColWidth=\"" + (toWidth(defaults.columnWidth)) + "\"") : '') + " />\n\n   " + (defaultCellStyleId != null || (columns && columns.length > 0) ? ("\n     <cols>\n       " + (!columns || !columns.length ? ("\n         <col min=\"1\" max=\"16384\" style=\"" + defaultCellStyleId + "\"\n              " + (defaults.columnWidth ? ("width=\"" + (toWidth(defaults.columnWidth)) + "\"") : '') + " /> ") : '') + "\n       " + (foreach(columns, function (column, ci) {
         var columnIndex = typeof column.index === "number" ? column.index + 1 : (ci + 1);
         if (column.width === 0) {
           return ("<col " + (defaultCellStyleId != null ? ("style=\"" + defaultCellStyleId + "\"") : '') + "\n                        min=\"" + columnIndex + "\" max=\"" + columnIndex + "\" hidden=\"1\" customWidth=\"1\" />");
         }
         return ("<col " + (defaultCellStyleId != null ? ("style=\"" + defaultCellStyleId + "\"") : '') + "\n                      min=\"" + columnIndex + "\" max=\"" + columnIndex + "\" customWidth=\"1\"\n                      " + (column.autoWidth
                          ? ("width=\"" + (((column.width * 7 + 5) / 7 * 256) / 256) + "\" bestFit=\"1\"")
                          : ("width=\"" + (toWidth(column.width)) + "\"")) + " />");
       })) + "\n     </cols>") : '') + "\n\n   <sheetData>\n     " + (foreach(data, function (row, ri) {
       var rowIndex = typeof row.index === "number" ? row.index + 1 : (ri + 1);
       return ("\n         <row r=\"" + rowIndex + "\" x14ac:dyDescent=\"0.25\"\n              " + (row.height === 0 ? 'hidden="1"'
                                 : row.height ? ("ht=\"" + (toHeight(row.height)) + "\" customHeight=\"1\"") : "") + ">\n           " + (foreach(row.data, function (cell) { return ("\n             <c r=\"" + (cell.ref) + "\" " + (cell.style ? ("s=\"" + (cell.style) + "\"") : '') + " " + (cell.type ? ("t=\"" + (cell.type) + "\"") : '') + ">\n               " + (cell.formula != null ? ("<f>" + (ESC(cell.formula)) + "</f>") : '') + "\n               " + (cell.value != null ? ("<v>" + (ESC(cell.value)) + "</v>") : '') + "\n             </c>"); })) + "\n         </row>\n       ");})) + "\n   </sheetData>\n\n   " + (autoFilter ? ("<autoFilter ref=\"" + (autoFilter.from) + ":" + (autoFilter.to) + "\"/>")
                : filter ? spreadsheetFilters(filter) : '') + "\n\n   " + (mergeCells.length ? ("\n     <mergeCells count=\"" + (mergeCells.length) + "\">\n       " + (foreach(mergeCells, function (ref) { return ("<mergeCell ref=\"" + ref + "\"/>"); })) + "\n     </mergeCells>") : '') + "\n\n   " + (validations.length ? ("\n     <dataValidations>\n       " + (foreach(validations, function (val) { return ("\n         <dataValidation sqref=\"" + (val.sqref.join(" ")) + "\"\n                         showErrorMessage=\"" + (val.showErrorMessage) + "\"\n                         type=\"" + (ESC(val.type)) + "\"\n                         " + (val.type !== "list" ? ("operator=\"" + (ESC(val.operator)) + "\"") : '') + "\n                         allowBlank=\"" + (val.allowBlank) + "\"\n                         showDropDown=\"" + (val.showDropDown) + "\"\n                         " + (val.error ? ("error=\"" + (ESC(val.error)) + "\"") : '') + "\n                         " + (val.errorTitle ? ("errorTitle=\"" + (ESC(val.errorTitle)) + "\"") : '') + ">\n           " + (val.formula1 ? ("<formula1>" + (ESC(val.formula1)) + "</formula1>") : '') + "\n           " + (val.formula2 ? ("<formula2>" + (ESC(val.formula2)) + "</formula2>") : '') + "\n         </dataValidation>"); })) + "\n     </dataValidations>") : '') + "\n\n   " + (hyperlinks.length ? ("\n     <hyperlinks>\n       " + (foreach(hyperlinks, function (link, hi) { return ("\n         <hyperlink ref=\"" + (link.ref) + "\" r:id=\"rId" + hi + "\"/>"); })) + "\n     </hyperlinks>") : '') + "\n\n   <pageMargins left=\"0.7\" right=\"0.7\" top=\"0.75\" bottom=\"0.75\" header=\"0.3\" footer=\"0.3\" />\n</worksheet>");
};

var WORKBOOK_RELS = function (ref) {
  var count = ref.count;

  return (XMLHEAD + "\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n  " + (repeat(count, function (idx) { return ("\n    <Relationship Id=\"rId" + (idx + 1) + "\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet" + (idx + 1) + ".xml\" />"); })) + "\n  <Relationship Id=\"rId" + (count + 1) + "\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\" />\n  <Relationship Id=\"rId" + (count + 2) + "\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\" />\n</Relationships>");
};

var WORKSHEET_RELS = function (ref) {
  var hyperlinks = ref.hyperlinks;

  return (XMLHEAD + "\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n  " + (foreach(hyperlinks, function (link, i) { return ("\n    <Relationship Id=\"rId" + i + "\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Target=\"" + (ESC(link.target)) + "\" TargetMode=\"External\" />"); })) + "\n</Relationships>");
};

var SHARED_STRINGS = function (ref) {
  var count = ref.count;
  var uniqueCount = ref.uniqueCount;
  var indexes = ref.indexes;

  return (XMLHEAD + "\n<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"" + count + "\" uniqueCount=\"" + uniqueCount + "\">\n  " + (foreach(Object.keys(indexes), function (index) { return ("\n    <si><t>" + (ESC(index.substring(1))) + "</t></si>"); })) + "\n</sst>");
};

var STYLES = function (ref) {
  var formats = ref.formats;
  var fonts = ref.fonts;
  var fills = ref.fills;
  var borders = ref.borders;
  var styles = ref.styles;

  return (XMLHEAD + "\n<styleSheet\n    xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    mc:Ignorable=\"x14ac\"\n    xmlns:x14ac=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\">\n  <numFmts count=\"" + (formats.length) + "\">\n  " + (foreach(formats, function (format, fi) { return ("\n    <numFmt formatCode=\"" + (ESC(format.format)) + "\" numFmtId=\"" + (165 + fi) + "\" />"); })) + "\n  </numFmts>\n  <fonts count=\"" + (fonts.length + 1) + "\" x14ac:knownFonts=\"1\">\n    <font>\n       <sz val=\"11\" />\n       <color theme=\"1\" />\n       <name val=\"Calibri\" />\n       <family val=\"2\" />\n       <scheme val=\"minor\" />\n    </font>\n    " + (foreach(fonts, function (font) { return ("\n    <font>\n      <sz val=\"" + (font.fontSize || 11) + "\" />\n      " + (font.bold ? '<b/>' : '') + "\n      " + (font.italic ? '<i/>' : '') + "\n      " + (font.underline ? '<u/>' : '') + "\n      " + (font.color ? ("<color rgb=\"" + (ESC(font.color)) + "\" />") : '<color theme="1" />') + "\n      " + (font.fontFamily ? ("\n        <name val=\"" + (ESC(font.fontFamily)) + "\" />\n        <family val=\"2\" />\n      ") : "\n        <name val=\"Calibri\" />\n        <family val=\"2\" />\n        <scheme val=\"minor\" />\n      ") + "\n    </font>"); })) + "\n  </fonts>\n  <fills count=\"" + (fills.length + 2) + "\">\n      <fill><patternFill patternType=\"none\"/></fill>\n      <fill><patternFill patternType=\"gray125\"/></fill>\n    " + (foreach(fills, function (fill) { return ("\n      " + (fill.background ? ("\n        <fill>\n          <patternFill patternType=\"solid\">\n              <fgColor rgb=\"" + (ESC(fill.background)) + "\"/>\n          </patternFill>\n        </fill>\n      ") : '')); })) + "\n  </fills>\n  <borders count=\"" + (borders.length + 1) + "\">\n    <border><left/><right/><top/><bottom/><diagonal/></border>\n    " + (foreach(borders, borderTemplate)) + "\n  </borders>\n  <cellStyleXfs count=\"1\">\n    <xf borderId=\"0\" fillId=\"0\" fontId=\"0\" />\n  </cellStyleXfs>\n  <cellXfs count=\"" + (styles.length + 1) + "\">\n    <xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\" />\n    " + (foreach(styles, function (style) { return ("\n      <xf xfId=\"0\"\n          " + (style.fontId ? ("fontId=\"" + (style.fontId) + "\" applyFont=\"1\"") : '') + "\n          " + (style.fillId ? ("fillId=\"" + (style.fillId) + "\" applyFill=\"1\"") : '') + "\n          " + (style.numFmtId ? ("numFmtId=\"" + (style.numFmtId) + "\" applyNumberFormat=\"1\"") : '') + "\n          " + (style.textAlign || style.verticalAlign || style.wrap ? 'applyAlignment="1"' : '') + "\n          " + (style.borderId ? ("borderId=\"" + (style.borderId) + "\" applyBorder=\"1\"") : '') + ">\n        " + (style.textAlign || style.verticalAlign || style.wrap ? ("\n        <alignment\n          " + (style.textAlign ? ("horizontal=\"" + (ESC(style.textAlign)) + "\"") : '') + "\n          " + (style.verticalAlign ? ("vertical=\"" + (ESC(style.verticalAlign)) + "\"") : '') + "\n          " + (style.wrap ? 'wrapText="1"' : '') + " />\n        ") : '') + "\n      </xf>\n    "); })) + "\n  </cellXfs>\n  <cellStyles count=\"1\">\n    <cellStyle name=\"Normal\" xfId=\"0\" builtinId=\"0\"/>\n  </cellStyles>\n  <dxfs count=\"0\" />\n  <tableStyles count=\"0\" defaultTableStyle=\"TableStyleMedium2\" defaultPivotStyle=\"PivotStyleMedium9\" />\n</styleSheet>");
};

function numChar(colIndex) {
   var letter = Math.floor(colIndex / 26) - 1;

   return (letter >= 0 ? numChar(letter) : "") + String.fromCharCode(65 + (colIndex % 26));
}

function ref(rowIndex, colIndex) {
    return numChar(colIndex) + (rowIndex + 1);
}

function $ref(rowIndex, colIndex) {
    return numChar(colIndex) + "$" + (rowIndex + 1);
}

function filterRowIndex(options) {
    var frozenRows = options.frozenRows || (options.freezePane || {}).rowSplit || 1;
    return frozenRows - 1;
}

function toWidth(px) {
    return ((px / 7) * 100 + 0.5) / 100;
}

function toHeight(px) {
    return px * 0.75;
}

function stripFunnyChars(value) {
    return String(value)
        .replace(/[\x00-\x08]/g, "")
        .replace(/\n/g, "\r\n");
}

var DATE_EPOCH = new Date(1900, 0, 0);

var Worksheet = function Worksheet(options, sharedStrings, styles, borders) {
      this.options = options;
      this._strings = sharedStrings;
      this._styles = styles;
      this._borders = borders;
      this._validations = {};
  };

  Worksheet.prototype.relsToXML = function relsToXML () {
      var hyperlinks = this.options.hyperlinks || [];
      if (!hyperlinks.length) {
          return "";
      }

      return WORKSHEET_RELS({ hyperlinks: hyperlinks });
  };

  Worksheet.prototype.toXML = function toXML (index) {
        var this$1 = this;

      var mergeCells = this.options.mergedCells || [];
      var rows = this.options.rows || [];
      var data = inflate(rows, mergeCells);

      this._readCells(data);

      var autoFilter = this.options.filter;
      var filter;
      if (autoFilter && (typeof autoFilter.from === "number") && (typeof autoFilter.to === "number")) {
          // Grid enables auto filter
          autoFilter = {
              from: ref(filterRowIndex(this.options), autoFilter.from),
              to: ref(filterRowIndex(this.options), autoFilter.to)
          };
      } else if (autoFilter && autoFilter.ref && autoFilter.columns) {
          // this is probably from the Spreadsheet
          filter = autoFilter;
          autoFilter = null;
      }

      var validations = [];
      for (var i in this._validations) {
          if (Object.prototype.hasOwnProperty.call(this$1._validations, i)) {
              validations.push(this$1._validations[i]);
          }
      }

      var defaultCellStyleId = null;
      if (this.options.defaultCellStyle) {
          defaultCellStyleId = this._lookupStyle(this.options.defaultCellStyle);
      }

      var freezePane = this.options.freezePane || {};
      var defaults = this.options.defaults || {};
      return WORKSHEET({
          frozenColumns: this.options.frozenColumns || freezePane.colSplit,
          frozenRows: this.options.frozenRows || freezePane.rowSplit,
          columns: this.options.columns,
          defaults: defaults,
          data: data,
          index: index,
          mergeCells: mergeCells,
          autoFilter: autoFilter,
          filter: filter,
          showGridLines: this.options.showGridLines,
          hyperlinks: this.options.hyperlinks || [],
          validations: validations,
          defaultCellStyleId: defaultCellStyleId,
          rtl: this.options.rtl !== undefined ? this.options.rtl : defaults.rtl
      });
  };

    Worksheet.prototype._lookupString = function _lookupString (value) {
        var key = "$" + value;
        var index = this._strings.indexes[key];
        var result;

        if (index !== undefined) {
            result = index;
        } else {
            result = this._strings.indexes[key] = this._strings.uniqueCount;
            this._strings.uniqueCount ++;
        }

        this._strings.count ++;

        return result;
    };

    Worksheet.prototype._lookupStyle = function _lookupStyle (style) {
        var json = JSON.stringify(style);

        if (json === "{}") {
            return 0;
        }

        var index = indexOf(json, this._styles);

        if (index < 0) {
          index = this._styles.push(json) - 1;
      }

      // There is one default style
      return index + 1;
  };

  Worksheet.prototype._lookupBorder = function _lookupBorder (border) {
      var json = JSON.stringify(border);
      if (json === "{}") {
          return;
      }

      var index = indexOf(json, this._borders);
      if (index < 0) {
          index = this._borders.push(json) - 1;
      }

      // There is one default border
      return index + 1;
  };

  Worksheet.prototype._readCells = function _readCells (rowData) {
        var this$1 = this;

      for (var i = 0; i < rowData.length; i++) {
          var row = rowData[i];
          var cells = row.cells;

          row.data = [];

          for (var j = 0; j < cells.length; j++) {
              var cellData = this$1._cell(cells[j], row.index, j);
                if (cellData) {
                    row.data.push(cellData);
                }
            }
        }
    };

    Worksheet.prototype._cell = function _cell (data, rowIndex, cellIndex) {
        if (!data || data === EMPTY_CELL) {
            return null;
        }

        var value = data.value;

        var border = {};

      if (data.borderLeft) {
          border.left = data.borderLeft;
      }

      if (data.borderRight) {
          border.right = data.borderRight;
      }

      if (data.borderTop) {
          border.top = data.borderTop;
      }

      if (data.borderBottom) {
          border.bottom = data.borderBottom;
        }

        border = this._lookupBorder(border);

      var defStyle = this.options.defaultCellStyle || {};
        var style = { borderId: border };

        (function(add) {
          add("color");
          add("background");
          add("bold");
            add("italic");
            add("underline");
            if (!add("fontFamily")) { add("fontName", "fontFamily"); }
          add("fontSize");
          add("format");
            if (!add("textAlign")) { add("hAlign", "textAlign"); }
          if (!add("verticalAlign")) { add("vAlign", "verticalAlign"); }
          add("wrap");
        })(
            function(prop, target) {
                var val = data[prop];
                if (val === undefined) {
                    val = defStyle[prop];
                }
                if (val !== undefined) {
                    style[target || prop] = val;
                    return true;
                }
            }
        );

        var columns = this.options.columns || [];

        var column = columns[cellIndex];
      var type = typeof value;

      if (column && column.autoWidth) {
          var displayValue = value;

          // XXX: let's not bring kendo.toString in only for this.
          //    better wait until the spreadsheet engine is available as a separate
          //    component, then we can use a real Excel-like formatter.
          //
          if (type === "number") {
              // kendo.toString will not behave exactly like the Excel format
                // Still, it's the best we have available for estimating the character count.
              displayValue = __WEBPACK_IMPORTED_MODULE_2__services_intl_service__["a" /* default */].toString(value, data.format);
          }

          column.width = Math.max(column.width || 0, String(displayValue).length);
      }

      if (type === "string") {
          value = stripFunnyChars(value);
          value = this._lookupString(value);
          type = "s";
      } else if (type === "number") {
          type = "n";
      } else if (type === "boolean") {
          type = "b";
            value = Number(value);
      } else if (value && value.getTime) {
          type = null;

            var offset = (value.getTimezoneOffset() - DATE_EPOCH.getTimezoneOffset()) * MS_PER_MINUTE;
            value = (value - DATE_EPOCH - offset) / MS_PER_DAY + 1;

            if (!style.format) {
              style.format = "mm-dd-yy";
          }
      } else {
          type = null;
          value = null;
      }

      style = this._lookupStyle(style);

      var cellName = ref(rowIndex, cellIndex);

      if (data.validation) {
          this._addValidation(data.validation, cellName);
        }

        return {
            value: value,
            formula: data.formula,
            type: type,
            style: style,
            ref: cellName
        };
    };

    Worksheet.prototype._addValidation = function _addValidation (v, ref) {
        var tmp = {
            showErrorMessage : v.type === "reject" ? 1 : 0,
            formula1         : v.from,
            formula2         : v.to,
            type             : MAP_EXCEL_TYPE[v.dataType] || v.dataType,
            operator         : MAP_EXCEL_OPERATOR[v.comparerType] || v.comparerType,
            allowBlank       : v.allowNulls ? 1 : 0,
            showDropDown     : v.showButton ? 0 : 1, // LOL, Excel!
          error          : v.messageTemplate,
          errorTitle     : v.titleTemplate
      };
      var json = JSON.stringify(tmp);
      if (!this._validations[json]) {
          this._validations[json] = tmp;
          tmp.sqref = [];
      }
      this._validations[json].sqref.push(ref);
  };

var MAP_EXCEL_OPERATOR = {
    // includes only what differs; key is our operator, value is Excel
    // operator.
    greaterThanOrEqualTo : "greaterThanOrEqual",
    lessThanOrEqualTo    : "lessThanOrEqual"
};

var MAP_EXCEL_TYPE = {
    number: "decimal"
};

var defaultFormats = {
    "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
};

function convertColor(value) {
    var color = value;
    if (color.length < 6) {
        color = color.replace(/(\w)/g, function($0, $1) {
            return $1 + $1;
        });
    }

    color = color.substring(1).toUpperCase();

    if (color.length < 8) {
        color = "FF" + color;
    }

    return color;
}

var Workbook = function Workbook(options) {
      var this$1 = this;

      this.options = options || {};
      this._strings = {
          indexes: {},
          count: 0,
          uniqueCount: 0
      };
      this._styles = [];
      this._borders = [];

      this._sheets = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(this.options.sheets || [], function (options) {
          options.defaults = this$1.options;
          return new Worksheet(options, this$1._strings, this$1._styles, this$1._borders);
      });
  };

  Workbook.prototype.toZIP = function toZIP () {
        var this$1 = this;

      var zip = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_create_zip__["a" /* default */])();

      var docProps = zip.folder("docProps");

      docProps.file("core.xml", CORE({
          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()
      }));

      var sheetCount = this._sheets.length;

      docProps.file("app.xml", APP({ sheets: this._sheets }));

      var rels = zip.folder("_rels");
      rels.file(".rels", RELS);

      var xl = zip.folder("xl");

      var xlRels = xl.folder("_rels");
      xlRels.file("workbook.xml.rels", WORKBOOK_RELS({ count: sheetCount }));

      var sheetIds = {};

      xl.file("workbook.xml", WORKBOOK({
          sheets: this._sheets,
          filterNames: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(this._sheets, function(sheet, index) {
              var options = sheet.options;
              var sheetName = (options.name || options.title || "Sheet" + (index + 1));
              sheetIds[sheetName.toLowerCase()] = index;
              var filter = options.filter;
              if (filter && typeof filter.from !== "undefined" && typeof filter.to !== "undefined") {
                  return {
                      localSheetId: index,
                      name: sheetName,
                      from: $ref(filterRowIndex(options), filter.from),
                      to: $ref(filterRowIndex(options), filter.to)
                  };
              }
          }),
          userNames: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(this.options.names || [], function(def) {
              return {
                  name: def.localName,
                  localSheetId: def.sheet ? sheetIds[def.sheet.toLowerCase()] : null,
                  value: def.value,
                  hidden: def.hidden
              };
          })
      }));

      var worksheets = xl.folder("worksheets");

      var sheetRels = worksheets.folder("_rels");

        for (var idx = 0; idx < sheetCount; idx++) {
            var sheet = this$1._sheets[idx];
            var sheetName = "sheet" + (idx + 1) + ".xml";
            var relsXml = sheet.relsToXML();

            if (relsXml) {
                sheetRels.file(sheetName + ".rels", relsXml);
            }

            worksheets.file(sheetName, sheet.toXML(idx));
        }

        var borders = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(this._borders, parseJSON);

        var styles = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(this._styles, parseJSON);

        var hasFont = function(style) {
            return style.underline || style.bold || style.italic || style.color || style.fontFamily || style.fontSize;
      };

      var fonts = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(styles, function(style) {
          if (style.color) {
              style.color = convertColor(style.color);
          }

          if (hasFont(style)) {
              return style;
          }
      });

      var formats = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(styles, function(style) {
          if (style.format && defaultFormats[style.format] === undefined) {
              return style;
          }
      });

      var fills = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(styles, function(style) {
          if (style.background) {
              style.background = convertColor(style.background);
              return style;
          }
      });

      xl.file("styles.xml", STYLES({
            fonts: fonts,
            fills: fills,
            formats: formats,
            borders: borders,
            styles: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_map__["a" /* default */])(styles, function(style) {
                var result = {};

                if (hasFont(style)) {
                    result.fontId = indexOf(style, fonts) + 1;
              }

              if (style.background) {
                  result.fillId = indexOf(style, fills) + 2;
              }

              result.textAlign = style.textAlign;
              result.verticalAlign = style.verticalAlign;
              result.wrap = style.wrap;
              result.borderId = style.borderId;

                if (style.format) {
                  if (defaultFormats[style.format] !== undefined) {
                        result.numFmtId = defaultFormats[style.format];
                  } else {
                      result.numFmtId = 165 + indexOf(style, formats);
                    }
                }

                return result;
          })
      }));

      xl.file("sharedStrings.xml", SHARED_STRINGS(this._strings));

        zip.file("[Content_Types].xml", CONTENT_TYPES( { count: sheetCount }));

      return zip;
  };

  Workbook.prototype.toDataURL = function toDataURL$1 () {
      var zip = this.toZIP();

        return zip.generateAsync ? zip.generateAsync(DATA_URL_OPTIONS).then(toDataURL) : toDataURL(zip.generate(DATA_URL_OPTIONS));
    };

function borderStyle(width) {
    var alias = "thin";

    if (width === 2) {
        alias = "medium";
    } else if (width === 3) {
        alias = "thick";
    }

    return alias;
}

function borderSideTemplate(name, style) {
    var result = "";

    if (style) {
        result += "<" + name + " style=\"" + borderStyle(style.size) + "\">";
        if (style.color) {
            result += "<color rgb=\"" + convertColor(style.color) + "\"/>";
        }
        result += "</" + name + ">";
    }

    return result;
}

function borderTemplate(border) {
    return "<border>" +
       borderSideTemplate("left", border.left) +
       borderSideTemplate("right", border.right) +
       borderSideTemplate("top", border.top) +
       borderSideTemplate("bottom", border.bottom) +
   "</border>";
}

var EMPTY_CELL = {};
function inflate(rows, mergedCells) {
    var rowData = [];
    var rowsByIndex = [];

    indexRows(rows, function(row, index) {
        var data = {
            _source: row,
            index: index,
            height: row.height,
            cells: []
        };

        rowData.push(data);
        rowsByIndex[index] = data;
    });

    var sorted = sortByIndex(rowData).slice(0);
    var ctx = {
        rowData: rowData,
        rowsByIndex: rowsByIndex,
        mergedCells: mergedCells
    };

    for (var i = 0; i < sorted.length; i++) {
        fillCells(sorted[i], ctx);
        delete sorted[i]._source;
    }

    return sortByIndex(rowData);
}

function indexRows(rows, callback) {
    for (var i = 0; i < rows.length; i++) {
        var row = rows[i];
        if (!row) {
            continue;
        }

        var index = row.index;
        if (typeof index !== "number") {
            index = i;
        }

        callback(row, index);
    }
}

function sortByIndex(items) {
    return items.sort(function(a, b) {
        return a.index - b.index;
    });
}

function pushUnique(array, el) {
    if (array.indexOf(el) < 0) {
        array.push(el);
    }
}

function getSpan(mergedCells, ref) {
    for (var i = 0; i < mergedCells.length; ++i) {
        var range = mergedCells[i];
        var a = range.split(":");
        var topLeft = a[0];
        if (topLeft === ref) {
            var bottomRight = a[1];
            topLeft = parseRef(topLeft);
            bottomRight = parseRef(bottomRight);
            return {
                rowSpan: bottomRight.row - topLeft.row + 1,
                colSpan: bottomRight.col - topLeft.col + 1
            };
        }
    }
}

function parseRef(ref) {
    function getcol(str) {
        var upperStr = str.toUpperCase();
        var col = 0;
        for (var i = 0; i < upperStr.length; ++i) {
            col = col * 26 + upperStr.charCodeAt(i) - 64;
        }
        return col - 1;
    }

    function getrow(str) {
        return parseInt(str, 10) - 1;
    }

    var m = /^([a-z]+)(\d+)$/i.exec(ref);
    return {
        row: getrow(m[2]),
        col: getcol(m[1])
    };
}

function fillCells(data, ctx) {
    var row = data._source;
    var rowIndex = data.index;
    var cells = row.cells;
    var cellData = data.cells;

    if (!cells) {
        return;
    }

    for (var i = 0; i < cells.length; i++) {
        var cell = cells[i] || EMPTY_CELL;

        var rowSpan = cell.rowSpan || 1;
        var colSpan = cell.colSpan || 1;

        var cellIndex = insertCell(cellData, cell);
        var topLeftRef = ref(rowIndex, cellIndex);

        if (rowSpan === 1 && colSpan === 1) {
            // could still be merged: the spreadsheet does not send
            // rowSpan/colSpan, but mergedCells is already populated.
            // https://github.com/telerik/kendo-ui-core/issues/2401
            var tmp = getSpan(ctx.mergedCells, topLeftRef);
            if (tmp) {
                colSpan = tmp.colSpan;
                rowSpan = tmp.rowSpan;
            }
        }

        spanCell(cell, cellData, cellIndex, colSpan);

        if (rowSpan > 1 || colSpan > 1) {
            pushUnique(ctx.mergedCells,
                       topLeftRef + ":" + ref(rowIndex + rowSpan - 1,
                                              cellIndex + colSpan - 1));
        }

        if (rowSpan > 1) {
            for (var ri = rowIndex + 1; ri < rowIndex + rowSpan; ri++) {
                var nextRow = ctx.rowsByIndex[ri];
                if (!nextRow) {
                    nextRow = ctx.rowsByIndex[ri] = { index: ri, cells: [] };
                    ctx.rowData.push(nextRow);
                }

                spanCell(cell, nextRow.cells, cellIndex - 1, colSpan + 1);
            }
        }
    }
}

function insertCell(data, cell) {
    var index;

    if (typeof cell.index === "number") {
        index = cell.index;
        insertCellAt(data, cell, cell.index);
    } else {
        index = appendCell(data, cell);
    }

    return index;
}

function insertCellAt(data, cell, index) {
    data[index] = cell;
}

function appendCell(data, cell) {
    var index = data.length;

    for (var i = 0; i < data.length + 1; i++) {
        if (!data[i]) {
            data[i] = cell;
            index = i;
            break;
        }
    }

    return index;
}

function spanCell(cell, row, startIndex, colSpan) {
    for (var i = 1; i < colSpan; i++) {
        var tmp = {
            borderTop    : cell.borderTop,
            borderRight  : cell.borderRight,
            borderBottom : cell.borderBottom,
            borderLeft   : cell.borderLeft
        };
        insertCellAt(row, tmp, startIndex + i);
    }
}

var SPREADSHEET_FILTERS = function (ref$1) {
  var ref = ref$1.ref;
  var columns = ref$1.columns;
  var generators = ref$1.generators;

  return ("\n<autoFilter ref=\"" + ref + "\">\n  " + (foreach(columns, function (col) { return ("\n    <filterColumn colId=\"" + (col.index) + "\">\n      " + (generators[col.filter](col)) + "\n    </filterColumn>\n  "); })) + "\n</autoFilter>");
};

var SPREADSHEET_CUSTOM_FILTER = function (ref) {
  var logic = ref.logic;
  var criteria = ref.criteria;

  return ("\n<customFilters " + (logic === 'and' ? 'and="1"' : '') + ">\n" + (foreach(criteria, function (f) {
    var op = spreadsheetFilters.customOperator(f);
    var val = spreadsheetFilters.customValue(f);
    return ("<customFilter " + (op ? ("operator=\"" + op + "\"") : '') + " val=\"" + val + "\"/>");
})) + "\n</customFilters>");
};

var SPREADSHEET_DYNAMIC_FILTER = function (ref) {
  var type = ref.type;

  return ("<dynamicFilter type=\"" + (spreadsheetFilters.dynamicFilterType(type)) + "\" />");
};

var SPREADSHEET_TOP_FILTER = function (ref) {
  var type = ref.type;
  var value = ref.value;

  return ("<top10 percent=\"" + (/percent$/i.test(type) ? 1 : 0) + "\"\n       top=\"" + (/^top/i.test(type) ? 1 : 0) + "\"\n       val=\"" + value + "\" />");
};

var SPREADSHEET_VALUE_FILTER = function (ref) {
    var blanks = ref.blanks;
    var values = ref.values;

    return ("<filters " + (blanks ? 'blank="1"' : '') + ">\n    " + (foreach(values, function (value) { return ("\n      <filter val=\"" + value + "\" />"); })) + "\n  </filters>");
};

function spreadsheetFilters(filter) {
    return SPREADSHEET_FILTERS({
        ref: filter.ref,
        columns: filter.columns,
        generators: {
            custom  : SPREADSHEET_CUSTOM_FILTER,
            dynamic : SPREADSHEET_DYNAMIC_FILTER,
            top     : SPREADSHEET_TOP_FILTER,
            value   : SPREADSHEET_VALUE_FILTER
        }
    });
}

spreadsheetFilters.customOperator = function(f) {
    return {
        eq  : "equal",
        gt  : "greaterThan",
        gte : "greaterThanOrEqual",
        lt  : "lessThan",
        lte : "lessThanOrEqual",
        ne  : "notEqual",

        // These are not in the spec, but seems to be how Excel does
        // it (see customValue below).  For the non-negated versions,
        // the operator attribute is missing completely.
        doesnotstartwith: "notEqual",
        doesnotendwith: "notEqual",
        doesnotcontain: "notEqual",
        doesnotmatch: "notEqual"
    }[f.operator.toLowerCase()];
};

spreadsheetFilters.customValue = function(f) {
    function esc(str) {
        return str.replace(/([*?])/g, "~$1");
    }

    switch (f.operator.toLowerCase()) {
        case "startswith":
        case "doesnotstartwith":
            return esc(f.value) + "*";

        case "endswith":
        case "doesnotendwith":
            return "*" + esc(f.value);

        case "contains":
        case "doesnotcontain":
            return "*" + esc(f.value) + "*";

        default:
            return f.value;
    }
};

spreadsheetFilters.dynamicFilterType = function(type) {
    return {
        quarter1  : "Q1",
        quarter2  : "Q2",
        quarter3  : "Q3",
        quarter4  : "Q4",
        january   : "M1",
        february  : "M2",
        march     : "M3",
        april     : "M4",
        may       : "M5",
        june      : "M6",
        july      : "M7",
        august    : "M8",
        september : "M9",
        october   : "M10",
        november  : "M11",
        december  : "M12"
    }[type.toLowerCase()] || type;
};



//# sourceMappingURL=ooxml.js.map


/***/ }),
/* 745 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__services_intl_service__ = __webpack_require__(459);
/* unused harmony reexport IntlService */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_template_service__ = __webpack_require__(460);
/* unused harmony reexport TemplateService */



//# sourceMappingURL=services.js.map


/***/ }),
/* 746 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = createZip;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jszip_dist_jszip__ = __webpack_require__(805);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jszip_dist_jszip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jszip_dist_jszip__);


function createZip() {
    return new __WEBPACK_IMPORTED_MODULE_0_jszip_dist_jszip___default.a();
}
//# sourceMappingURL=create-zip.js.map


/***/ }),
/* 747 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = getter;
var FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
var getterCache = {};
var UNDEFINED = 'undefined';

getterCache[UNDEFINED] = function(obj) {
    return obj;
};

function getter(field) {
    if (getterCache[field]) {
        return getterCache[field];
    }

    var fields = [];
    field.replace(FIELD_REGEX, function(match, index, indexAccessor, field) {
        fields.push(typeof index !== UNDEFINED ? index : (indexAccessor || field));
    });

    getterCache[field] = function(obj) {
        var result = obj;
        for (var idx = 0; idx < fields.length && result; idx++) {
            result = result[fields[idx]];
        }

        return result;
    };

    return getterCache[field];
}
//# sourceMappingURL=getter.js.map


/***/ }),
/* 748 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = addScroll;
function addScroll(rect, scroll) {
    return {
        top: rect.top + scroll.y,
        left: rect.left + scroll.x,
        height: rect.height,
        width: rect.width
    };
}

//# sourceMappingURL=add-scroll.js.map


/***/ }),
/* 749 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__align_point__ = __webpack_require__(231);


var align = function (options) {
    var anchorRect = options.anchorRect;
    var anchorAlign = options.anchorAlign;
    var elementRect = options.elementRect;
    var elementAlign = options.elementAlign;
    var anchorHorizontal = anchorAlign.horizontal;
    var anchorVertical = anchorAlign.vertical;
    var elementHorizontal = elementAlign.horizontal;
    var elementVertical = elementAlign.vertical;

    var top = anchorRect.top;
    var left = anchorRect.left;

    if (anchorVertical === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].bottom) {
        top += anchorRect.height;
    }

    if (anchorVertical === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].center || anchorVertical === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].middle) {
        top += Math.round(anchorRect.height / 2);
    }

    if (elementVertical === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].bottom) {
        top -= elementRect.height;
    }

    if (elementVertical === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].center || elementVertical === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].middle) {
        top -= Math.round(elementRect.height / 2);
    }

    if (anchorHorizontal === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].right) {
        left += anchorRect.width;
    }

    if (anchorHorizontal === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].center || anchorHorizontal === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].middle) {
        left += Math.round(anchorRect.width / 2);
    }

    if (elementHorizontal === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].right) {
        left -= elementRect.width;
    }

    if (elementHorizontal === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].center || elementHorizontal === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].middle) {
        left -= Math.round(elementRect.width / 2);
    }

    return {
        top: top,
        left: left
    };
};

/* harmony default export */ __webpack_exports__["a"] = (align);

//# sourceMappingURL=align.js.map


/***/ }),
/* 750 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = applyLocationOffset;
function applyLocationOffset(rect, location, isOffsetBody) {
    var top = rect.top;
    var left = rect.left;

    if (isOffsetBody) {
        left = 0;
        top = 0;
    }

    return {
        top: top + location.top,
        left: left + location.left,
        height: rect.height,
        width: rect.width
    };
}

//# sourceMappingURL=apply-location-offset.js.map


/***/ }),
/* 751 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var boundingOffset = function (element) {
    if (!element.getBoundingClientRect) {
        return {
            bottom: element.innerHeight,
            left: 0,
            right: element.innerWidth,
            top: 0
        };
    }

    var ref = element.getBoundingClientRect();
    var bottom = ref.bottom;
    var left = ref.left;
    var right = ref.right;
    var top = ref.top;

    return {
        bottom: bottom,
        left: left,
        right: right,
        top: top
    };
};

/* harmony default export */ __webpack_exports__["a"] = (boundingOffset);

//# sourceMappingURL=bounding-offset.js.map


/***/ }),
/* 752 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__offset_parent__ = __webpack_require__(102);


var isBodyOffset = function (element) { return (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__offset_parent__["a" /* default */])(element) === element.ownerDocument.body); };

/* harmony default export */ __webpack_exports__["a"] = (isBodyOffset);

//# sourceMappingURL=is-body-offset.js.map


/***/ }),
/* 753 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__element_scroll_position__ = __webpack_require__(463);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__parent_scroll_position__ = __webpack_require__(466);



/* harmony default export */ __webpack_exports__["a"] = (function (offsetParentElement, element) { return ( // eslint-disable-line no-arrow-condition
    offsetParentElement ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__element_scroll_position__["a" /* default */])(offsetParentElement) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__parent_scroll_position__["a" /* default */])(element)
); });;

//# sourceMappingURL=offset-parent-scroll-position.js.map


/***/ }),
/* 754 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__offset_parent_scroll_position__ = __webpack_require__(753);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__offset_parent__ = __webpack_require__(102);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__position__ = __webpack_require__(468);




/* harmony default export */ __webpack_exports__["a"] = (function (element, parent) {
    var offsetParentElement = parent ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__offset_parent__["a" /* default */])(parent) : null;
    var ref = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__position__["a" /* default */])(element, offsetParentElement);
    var top = ref.top;
    var left = ref.left;
    var height = ref.height;
    var width = ref.width;
    var ref$1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__offset_parent_scroll_position__["a" /* default */])(offsetParentElement, element);
    var x = ref$1.x;
    var y = ref$1.y;

    return {
        top: top + y,
        left: left + x,
        height: height,
        width: width
    };
});;

//# sourceMappingURL=position-with-scroll.js.map


/***/ }),
/* 755 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = removeScroll;
function removeScroll(rect, scroll) {
    return {
        top: rect.top - scroll.y,
        left: rect.left - scroll.x,
        height: rect.height,
        width: rect.width
    };
}

//# sourceMappingURL=remove-scroll.js.map


/***/ }),
/* 756 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__align_point__ = __webpack_require__(231);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__collision__ = __webpack_require__(462);



var fit = function(position, size, viewPortSize) {
    var output = 0;

    if (position + size > viewPortSize) {
        output = viewPortSize - (position + size);
    }

    if (position < 0) {
        output = -position;
    }

    return output;
};

var flip = function(ref) {
    var offset = ref.offset;
    var size = ref.size;
    var anchorSize = ref.anchorSize;
    var viewPortSize = ref.viewPortSize;
    var anchorAlignPoint = ref.anchorAlignPoint;
    var elementAlignPoint = ref.elementAlignPoint;

    var output = 0;

    var isPositionCentered = elementAlignPoint === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].center || elementAlignPoint === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].middle;
    var isOriginCentered = anchorAlignPoint === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].center || anchorAlignPoint === __WEBPACK_IMPORTED_MODULE_0__align_point__["a" /* default */].middle;

    if (elementAlignPoint !== anchorAlignPoint && !isPositionCentered && !isOriginCentered && offset > -1) {
        if (offset + size > viewPortSize) {
            output += -(anchorSize + size);
        }

        if (offset + output < 0) {
            output += anchorSize + size;
        }
    }
    return output;
};

var restrictToView = function (options) {
    var anchorRect = options.anchorRect;
    var anchorAlign = options.anchorAlign;
    var elementRect = options.elementRect;
    var elementAlign = options.elementAlign;
    var collisions = options.collisions;
    var viewPort = options.viewPort;
    var elementTop = elementRect.top;
    var elementLeft = elementRect.left;
    var elementHeight = elementRect.height;
    var elementWidth = elementRect.width;
    var viewPortHeight = viewPort.height;
    var viewPortWidth = viewPort.width;

    var left = 0;
    var top = 0;

    var isHorizontalFlip = collisions.horizontal === __WEBPACK_IMPORTED_MODULE_1__collision__["a" /* default */].flip;
    var isVerticalFlip = collisions.vertical === __WEBPACK_IMPORTED_MODULE_1__collision__["a" /* default */].flip;

    if (collisions.vertical === __WEBPACK_IMPORTED_MODULE_1__collision__["a" /* default */].fit) {
        top += fit(elementTop, elementHeight, viewPortHeight);
    }

    if (collisions.horizontal === __WEBPACK_IMPORTED_MODULE_1__collision__["a" /* default */].fit) {
        left += fit(elementLeft, elementWidth, viewPortWidth);
    }

    if (isVerticalFlip) {
        top += flip({
            offset: elementTop,
            size: elementHeight,
            anchorSize: anchorRect.height,
            viewPortSize: viewPortHeight,
            anchorAlignPoint: anchorAlign.vertical,
            elementAlignPoint: elementAlign.vertical
        });
    }

    if (isHorizontalFlip) {
        left += flip({
            offset: elementLeft,
            size: elementWidth,
            anchorSize: anchorRect.width,
            viewPortSize: viewPortWidth,
            anchorAlignPoint: anchorAlign.horizontal,
            elementAlignPoint: elementAlign.horizontal
        });
    }

    return {
        flipped: (isHorizontalFlip && left !== 0) || (isVerticalFlip && top !== 0),
        offset: {
            left: left,
            top: top
        }
    };
};

/* harmony default export */ __webpack_exports__["a"] = (restrictToView);

//# sourceMappingURL=restrict-to-view.js.map


/***/ }),
/* 757 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__parents__ = __webpack_require__(467);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__siblings__ = __webpack_require__(470);
/* eslint-disable no-loop-func */




/* harmony default export */ __webpack_exports__["a"] = (function (anchor, container) {
    var parentElements = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__parents__["a" /* default */])(anchor);
    var containerElement = container;
    var siblingElements;
    var result;

    while (containerElement) {
        siblingElements = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__siblings__["a" /* default */])(containerElement);

        result = parentElements.reduce(
            function (list, p) { return list.concat(siblingElements.filter(function (s) { return s === p; })); },
            []
        )[0];

        if (result) { break; }

        containerElement = containerElement.parentElement;
    }

    return result;
});;


//# sourceMappingURL=sibling-container.js.map


/***/ }),
/* 758 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = windowViewport;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__window__ = __webpack_require__(143);


function windowViewport(element) {
    var win = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__window__["a" /* default */])(element);

    return {
        height: win.innerHeight,
        width: win.innerWidth
    };
}

//# sourceMappingURL=window-viewport.js.map


/***/ }),
/* 759 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__SliderUtil__ = __webpack_require__(472);


var SliderModel = function SliderModel(props, wrapper, track) {
    this.props = props;
    this.wrapper = wrapper;
    this.track = track;
    this.tickSizes = this.getTickSizes();
};

SliderModel.prototype.getTickSizes = function getTickSizes () {
    var ref = this.props;
        var max = ref.max;
        var min = ref.min;
        var smallStep = ref.smallStep;
    var trackWidth = this.trackWidth();

    return __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].calculateTickSizes(trackWidth, min, max, smallStep);
};

SliderModel.prototype.trackWidth = function trackWidth () {
    if (this.props.fixedTickWidth) {
        return __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].calculateFixedTrackSize(this.props);
    }

    return __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].calculateTrackSize(
        this.elementSize(this.wrapper),
        this.elementOffset(this.track),
        this.props.buttons
    );
};

SliderModel.prototype.resizeTrack = function resizeTrack () {
    var orientation = this.props.vertical ? 'height' : 'width';
    var trackWidth = this.trackWidth();

    this.track.style[orientation] = trackWidth + "px";
};

SliderModel.prototype.resizeTicks = function resizeTicks (ticksContainer, ticks) {
        var this$1 = this;

    var dimension = this.props.vertical ? "height" : "width";

    Array.prototype.slice.call(ticks).map(function (tick, index) { return tick.style[dimension] = (this$1.tickSizes[index]) + "px"; });

    if (this.props.vertical) {
        this.adjustPadding(ticksContainer);
    }
};

SliderModel.prototype.resizeWrapper = function resizeWrapper () {
    var dimension = this.props.vertical ? "height" : "width";
    var wrapperSize = this.elementSize(this.wrapper);
    var trackWidth = __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].calculateTrackSize(wrapperSize, this.elementOffset(this.track));
    var fixedTrackWidth = __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].calculateFixedTrackSize(this.props);

    if (trackWidth > fixedTrackWidth) {
        this.wrapper.parentElement.style[dimension] = (wrapperSize - (trackWidth - fixedTrackWidth)) + "px";
    } else {
        this.wrapper.parentElement.style[dimension] = (wrapperSize + (fixedTrackWidth - trackWidth)) + "px";
    }
};

SliderModel.prototype.positionHandle = function positionHandle (dragHandle) {
    var ref = this.props;
        var max = ref.max;
        var min = ref.min;
        var reverse = ref.reverse;
        var vertical = ref.vertical;
    var position = vertical ? 'bottom' : 'left';
    var trackWidth = this.trackWidth();
    var value = __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].trimValue(max, min, this.props.value);

    this.handlePosition = __WEBPACK_IMPORTED_MODULE_0__SliderUtil__["a" /* default */].calculateHandlePosition({
        min: min,
        max: max,
        reverse: reverse,
        value: value,
        trackWidth: trackWidth,
        handleWidth: dragHandle.offsetWidth
    });

    dragHandle.style[position] = (this.handlePosition) + "px";
};

SliderModel.prototype.positionSelection = function positionSelection (dragHandle, selection) {
    var ref = this.props;
        var reverse = ref.reverse;
        var vertical = ref.vertical;
    var dimension = vertical ? 'height' : 'width';
    var handleWidth = Math.floor(dragHandle.offsetWidth / 2);
    var size = this.handlePosition + handleWidth;

    if (reverse) {
        size = this.trackWidth() - size;
    }

    selection.style[dimension] = size + "px";
};

SliderModel.prototype.adjustPadding = function adjustPadding (ticksContainer) {
    var totalTickSize = this.tickSizes.reduce(function (prev, curr) { return prev + curr; }, 0);
    var trackWidth = this.trackWidth();
    var reminder = trackWidth - totalTickSize;

    if (reminder !== 0) {
        var padding = reminder + this.elementOffset(this.track);
        ticksContainer.style.paddingTop = padding + "px";
    }
};

SliderModel.prototype.elementOffset = function elementOffset (element) {
    var ref = this.props;
        var vertical = ref.vertical;
    var style = getComputedStyle(element);

    return parseInt(vertical ? style.bottom : style.left, 10);
};

SliderModel.prototype.elementSize = function elementSize (element) {
    var ref = this.props;
        var vertical = ref.vertical;

    return vertical ? element.clientHeight : element.clientWidth;
};

/* harmony default export */ __webpack_exports__["a"] = (SliderModel);

//# sourceMappingURL=SliderModel.js.map


/***/ }),
/* 760 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__SwitchModel__ = __webpack_require__(761);


var DEFAULT_THRESHOLD = 5;

var noop = function () { /*noop*/ };

var SwitchController = function SwitchController(updateView, onChange) {
    var this$1 = this;
    if ( updateView === void 0 ) updateView = noop;
    if ( onChange === void 0 ) onChange = noop;

    this.handlePosition = 0;
    this.wrapperOffset = 0;
    this.handleOffset = 0;
    this.handleMargin = 4;

    this.updateView = updateView;
    this.onChange = onChange;

    this.change = function (checked) {
        this$1.checked = checked;

        this$1.updateView(this$1.updateModel(checked ? this$1.constrain : 0));

        this$1.onChange(checked);
    };

    this.limit = function (value) {
        if (value > this$1.constrain) {
            return this$1.constrain;
        }

        if (value < 0) {
            return 0;
        }

        return value;
    };

    this.addAnimation = function (model) {
        if (model.transition === true) {
            model.transition = 'all 200ms ease-out';
        } else {
            model.transition = 'none';
        }
        return model;
    };

    this.onPress = function (ref) {
        var pageX = ref.pageX;

        this$1.lastPressX = this$1.originalPressX = pageX;
    };

    this.onRelease = function (ref) {
        var pageX = ref.pageX;

        var delta = Math.abs(this$1.originalPressX - pageX);
        var snapPoint = this$1.constrain / 2;
        var checked = delta < DEFAULT_THRESHOLD ? !this$1.checked : this$1.handlePosition > snapPoint;

        this$1.change(checked);
    };

    this.onDrag = function (ref) {
        var pageX = ref.pageX;

        var ref$1 = this$1.coords;
        var left = ref$1.left;
        var right = ref$1.right;
        var overElement = pageX > left && pageX < right;

        if (overElement) {
            var delta = this$1.reverse ? this$1.lastPressX - pageX : pageX - this$1.lastPressX;
            var position = this$1.limit(this$1.handlePosition + delta);

            this$1.lastPressX = pageX;
            this$1.handlePosition = position;
            this$1.updateView(this$1.updateModel(this$1.handlePosition));
        }
        if (pageX > right) {
            this$1.updateView(this$1.updateModel(this$1.reverse ? 0 : this$1.constrain));
        }

        if (pageX < left) {
            this$1.updateView(this$1.updateModel(this$1.reverse ? 0 : this$1.constrain));
        }
    };
};

var prototypeAccessors = { constrain: {} };

prototypeAccessors.constrain.get = function () {
    return this.wrapperOffset - this.handleOffset - this.handleMargin;
};

SwitchController.prototype.updateState = function updateState (ref) {
        var wrapperOffset = ref.wrapperOffset;
        var handleOffset = ref.handleOffset;
        var checked = ref.checked;
        var animate = ref.animate; if ( animate === void 0 ) animate = true;
        var coords = ref.coords;
        var handleMargin = ref.handleMargin;
        var reverse = ref.reverse;

    this.wrapperOffset = wrapperOffset;
    this.handleOffset = handleOffset;
    this.coords = coords;
    this.handleMargin = handleMargin;

    this.checked = checked;
    this.reverse = reverse;

    this.updateView(this.updateModel(checked ? this.constrain : 0, animate));
};

SwitchController.prototype.updateModel = function updateModel (position, animate) {
        if ( animate === void 0 ) animate = true;

    var pos = this.reverse ? this.wrapperOffset / 2 - position : position;
    return new __WEBPACK_IMPORTED_MODULE_0__SwitchModel__["a" /* default */](pos, animate);
};

Object.defineProperties( SwitchController.prototype, prototypeAccessors );

/* harmony default export */ __webpack_exports__["a"] = (SwitchController);

//# sourceMappingURL=SwitchController.js.map


/***/ }),
/* 761 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var Model = function Model(value, animate) {
    if ( value === void 0 ) value = 0;

    this.handle = {
        transform: 'translateX(' + value + 'px)',
        transition: animate
    };
};

/* harmony default export */ __webpack_exports__["a"] = (Model);

//# sourceMappingURL=SwitchModel.js.map


/***/ }),
/* 762 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = currencyDisplays;
/* harmony export (immutable) */ __webpack_exports__["c"] = currencyDisplay;
/* harmony export (immutable) */ __webpack_exports__["d"] = currencyFractionOptions;
/* unused harmony export territoryCurrencyCode */
/* harmony export (immutable) */ __webpack_exports__["b"] = localeCurrency;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__errors__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__territory__ = __webpack_require__(234);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__parse_range_date__ = __webpack_require__(770);





/* eslint-disable consistent-return */

var NoCurrency = __WEBPACK_IMPORTED_MODULE_1__errors__["a" /* errors */].NoCurrency;
var NoCurrencyDisplay = __WEBPACK_IMPORTED_MODULE_1__errors__["a" /* errors */].NoCurrencyDisplay;
var NoSupplementalCurrency = __WEBPACK_IMPORTED_MODULE_1__errors__["a" /* errors */].NoSupplementalCurrency;
var NoCurrencyRegion = __WEBPACK_IMPORTED_MODULE_1__errors__["a" /* errors */].NoCurrencyRegion;
var NoValidCurrency = __WEBPACK_IMPORTED_MODULE_1__errors__["a" /* errors */].NoValidCurrency;

var DEFAULT_CURRENCY_FRACTIONS = 2;
var SYMBOL = "symbol";
var INVALID_CURRENCY_CODE = 'XXX';

var GLOBAL_CURRENCIES = {
    '001': 'USD', // 001 refers to world. not sure if it is correct to assume USD but seems better than throw an error
    '150': 'EUR' // 150 territory for Europe

};

function getCurrencyInfo(locale, currency, throwIfNoValid) {
    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__info__["a" /* getLocaleInfo */])(locale);
    var currencies = info.numbers.currencies;
    if (!currencies) {
        if (throwIfNoValid) {
            throw NoCurrency.error();
        }

        return;
    }

    var currencyDisplayInfo = currencies[currency];

    if (!currencyDisplayInfo) {
        if (throwIfNoValid) {
            throw NoCurrencyDisplay.error();
        }

        return;
    }

    return currencyDisplayInfo;
}

function lengthComparer(a, b) {
    return b.length - a.length;
}

function regionCurrency(regionCurrencies) {
    var latestValidUntil, latestValidUntilRange;
    var latestStillValid, latestStillValidDate;

    for (var idx = 0; idx < regionCurrencies.length; idx++) {
        var currency = regionCurrencies[idx];
        var code = Object.keys(currency)[0];
        var info = currency[code];
        if (code !== INVALID_CURRENCY_CODE && info._tender !== 'false' && info._from) {
            if (!info._to) {
                var stillValidDate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__parse_range_date__["a" /* default */])(info._from);
                if (!latestStillValidDate || latestStillValidDate < stillValidDate) {
                    latestStillValid = code;
                    latestStillValidDate = stillValidDate;
                }
            } else if (!latestStillValid) {
                var validFrom = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__parse_range_date__["a" /* default */])(info._from);
                var validTo = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__parse_range_date__["a" /* default */])(info._to);
                if (!latestValidUntilRange || latestValidUntilRange.to < validTo || latestValidUntilRange.from < validFrom) {
                    latestValidUntil = code;
                    latestValidUntilRange = {
                        from: validFrom,
                        to: validTo
                    };
                }
            }
        }
    }

    return latestStillValid || latestValidUntil;
}

function currencyDisplays(locale, currency, throwIfNoValid) {
    if ( throwIfNoValid === void 0 ) throwIfNoValid = true;

    var currencyInfo = getCurrencyInfo(locale, currency, throwIfNoValid);
    if (!currencyInfo) {
        return;
    }

    if (!currencyInfo.displays) {
        var displays = [ currency ];
        for (var field in currencyInfo) {
            displays.push(currencyInfo[field]);
        }
        displays.sort(lengthComparer);
        currencyInfo.displays = displays;
    }

    return currencyInfo.displays;
}

function currencyDisplay(locale, options) {
    var value = options.value;
    var currency = options.currency;
    var currencyDisplay = options.currencyDisplay; if ( currencyDisplay === void 0 ) currencyDisplay = SYMBOL;

    if (currencyDisplay === "code") {
        return currency;
    }

    var currencyInfo = getCurrencyInfo(locale, currency, true);
    var result;

    if (currencyDisplay === SYMBOL) {
        result = currencyInfo["symbol-alt-narrow"] || currencyInfo[SYMBOL];
    } else {
        if (typeof value === undefined || value !== 1) {
            result = currencyInfo["displayName-count-other"];
        } else {
            result = currencyInfo["displayName-count-one"];
        }
    }

    return result;
}

function currencyFractionOptions(code) {
    var minimumFractionDigits = DEFAULT_CURRENCY_FRACTIONS;
    var maximumFractionDigits = DEFAULT_CURRENCY_FRACTIONS;

    var fractions = ((__WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental.currencyData || {}).fractions || {})[code];

    if (fractions && fractions._digits) {
        maximumFractionDigits = minimumFractionDigits = parseInt(fractions._digits, 10);
    }

    return {
        minimumFractionDigits: minimumFractionDigits,
        maximumFractionDigits: maximumFractionDigits
    };
}

function territoryCurrencyCode(territory, throwIfNoValid) {
    if ( throwIfNoValid === void 0 ) throwIfNoValid = true;

    if (GLOBAL_CURRENCIES[territory]) {
        return GLOBAL_CURRENCIES[territory];
    }

    var currencyData = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental.currencyData;
    if (!currencyData) {
        if (throwIfNoValid) {
            throw NoSupplementalCurrency.error();
        }

        return;
    }

    var regionCurrencies = currencyData.region[territory];

    if (!regionCurrencies) {
        if (throwIfNoValid) {
            throw NoCurrencyRegion.error(territory);
        }

        return;
    }

    var currencyCode = regionCurrency(regionCurrencies);

    return currencyCode;
}

function localeCurrency(locale, throwIfNoValid) {
    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__info__["a" /* getLocaleInfo */])(locale);
    var numbers = info.numbers;

    if (!numbers.localeCurrency) {
        var currency = territoryCurrencyCode(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__territory__["a" /* default */])(info), throwIfNoValid);

        if (!currency && throwIfNoValid) {
            throw NoValidCurrency.error(info.name);
        }

        numbers.localeCurrency = currency;
    }

    return numbers.localeCurrency;
}

//# sourceMappingURL=currency.js.map


/***/ }),
/* 763 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = dateFieldName;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__errors__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_constants__ = __webpack_require__(22);




function dateFieldName(options, locale) {
    if ( locale === void 0 ) locale = __WEBPACK_IMPORTED_MODULE_2__common_constants__["b" /* DEFAULT_LOCALE */];

    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__info__["c" /* localeInfo */])(locale);
    var dateFields = info.calendar.dateFields;
    if (!dateFields) {
        throw __WEBPACK_IMPORTED_MODULE_1__errors__["a" /* errors */].NoDateFieldNames.error();
    }

    var fieldNameInfo = dateFields[options.type] || {};

    return fieldNameInfo[options.nameType] || fieldNameInfo['wide'];
}

//# sourceMappingURL=date-field-name.js.map


/***/ }),
/* 764 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var defaultData = {
    en: {
        name: "en",
        identity: {
            version: {
                _number: "$Revision: 12418 $",
                _cldrVersion: "29"
            },
            language: "en"
        },
        territory: "US",
        numbers: {
            symbols: {
                decimal: ".",
                group: ",",
                list: ";",
                percentSign: "%",
                plusSign: "+",
                minusSign: "-",
                exponential: "E",
                superscriptingExponent: "×",
                perMille: "‰",
                infinity: "∞",
                nan: "NaN",
                timeSeparator: ":"
            },
            decimal: {
                patterns: [
                    "n"
                ],
                groupSize: [
                    3
                ]
            },
            scientific: {
                patterns: [
                    "nEn"
                ],
                groupSize: []
            },
            percent: {
                patterns: [
                    "n%"
                ],
                groupSize: [
                    3
                ]
            },
            currency: {
                patterns: [
                    "$n"
                ],
                groupSize: [
                    3
                ],
                "unitPattern-count-one": "n $",
                "unitPattern-count-other": "n $"
            },
            currencies: {
                BGN: {
                    displayName: "Bulgarian Lev",
                    "displayName-count-one": "Bulgarian lev",
                    "displayName-count-other": "Bulgarian leva",
                    symbol: "BGN"
                },
                EUR: {
                    displayName: "Euro",
                    "displayName-count-one": "euro",
                    "displayName-count-other": "euros",
                    symbol: "€",
                    "symbol-alt-narrow": "€"
                },
                USD: {
                    displayName: "US Dollar",
                    "displayName-count-one": "US dollar",
                    "displayName-count-other": "US dollars",
                    symbol: "$",
                    "symbol-alt-narrow": "$"
                }
            },
            localeCurrency: "USD",
            accounting: {
                patterns: [
                    "$n",
                    "($n)"
                ],
                groupSize: [
                    3
                ]
            }
        },
        calendar: {
            gmtFormat: "GMT{0}",
            gmtZeroFormat: "GMT",
            patterns: {
                d: "M/d/y",
                D: "EEEE, MMMM d, y",
                m: "MMM d",
                M: "MMMM d",
                y: "MMM y",
                Y: "MMMM y",
                F: "EEEE, MMMM d, y h:mm:ss a",
                g: "M/d/y h:mm a",
                G: "M/d/y h:mm:ss a",
                t: "h:mm a",
                T: "h:mm:ss a",
                s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
                u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"
            },
            dateTimeFormats: {
                full: "{1} 'at' {0}",
                long: "{1} 'at' {0}",
                medium: "{1}, {0}",
                short: "{1}, {0}",
                availableFormats: {
                    Bh: "h B",
                    Bhm: "h:mm B",
                    Bhms: "h:mm:ss B",
                    d: "d",
                    E: "ccc",
                    EBhm: "E h:mm B",
                    EBhms: "E h:mm:ss B",
                    Ed: "d E",
                    Ehm: "E h:mm a",
                    EHm: "E HH:mm",
                    Ehms: "E h:mm:ss a",
                    EHms: "E HH:mm:ss",
                    Gy: "y G",
                    GyMMM: "MMM y G",
                    GyMMMd: "MMM d, y G",
                    GyMMMEd: "E, MMM d, y G",
                    h: "h a",
                    H: "HH",
                    hm: "h:mm a",
                    Hm: "HH:mm",
                    hms: "h:mm:ss a",
                    Hms: "HH:mm:ss",
                    hmsv: "h:mm:ss a v",
                    Hmsv: "HH:mm:ss v",
                    hmv: "h:mm a v",
                    Hmv: "HH:mm v",
                    M: "L",
                    Md: "M/d",
                    MEd: "E, M/d",
                    MMM: "LLL",
                    MMMd: "MMM d",
                    MMMEd: "E, MMM d",
                    MMMMd: "MMMM d",
                    "MMMMW-count-one": "'week' W 'of' MMMM",
                    "MMMMW-count-other": "'week' W 'of' MMMM",
                    ms: "mm:ss",
                    y: "y",
                    yM: "M/y",
                    yMd: "M/d/y",
                    yMEd: "E, M/d/y",
                    yMMM: "MMM y",
                    yMMMd: "MMM d, y",
                    yMMMEd: "E, MMM d, y",
                    yMMMM: "MMMM y",
                    yQQQ: "QQQ y",
                    yQQQQ: "QQQQ y",
                    "yw-count-one": "'week' w 'of' Y",
                    "yw-count-other": "'week' w 'of' Y"
                }
            },
            timeFormats: {
                full: "h:mm:ss a zzzz",
                long: "h:mm:ss a z",
                medium: "h:mm:ss a",
                short: "h:mm a"
            },
            dateFormats: {
                full: "EEEE, MMMM d, y",
                long: "MMMM d, y",
                medium: "MMM d, y",
                short: "M/d/yy"
            },
            days: {
                format: {
                    abbreviated: [
                        "Sun",
                        "Mon",
                        "Tue",
                        "Wed",
                        "Thu",
                        "Fri",
                        "Sat"
                    ],
                    narrow: [
                        "S",
                        "M",
                        "T",
                        "W",
                        "T",
                        "F",
                        "S"
                    ],
                    short: [
                        "Su",
                        "Mo",
                        "Tu",
                        "We",
                        "Th",
                        "Fr",
                        "Sa"
                    ],
                    wide: [
                        "Sunday",
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday"
                    ]
                },
                "stand-alone": {
                    abbreviated: [
                        "Sun",
                        "Mon",
                        "Tue",
                        "Wed",
                        "Thu",
                        "Fri",
                        "Sat"
                    ],
                    narrow: [
                        "S",
                        "M",
                        "T",
                        "W",
                        "T",
                        "F",
                        "S"
                    ],
                    short: [
                        "Su",
                        "Mo",
                        "Tu",
                        "We",
                        "Th",
                        "Fr",
                        "Sa"
                    ],
                    wide: [
                        "Sunday",
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday"
                    ]
                }
            },
            months: {
                format: {
                    abbreviated: [
                        "Jan",
                        "Feb",
                        "Mar",
                        "Apr",
                        "May",
                        "Jun",
                        "Jul",
                        "Aug",
                        "Sep",
                        "Oct",
                        "Nov",
                        "Dec"
                    ],
                    narrow: [
                        "J",
                        "F",
                        "M",
                        "A",
                        "M",
                        "J",
                        "J",
                        "A",
                        "S",
                        "O",
                        "N",
                        "D"
                    ],
                    wide: [
                        "January",
                        "February",
                        "March",
                        "April",
                        "May",
                        "June",
                        "July",
                        "August",
                        "September",
                        "October",
                        "November",
                        "December"
                    ]
                },
                "stand-alone": {
                    abbreviated: [
                        "Jan",
                        "Feb",
                        "Mar",
                        "Apr",
                        "May",
                        "Jun",
                        "Jul",
                        "Aug",
                        "Sep",
                        "Oct",
                        "Nov",
                        "Dec"
                    ],
                    narrow: [
                        "J",
                        "F",
                        "M",
                        "A",
                        "M",
                        "J",
                        "J",
                        "A",
                        "S",
                        "O",
                        "N",
                        "D"
                    ],
                    wide: [
                        "January",
                        "February",
                        "March",
                        "April",
                        "May",
                        "June",
                        "July",
                        "August",
                        "September",
                        "October",
                        "November",
                        "December"
                    ]
                }
            },
            quarters: {
                format: {
                    abbreviated: [
                        "Q1",
                        "Q2",
                        "Q3",
                        "Q4"
                    ],
                    narrow: [
                        "1",
                        "2",
                        "3",
                        "4"
                    ],
                    wide: [
                        "1st quarter",
                        "2nd quarter",
                        "3rd quarter",
                        "4th quarter"
                    ]
                },
                "stand-alone": {
                    abbreviated: [
                        "Q1",
                        "Q2",
                        "Q3",
                        "Q4"
                    ],
                    narrow: [
                        "1",
                        "2",
                        "3",
                        "4"
                    ],
                    wide: [
                        "1st quarter",
                        "2nd quarter",
                        "3rd quarter",
                        "4th quarter"
                    ]
                }
            },
            dayPeriods: {
                format: {
                    abbreviated: {
                        midnight: "midnight",
                        am: "AM",
                        "am-alt-variant": "am",
                        noon: "noon",
                        pm: "PM",
                        "pm-alt-variant": "pm",
                        morning1: "in the morning",
                        afternoon1: "in the afternoon",
                        evening1: "in the evening",
                        night1: "at night"
                    },
                    narrow: {
                        midnight: "mi",
                        am: "a",
                        "am-alt-variant": "am",
                        noon: "n",
                        pm: "p",
                        "pm-alt-variant": "pm",
                        morning1: "in the morning",
                        afternoon1: "in the afternoon",
                        evening1: "in the evening",
                        night1: "at night"
                    },
                    wide: {
                        midnight: "midnight",
                        am: "AM",
                        "am-alt-variant": "am",
                        noon: "noon",
                        pm: "PM",
                        "pm-alt-variant": "pm",
                        morning1: "in the morning",
                        afternoon1: "in the afternoon",
                        evening1: "in the evening",
                        night1: "at night"
                    }
                },
                "stand-alone": {
                    abbreviated: {
                        midnight: "midnight",
                        am: "AM",
                        "am-alt-variant": "am",
                        noon: "noon",
                        pm: "PM",
                        "pm-alt-variant": "pm",
                        morning1: "morning",
                        afternoon1: "afternoon",
                        evening1: "evening",
                        night1: "night"
                    },
                    narrow: {
                        midnight: "midnight",
                        am: "AM",
                        "am-alt-variant": "am",
                        noon: "noon",
                        pm: "PM",
                        "pm-alt-variant": "pm",
                        morning1: "morning",
                        afternoon1: "afternoon",
                        evening1: "evening",
                        night1: "night"
                    },
                    wide: {
                        midnight: "midnight",
                        am: "AM",
                        "am-alt-variant": "am",
                        noon: "noon",
                        pm: "PM",
                        "pm-alt-variant": "pm",
                        morning1: "morning",
                        afternoon1: "afternoon",
                        evening1: "evening",
                        night1: "night"
                    }
                }
            },
            eras: {
                format: {
                    wide: {
                        0: "Before Christ",
                        1: "Anno Domini",
                        "0-alt-variant": "Before Common Era",
                        "1-alt-variant": "Common Era"
                    },
                    abbreviated: {
                        0: "BC",
                        1: "AD",
                        "0-alt-variant": "BCE",
                        "1-alt-variant": "CE"
                    },
                    narrow: {
                        0: "B",
                        1: "A",
                        "0-alt-variant": "BCE",
                        "1-alt-variant": "CE"
                    }
                }
            },
            dateFields: {
                era: {
                    wide: "era"
                },
                year: {
                    wide: "year",
                    short: "yr.",
                    narrow: "yr."
                },
                quarter: {
                    wide: "quarter",
                    short: "qtr.",
                    narrow: "qtr."
                },
                month: {
                    wide: "month",
                    short: "mo.",
                    narrow: "mo."
                },
                week: {
                    wide: "week",
                    short: "wk.",
                    narrow: "wk."
                },
                day: {
                    wide: "day",
                    short: "day",
                    narrow: "day"
                },
                weekday: {
                    wide: "day of the week"
                },
                dayperiod: {
                    wide: "AM/PM"
                },
                hour: {
                    wide: "hour",
                    short: "hr.",
                    narrow: "hr."
                },
                minute: {
                    wide: "minute",
                    short: "min.",
                    narrow: "min."
                },
                second: {
                    wide: "second",
                    short: "sec.",
                    narrow: "sec."
                },
                zone: {
                    wide: "time zone"
                }
            }
        }
    },
    supplemental: {
        likelySubtags: {
            en: "en-Latn-US"
        },
        currencyData: {
            region: {
                US: [
                    {
                        USD: {
                            _from: "1792-01-01"
                        }
                    }
                ]
            }
        },
        weekData: {
            firstDay: {
                US: "sun"
            }
        }
    }
};
/* harmony default export */ __webpack_exports__["a"] = (defaultData);
//# sourceMappingURL=default-data.js.map


/***/ }),
/* 765 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = firstDay;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__territory__ = __webpack_require__(234);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__errors__ = __webpack_require__(79);





var NoWeekData = __WEBPACK_IMPORTED_MODULE_2__errors__["a" /* errors */].NoWeekData;
var NoFirstDay = __WEBPACK_IMPORTED_MODULE_2__errors__["a" /* errors */].NoFirstDay;

var DAYS = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ];
var DEFAULT = '001';

function firstDay(locale) {
    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__info__["a" /* getLocaleInfo */])(locale);

    if (!isNaN(info.firstDay)) {
        return info.firstDay;
    }

    var weekData = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental.weekData;
    if (!weekData) {
        throw NoWeekData.error();
    }

    var firstDay = weekData.firstDay[__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__territory__["a" /* default */])(info)] || weekData.firstDay[DEFAULT];

    if (!firstDay) {
        throw NoFirstDay.error();
    }

    info.firstDay = DAYS.indexOf(firstDay);

    return info.firstDay;
}

//# sourceMappingURL=first-day.js.map


/***/ }),
/* 766 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = loadCalendarInfo;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);


var predefinedDatePatterns = {
    s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
    u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"
};
var datePatterns = {
    d: [ [ "dateTimeFormats", "availableFormats", "yMd" ] ],
    D: [ [ "dateFormats", "full" ] ],
    m: [ [ "dateTimeFormats", "availableFormats", "MMMd" ] ],
    M: [ [ "dateTimeFormats", "availableFormats", "MMMMd" ] ],
    y: [ [ "dateTimeFormats", "availableFormats", "yMMM" ] ],
    Y: [ [ "dateTimeFormats", "availableFormats", "yMMMM" ] ],
    F: [ [ "dateFormats", "full" ], [ "timeFormats", "medium" ] ],
    g: [ [ "dateTimeFormats", "availableFormats", "yMd" ], [ "timeFormats", "short" ] ],
    G: [ [ "dateTimeFormats", "availableFormats", "yMd" ], [ "timeFormats", "medium" ] ],
    t: [ [ "timeFormats", "short" ] ],
    T: [ [ "timeFormats", "medium" ] ]
};

function toArray(obj) {
    var result = [];
    var names = Object.getOwnPropertyNames(obj);
    for (var idx = 0; idx < names.length; idx++) {
        var value = obj[names[idx]];
        result.push(value);
    }
    return result;
}

function getCalendarNames(info, isObj) {
    var result = {};
    for (var formatType in info) {
        var names = result[formatType] = {};
        for (var format in info[formatType]) {
            var formats = info[formatType][format];
            names[format] = isObj ? formats : toArray(formats);
        }
    }
    return result;
}

function getEraNames(eras) {
    var result = {};
    var format = result.format = {};
    var eraNameMap = {
        eraAbbr: "abbreviated",
        eraNames: "wide",
        eraNarrow: "narrow"
    };

    for (var eraFormatName in eras) {
        var formatName = eraNameMap[eraFormatName];
        format[formatName] = eras[eraFormatName];
    }

    return result;
}

function loadCalendarNames(locale, calendar) {
    var localeCalendar = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale].calendar;
    localeCalendar.days = getCalendarNames(calendar.days);
    localeCalendar.months = getCalendarNames(calendar.months);
    localeCalendar.quarters = getCalendarNames(calendar.quarters);
    localeCalendar.dayPeriods = getCalendarNames(calendar.dayPeriods, true);

    localeCalendar.eras = getEraNames(calendar.eras);
}

function loadCalendarDateFields(locale, fields) {
    var localeCalendar = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale].calendar;
    var dateFields = {};

    for (var field in fields) {
        var ref = field.split('-');
        var fieldName = ref[0];
        var formatType = ref[1]; if ( formatType === void 0 ) formatType = 'wide';
        var fieldInfo = dateFields[fieldName] || {};
        var displayName = fields[field].displayName;

        if (!displayName) { continue; }

        fieldInfo[formatType] = displayName;
        dateFields[fieldName] = fieldInfo;
    }

    localeCalendar.dateFields = dateFields;
}

function getPredefinedFormat(paths, calendar) {
    var result = [];

    for (var pathIdx = 0; pathIdx < paths.length; pathIdx++) {
        var fields = paths[ pathIdx ];
        var pattern = calendar;
        for (var idx = 0; idx < fields.length; idx++) {
            pattern = pattern[fields[idx]];
        }
        result.push(pattern);
    }

    return result.join(" ");
}

function loadCalendarPatterns(locale, calendar) {
    var cldrCalendar = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale].calendar;
    var patterns = cldrCalendar.patterns = {};
    for (var pattern in datePatterns) {
        patterns[pattern] = getPredefinedFormat(datePatterns[pattern], calendar);
    }

    for (var pattern$1 in predefinedDatePatterns) {
        patterns[pattern$1] = predefinedDatePatterns[pattern$1];
    }

    var dateTimeFormats = calendar.dateTimeFormats;
    cldrCalendar.dateTimeFormats = {
        full: dateTimeFormats.full,
        long: dateTimeFormats.long,
        medium: dateTimeFormats.medium,
        short: dateTimeFormats.short,
        availableFormats: dateTimeFormats.availableFormats
    };
    cldrCalendar.timeFormats = calendar.timeFormats;
    cldrCalendar.dateFormats = calendar.dateFormats;
}


function loadCalendarInfo(locale, info) {
    var calendar = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale].calendar = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale].calendar || {};
    for (var field in info) {
        if (field === "timeZoneNames") {
            calendar.gmtFormat = info[field].gmtFormat;
            calendar.gmtZeroFormat = info[field].gmtZeroFormat;
        } else if (field === "calendars" && info[field].gregorian) {
            loadCalendarPatterns(locale, info[field].gregorian);
            loadCalendarNames(locale, info[field].gregorian);
        } else if (field === "fields") {
            loadCalendarDateFields(locale, info.fields);
        }
    }
}

//# sourceMappingURL=load-dates.js.map


/***/ }),
/* 767 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = loadNumbersInfo;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_constants__ = __webpack_require__(22);



var LATIN_NUMBER_FORMATS = "Formats-numberSystem-latn";
var LATIN_NUMBER_SYMBOLS = "symbols-numberSystem-latn";

var patternRegExp = /([#,0.]+)/g;
var cldrCurrencyRegExp = /¤/g;

function getPatterns(pattern) {
    patternRegExp.lastIndex = 0;

    return pattern.replace(cldrCurrencyRegExp, __WEBPACK_IMPORTED_MODULE_1__common_constants__["c" /* CURRENCY_PLACEHOLDER */]).replace(patternRegExp, __WEBPACK_IMPORTED_MODULE_1__common_constants__["d" /* NUMBER_PLACEHOLDER */]).split(__WEBPACK_IMPORTED_MODULE_1__common_constants__["e" /* LIST_SEPARATOR */]);
}

function getGroupSize(pattern) {
    patternRegExp.lastIndex = 0;

    var numberPatterns = patternRegExp.exec(pattern.split(__WEBPACK_IMPORTED_MODULE_1__common_constants__["e" /* LIST_SEPARATOR */])[0])[0].split(__WEBPACK_IMPORTED_MODULE_1__common_constants__["f" /* POINT */]);
    var integer = numberPatterns[0];

    var groupSize = integer.split(__WEBPACK_IMPORTED_MODULE_1__common_constants__["g" /* GROUP_SEPARATOR */]).slice(1).map(function(group) {
        return group.length;
    }).reverse();

    return groupSize;
}

function loadCurrencyUnitPatterns(currencyInfo, currencyFormats) {
    for (var field in currencyFormats) {
        if (field.startsWith("unitPattern")) {
            currencyInfo[field] = currencyFormats[field].replace("{0}", __WEBPACK_IMPORTED_MODULE_1__common_constants__["d" /* NUMBER_PLACEHOLDER */]).replace("{1}", __WEBPACK_IMPORTED_MODULE_1__common_constants__["c" /* CURRENCY_PLACEHOLDER */]);
        }
    }
}

function loadNumbersInfo(locale, info) {
    var localeInfo = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale];
    var numbers = localeInfo.numbers = localeInfo.numbers || {};
    numbers.symbols = numbers.symbols || {};
    for (var field in info) {
        if (field === LATIN_NUMBER_SYMBOLS) {
            Object.assign(numbers.symbols, info[field]);
        } else if (field.includes(LATIN_NUMBER_FORMATS)) {
            var style = field.substr(0, field.indexOf(LATIN_NUMBER_FORMATS));
            var pattern = info[field].standard;
            numbers[style] = {
                patterns: getPatterns(pattern)
            };
            if (style === __WEBPACK_IMPORTED_MODULE_1__common_constants__["h" /* CURRENCY */]) {
                numbers[style].groupSize = getGroupSize((info[__WEBPACK_IMPORTED_MODULE_1__common_constants__["i" /* DECIMAL */] + LATIN_NUMBER_FORMATS] || info[field]).standard);
                loadCurrencyUnitPatterns(numbers[style], info[field]);
                numbers[__WEBPACK_IMPORTED_MODULE_1__common_constants__["j" /* ACCOUNTING */]] = {
                    patterns: getPatterns(info[field][__WEBPACK_IMPORTED_MODULE_1__common_constants__["j" /* ACCOUNTING */]]),
                    groupSize: numbers[style].groupSize
                };
            } else {
                numbers[style].groupSize = getGroupSize(pattern);
            }
        } else if (field === "currencies") {
            numbers.currencies = info[field];
        }
    }
}
//# sourceMappingURL=load-numbers.js.map


/***/ }),
/* 768 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = load;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__load_numbers__ = __webpack_require__(767);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__load_dates__ = __webpack_require__(766);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__territory__ = __webpack_require__(234);





function loadLocale(locale, info) {
    for (var field in info) {
        if (field === "numbers") {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__load_numbers__["a" /* default */])(locale, info[field]);
        } else if (field === "dates") {
            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__load_dates__["a" /* default */])(locale, info[field]);
        }
    }
}

function load() {
    var arguments$1 = arguments;

    var length = arguments.length;
    for (var idx = 0; idx < length; idx++) {
        var entry = arguments$1[idx];
        if (entry.main) {
            var locale = Object.keys(entry.main)[0];
            var info = entry.main[locale];
            var localeInfo = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale] = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale] || {};

            localeInfo.name = localeInfo.name || locale;
            localeInfo.identity = localeInfo.identity || info.identity;

            __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__territory__["a" /* default */])(localeInfo);
            loadLocale(locale, info);
        } else if (entry.supplemental) {
            if (entry.supplemental.weekData) {
                __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental.weekData = {
                    firstDay: entry.supplemental.weekData.firstDay
                };
            } else {
                Object.assign(__WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental, entry.supplemental);
            }
        }
    }
}
//# sourceMappingURL=load.js.map


/***/ }),
/* 769 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = numberSymbols;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);


function numberSymbols(locale) {
    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__info__["a" /* getLocaleInfo */])(locale);

    return info.numbers.symbols;
}
//# sourceMappingURL=number-symbols.js.map


/***/ }),
/* 770 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = parseRangeDate;
function parseRangeDate(value) {
    var parts = value.split('-');
    var year = parseInt(parts[0], 10);
    var month = parseInt(parts[1], 10) - 1;
    var day = parseInt(parts[2], 10);

    return new Date(year, month, day);
}

//# sourceMappingURL=parse-range-date.js.map


/***/ }),
/* 771 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = setData;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__info__ = __webpack_require__(30);


function setData(data) {
    var locale = data.name;
    var info = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale] = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */][locale] || {};
    if (data.likelySubtags) {
        var supplemental = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental = __WEBPACK_IMPORTED_MODULE_0__info__["b" /* cldr */].supplemental || {};
        supplemental.likelySubtags = Object.assign(supplemental.likelySubtags || {}, data.likelySubtags);
    }

    var numbers = info.numbers;

    Object.assign(info, data);

    if (numbers && data.numbers) {
        info.numbers = Object.assign({}, numbers, data.numbers);
    }
}
//# sourceMappingURL=set-data.js.map


/***/ }),
/* 772 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatDate;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cldr__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_format_string__ = __webpack_require__(474);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__date_pattern__ = __webpack_require__(239);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__format_names__ = __webpack_require__(479);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_pad__ = __webpack_require__(475);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_is_date__ = __webpack_require__(235);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(477);









function formatDayOfWeekIndex(day, formatLength, localeInfo) {
    var firstDayIndex = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["c" /* firstDay */])(localeInfo);
    var dayIndex;
    if (day < firstDayIndex) {
        dayIndex = 7 - firstDayIndex + day;
    } else {
        dayIndex = day - firstDayIndex;
    }

    return dayIndex + 1;
}

function formatMonth(month, formatLength, info, standAlone) {
    if (formatLength <= 2) {
        return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(month + 1, formatLength);
    }
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "months", formatLength, standAlone)[month];
}

function formatQuarter(date, formatLength, info, standAlone) {
    var quarter = Math.floor(date.getMonth() / 3);
    if (formatLength < 3) {
        return quarter + 1;
    }

    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "quarters", formatLength, standAlone)[quarter];
}


function formatTimeZone(date, info, options) {
    var shortHours = options.shortHours;
    var optionalMinutes = options.optionalMinutes;
    var separator = options.separator;
    var localizedName = options.localizedName;
    var zZeroOffset = options.zZeroOffset;
    var offset = date.getTimezoneOffset() / 60;
    if (offset === 0 && zZeroOffset) {
        return "Z";
    }
    var sign = offset <= 0 ? "+" : "-";
    var hoursMinutes = Math.abs(offset).toString().split(".");
    var minutes = hoursMinutes[1] || 0;
    var result = sign + (shortHours ? hoursMinutes[0] : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(hoursMinutes[0], 2));
    if (minutes || !optionalMinutes) {
        result += (separator ? ":" : __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(minutes, 2);
    }

    if (localizedName) {
        var localizedFormat = offset === 0 ? info.calendar.gmtZeroFormat : info.calendar.gmtFormat;
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_format_string__["a" /* default */])(localizedFormat, result);
    }

    return result;
}

function formatDayOfWeek(date, formatLength, info, standAlone) {
    var result;
    if (formatLength < 3) {
        result = formatDayOfWeekIndex(date.getDay(), formatLength, info);
    } else {
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "days", formatLength, standAlone)[date.getDay()];
    }
    return result;
}

var formatters = {};

formatters.d = function(date, formatLength) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(date.getDate(), formatLength);
};

formatters.E = function(date, formatLength, info) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "days", formatLength)[date.getDay()];
};

formatters.M = function(date, formatLength, info) {
    return formatMonth(date.getMonth(), formatLength, info, false);
};

formatters.L = function(date, formatLength, info) {
    return formatMonth(date.getMonth(), formatLength, info, true);
};

formatters.y = function(date, formatLength) {
    var year = date.getFullYear();
    if (formatLength === 2) {
        year = year % 100;
    }
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(year, formatLength);
};

formatters.h = function(date, formatLength) {
    var hours = date.getHours() % 12 || 12;
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(hours, formatLength);
};

formatters.H = function(date, formatLength) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(date.getHours(), formatLength);
};

formatters.k = function(date, formatLength) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(date.getHours() || 24, formatLength);
};

formatters.K = function(date, formatLength) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(date.getHours() % 12, formatLength);
};

formatters.m = function(date, formatLength) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(date.getMinutes(), formatLength);
};

formatters.s = function(date, formatLength) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(date.getSeconds(), formatLength);
};

formatters.S = function(date, formatLength) {
    var milliseconds = date.getMilliseconds();
    var result;
    if (milliseconds !== 0) {
        result = String(date.getMilliseconds() / 1000).split(".")[1].substr(0, formatLength);
    } else {
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_pad__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */], formatLength);
    }
    return result;
};

formatters.a = function(date, formatLength, info) {
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "dayPeriods", formatLength)[date.getHours() < 12 ? "am" : "pm"];
};

formatters.z = function(date, formatLength, info) {
    return formatTimeZone(date, info, {
        shortHours: formatLength < 4,
        optionalMinutes: formatLength < 4,
        separator: true,
        localizedName: true
    });
};

formatters.Z = function(date, formatLength, info) {
    return formatTimeZone(date, info, {
        separator: formatLength > 3,
        localizedName: formatLength === 4,
        zZeroOffset: formatLength === 5
    });
};

formatters.x = function(date, formatLength, info) {
    return formatTimeZone(date, info, {
        optionalMinutes: formatLength === 1,
        separator: formatLength === 3 || formatLength === 5
    });
};

formatters.X = function(date, formatLength, info) {
    return formatTimeZone(date, info, {
        optionalMinutes: formatLength === 1,
        separator: formatLength === 3 || formatLength === 5,
        zZeroOffset: true
    });
};

formatters.G = function(date, formatLength, info) {
    var era = date.getFullYear() >= 0 ? 1 : 0;
    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "eras", formatLength)[era];
};

formatters.e = formatDayOfWeek;

formatters.c = function(date, formatLength, info) {
    return formatDayOfWeek(date, formatLength, info, true);
};

formatters.q = function(date, formatLength, info) {
    return formatQuarter(date, formatLength, info, true);
};

formatters.Q = formatQuarter;

function formatDate(date, format, locale) {
    if ( locale === void 0 ) locale = __WEBPACK_IMPORTED_MODULE_1__common_constants__["b" /* DEFAULT_LOCALE */];

    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__common_is_date__["a" /* default */])(date)) {
        if (date === undefined || date === null) {
            return __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */];
        }
        return date;
    }

    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["g" /* localeInfo */])(locale);
    var pattern = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__date_pattern__["a" /* default */])(format, info);

    return pattern.replace(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* dateFormatRegExp */], function(match) {
        var formatLength = match.length;
        var result;

        if (match.includes("'") || match.includes("\"")) {
            result = match.slice(1, formatLength - 1);
        } else {
            result = formatters[match[0]](date, formatLength, info);
        }

        return result;
    });
}

//# sourceMappingURL=format-date.js.map


/***/ }),
/* 773 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = parseDate;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__time_utils__ = __webpack_require__(775);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cldr__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__errors__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__format_names__ = __webpack_require__(479);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__date_pattern__ = __webpack_require__(239);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__common_round__ = __webpack_require__(238);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common_is_date__ = __webpack_require__(235);









var timeZoneOffsetRegExp = /([+|\-]\d{1,2})(:?)(\d{2})?/;
var dateRegExp = /^\/Date\((.*?)\)\/$/;
var offsetRegExp = /[+-]\d*/;
var numberRegExp = {
    2: /^\d{1,2}/,
    3: /^\d{1,3}/,
    4: /^\d{4}/
};
var numberRegex = /\d+/;
var PLACEHOLDER = "{0}";

var standardDateFormats = [
    "yyyy/MM/dd HH:mm:ss",
    "yyyy/MM/dd HH:mm",
    "yyyy/MM/dd",
    "E MMM dd yyyy HH:mm:ss",
    "yyyy-MM-ddTHH:mm:ss.SSSSSSSXXX",
    "yyyy-MM-ddTHH:mm:ss.SSSXXX",
    "yyyy-MM-ddTHH:mm:ssXXX",
    "yyyy-MM-ddTHH:mm:ss.SSSSSSS",
    "yyyy-MM-ddTHH:mm:ss.SSS",
    "yyyy-MM-ddTHH:mmXXX",
    "yyyy-MM-ddTHH:mmX",
    "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"
];
var FORMATS_SEQUENCE = [ "G", "g", "F", "Y", "y", "M", "m", "D", "d", "y", "T", "t" ];
var TWO_DIGIT_YEAR_MAX = 2029;

function outOfRange(value, start, end) {
    return !(value >= start && value <= end);
}

function lookAhead(match, state) {
    var format = state.format;
    var idx = state.idx;
    var i = 0;
    while (format[idx] === match) {
        i++;
        idx++;
    }
    if (i > 0) {
        idx -= 1;
    }
    state.idx = idx;
    return i;
}

function getNumber(size, state) {
    var regex = size ? (numberRegExp[size] || new RegExp('^\\d{1,' + size + '}')) : numberRegex,
        match = state.value.substr(state.valueIdx, size).match(regex);

    if (match) {
        match = match[0];
        state.valueIdx += match.length;
        return parseInt(match, 10);
    }
    return null;
}

function getIndexByName(names, state, lower) {
    var i = 0,
        length = names.length,
        name, nameLength,
        matchLength = 0,
        matchIdx = 0,
        subValue;

    for (; i < length; i++) {
        name = names[i];
        nameLength = name.length;
        subValue = state.value.substr(state.valueIdx, nameLength);

        if (lower) {
            subValue = subValue.toLowerCase();
        }

        if (subValue === name && nameLength > matchLength) {
            matchLength = nameLength;
            matchIdx = i;
        }
    }

    if (matchLength) {
        state.valueIdx += matchLength;
        return matchIdx + 1;
    }

    return null;
}

function checkLiteral(state) {
    var result = false;
    if (state.value.charAt(state.valueIdx) === state.format[state.idx]) {
        state.valueIdx++;
        result = true;
    }
    return result;
}

function calendarGmtFormats(calendar) {
    var gmtFormat = calendar.gmtFormat;
    var gmtZeroFormat = calendar.gmtZeroFormat;
    if (!gmtFormat) {
        throw __WEBPACK_IMPORTED_MODULE_3__errors__["a" /* errors */].NoGMTInfo.error();
    }

    return [ gmtFormat.replace(PLACEHOLDER, __WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */]).toLowerCase(), gmtZeroFormat.replace(PLACEHOLDER, __WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */]).toLowerCase() ];
}

function parseTimeZoneOffset(state, info, options) {
    var shortHours = options.shortHours;
    var noSeparator = options.noSeparator;
    var optionalMinutes = options.optionalMinutes;
    var localizedName = options.localizedName;
    var zLiteral = options.zLiteral;
    state.UTC = true;

    if (zLiteral && state.value.charAt(state.valueIdx) === "Z") {
        state.valueIdx++;
        return false;
    }

    if (localizedName && !getIndexByName(calendarGmtFormats(info.calendar), state, true)) {
        return true;
    }

    var matches = timeZoneOffsetRegExp.exec(state.value.substr(state.valueIdx, 6));
    if (!matches) {
        return !localizedName;
    }

    var hoursMatch = matches[1];
    var minutesMatch = matches[3];
    var hoursOffset = parseInt(hoursMatch, 10);
    var separator = matches[2];
    var minutesOffset = parseInt(minutesMatch, 10);

    if (isNaN(hoursOffset) || (!shortHours && hoursMatch.length !== 3) || (!optionalMinutes && isNaN(minutesOffset)) || (noSeparator && separator)) {
        return true;
    }

    if (isNaN(minutesOffset)) {
        minutesOffset = null;
    }

    if (outOfRange(hoursOffset, -12, 13) || (minutesOffset && outOfRange(minutesOffset, 0, 59))) {
        return true;
    }

    state.valueIdx += matches[0].length;
    state.hoursOffset = hoursOffset;
    state.minutesOffset = minutesOffset;
}

function parseMonth(ch, state, info) {
    var count = lookAhead(ch, state);
    var names = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "months", count, ch === "L", true);

    var month = count < 3 ? getNumber(2, state) : getIndexByName(names, state, true);

    if (month === null || outOfRange(month, 1, 12)) {
        return true;
    }
    state.month = month - 1;
}

function parseDayOfWeek(ch, state, info) {
    var count = lookAhead(ch, state);
    var names = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "days", count, ch === "c", true);
    var dayOfWeek = count < 3 ? getNumber(1, state) : getIndexByName(names, state, true);
    if ((!dayOfWeek && dayOfWeek !== 0) || outOfRange(dayOfWeek, 1, 7)) {
        return true;
    }
}

var parsers = {};

parsers.d = function(state) {
    lookAhead("d", state);
    var day = getNumber(2, state);

    if (day === null || outOfRange(day, 1, 31)) {
        return true;
    }

    if (state.day === null) {
        state.day = day;
    }
};

parsers.E = function(state, info) {
    var count = lookAhead("E", state);
    //validate if it matches the day?
    var dayOfWeek = getIndexByName(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "days", count, false, true), state, true);
    if (dayOfWeek === null) {
        return true;
    }
};

parsers.M = function(state, info) {
    return parseMonth("M", state, info);
};

parsers.L = function(state, info) {
    return parseMonth("L", state, info);
};

parsers.y = function(state) {
    var count = lookAhead("y", state);
    var year = getNumber(count === 1 ? undefined : count, state);

    if (year === null) {
        return true;
    }

    if (count === 2) {
        var currentYear = new Date().getFullYear();
        year = (currentYear - currentYear % 100) + year;
        if (year > TWO_DIGIT_YEAR_MAX) {
            year -= 100;
        }
    }

    state.year = year;
};

parsers.h = function(state) {
    lookAhead("h", state);

    var hours = getNumber(2, state);
    if (hours === 12) {
        hours = 0;
    }

    if (hours === null || outOfRange(hours, 0, 11)) {
        return true;
    }

    state.hours = hours;
};

parsers.K = function(state) {
    lookAhead("K", state);

    var hours = getNumber(2, state);

    if (hours === null || outOfRange(hours, 0, 11)) {
        return true;
    }

    state.hours = hours;
};

parsers.a = function(state, info) {
    var count = lookAhead("a", state);
    var periodFormats = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "dayPeriods", count, false, true);

    var pmHour = getIndexByName([ periodFormats.pm ], state, true);
    if (!pmHour && !getIndexByName([ periodFormats.am ], state, true)) {
        return true;
    }

    state.pmHour = pmHour;
};

parsers.H = function(state) {
    lookAhead("H", state);
    var hours = getNumber(2, state);
    if (hours === null || outOfRange(hours, 0, 23)) {
        return true;
    }
    state.hours = hours;
};

parsers.k = function(state) {
    lookAhead("k", state);

    var hours = getNumber(2, state);

    if (hours === null || outOfRange(hours, 1, 24)) {
        return true;
    }

    state.hours = hours === 24 ? 0 : hours;
};

parsers.m = function(state) {
    lookAhead("m", state);
    var minutes = getNumber(2, state);

    if (minutes === null || outOfRange(minutes, 0, 59)) {
        return true;
    }

    state.minutes = minutes;
};

parsers.s = function(state) {
    lookAhead("s", state);
    var seconds = getNumber(2, state);
    if (seconds === null || outOfRange(seconds, 0, 59)) {
        return true;
    }
    state.seconds = seconds;
};

parsers.S = function(state) {
    var count = lookAhead("S", state);
    var match = state.value.substr(state.valueIdx, count);
    var milliseconds = null;

    if (!isNaN(parseInt(match, 10))) {
        milliseconds = parseFloat("0." + match, 10);
        milliseconds = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__common_round__["a" /* default */])(milliseconds, 3);
        milliseconds *= 1000;
        state.valueIdx += count;
    }

    if (milliseconds === null || outOfRange(milliseconds, 0, 999)) {
        return true;
    }

    state.milliseconds = milliseconds;
};

parsers.z = function(state, info) {
    var count = lookAhead("z", state);

    var shortFormat = count < 4;

    var invalid = parseTimeZoneOffset(state, info, {
        shortHours: shortFormat,
        optionalMinutes: shortFormat,
        localizedName: true
    });

    if (invalid) {
        return invalid;
    }
};

parsers.Z = function(state, info) {
    var count = lookAhead("Z", state);

    var invalid = parseTimeZoneOffset(state, info, {
        noSeparator: count < 4,
        zLiteral: count === 5,
        localizedName: count === 4
    });

    if (invalid) {
        return invalid;
    }
};

parsers.x = function(state, info) {
    var count = lookAhead("x", state);

    var invalid = parseTimeZoneOffset(state, info, {
        noSeparator: count !== 3 && count !== 5,
        optionalMinutes: count === 1
    });
    if (invalid) {
        return invalid;
    }
};

parsers.X = function(state, info) {
    var count = lookAhead("X", state);

    var invalid = parseTimeZoneOffset(state, info, {
        noSeparator: count !== 3 && count !== 5,
        optionalMinutes: count === 1,
        zLiteral: true
    });
    if (invalid) {
        return invalid;
    }
};

parsers.G = function(state, info) {
    var count = lookAhead("G", state);
    var eras = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_names__["a" /* default */])(info, "eras", count, false, true);
    var era = getIndexByName([ eras[0], eras[1] ], state, true);

    if (era === null) {
        return true;
    }
};

parsers.e = function(state, info) {
    return parseDayOfWeek("e", state, info);
};

parsers.c = function(state, info) {
    return parseDayOfWeek("c", state, info);
};

function createDate(state) {
    var year = state.year;
    var month = state.month;
    var day = state.day;
    var hours = state.hours;
    var minutes = state.minutes;
    var seconds = state.seconds;
    var milliseconds = state.milliseconds;
    var pmHour = state.pmHour;
    var UTC = state.UTC;
    var hoursOffset = state.hoursOffset;
    var minutesOffset = state.minutesOffset;
    var hasTime = hours !== null || minutes !== null || seconds || null;
    var date = new Date();
    var result;

    if (year === null && month === null && day === null && hasTime) {
        year = date.getFullYear();
        month = date.getMonth();
        day = date.getDate();
    } else {
        if (year === null) {
            year = date.getFullYear();
        }

        if (day === null) {
            day = 1;
        }
    }

    if (pmHour && hours < 12) {
        hours += 12;
    }

    if (UTC) {
        if (hoursOffset) {
            hours += -hoursOffset;
        }

        if (minutesOffset) {
            minutes += -minutesOffset * (hoursOffset < 0 ? -1 : 1);
        }

        result = new Date(Date.UTC(year, month, day, hours, minutes, seconds, milliseconds));
    } else {
        result = new Date(year, month, day, hours, minutes, seconds, milliseconds);
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__time_utils__["a" /* adjustDST */])(result, hours);
    }

    if (year < 100) {
        result.setFullYear(year);
    }

    if (result.getDate() !== day && UTC === undefined) {
        return null;
    }

    return result;
}

function parseExact(value, format, info) {
    var pattern = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__date_pattern__["a" /* default */])(format, info).split(__WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */]);

    var state = {
        format: pattern,
        idx: 0,
        value: value,
        valueIdx: 0,
        year: null,
        month: null,
        day: null,
        hours: null,
        minutes: null,
        seconds: null,
        milliseconds: null
    };
    var length = pattern.length;
    var literal = false;

    for (; state.idx < length; state.idx++) {
        var ch = pattern[state.idx];

        if (literal) {
            if (ch === "'") {
                literal = false;
            }

            checkLiteral(state);
        } else {
            if (parsers[ch]) {
                var invalid = parsers[ch](state, info);
                if (invalid) {
                    return null;
                }
            } else if (ch === "'") {
                literal = true;
                checkLiteral(state);
            } else if (!checkLiteral(state)) {
                return null;
            }
        }
    }

    if (state.valueIdx < value.length) {
        return null;
    }

    return createDate(state) || null;
}

function parseMicrosoftDateOffset(offset) {
    var sign = offset.substr(0, 1) === "-" ? -1 : 1;

    var result = offset.substring(1);
    result = (parseInt(result.substr(0, 2), 10) * 60) + parseInt(result.substring(2), 10);

    return sign * result;
}

function parseMicrosoftDateFormat(value) {
    if (value && value.indexOf("/D") === 0) {
        var date = dateRegExp.exec(value);
        if (date) {
            date = date[1];
            var tzoffset = offsetRegExp.exec(date.substring(1));

            date = new Date(parseInt(date, 10));

            if (tzoffset) {
                tzoffset = parseMicrosoftDateOffset(tzoffset[0]);
                date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__time_utils__["b" /* convertTimeZone */])(date, date.getTimezoneOffset(), 0);
                date = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__time_utils__["b" /* convertTimeZone */])(date, 0, -1 * tzoffset);
            }

            return date;
        }
    }
}

function defaultFormats(calendar) {
    var formats = [];
    var patterns = calendar.patterns;
    var length = FORMATS_SEQUENCE.length;

    for (var idx = 0; idx < length; idx++) {
        formats.push(patterns[FORMATS_SEQUENCE[idx]]);
    }

    return formats.concat(standardDateFormats);
}

function parseDate(value, formats, locale) {
    if ( locale === void 0 ) locale = __WEBPACK_IMPORTED_MODULE_2__common_constants__["b" /* DEFAULT_LOCALE */];

    if (!value) {
        return null;
    }

    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__common_is_date__["a" /* default */])(value)) {
        return value;
    }

    var parseValue = String(value).trim();
    var date = parseMicrosoftDateFormat(parseValue);
    if (date) {
        return date;
    }

    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__cldr__["g" /* localeInfo */])(locale);
    var parseFormats = formats || defaultFormats(info.calendar);
    parseFormats = Array.isArray(parseFormats) ? parseFormats : [ parseFormats ];

    var length = parseFormats.length;

    for (var idx = 0; idx < length; idx++) {
        date = parseExact(parseValue, parseFormats[idx], info);
        if (date) {
            return date;
        }
    }

    return date;
}

//# sourceMappingURL=parse-date.js.map


/***/ }),
/* 774 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = splitDateFormat;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_is_number__ = __webpack_require__(236);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__date_pattern__ = __webpack_require__(239);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__date_name_type__ = __webpack_require__(478);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(477);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__cldr__ = __webpack_require__(46);







var NAME_TYPES = {
    month: {
        type: 'months',
        minLength: 3,
        standAlone: 'L'
    },

    quarter: {
        type: 'quarters',
        minLength: 3,
        standAlone: 'q'
    },

    weekday: {
        type: 'days',
        minLength: {
            E: 0,
            c: 3,
            e: 3
        },
        standAlone: 'c'
    },

    dayperiod: {
        type: 'dayPeriods',
        minLength: 0
    },

    era: {
        type: 'eras',
        minLength: 0
    }
};

var LITERAL = 'literal';

function addLiteral(parts, value) {
    var lastPart = parts[parts.length - 1];
    if (lastPart && lastPart.type === LITERAL) {
        lastPart.pattern += value;
    } else {
        parts.push({
            type: LITERAL,
            pattern: value
        });
    }
}

function isHour12(pattern) {
    return pattern === 'h' || pattern === 'K';
}

function splitDateFormat(format, locale) {
    if ( locale === void 0 ) locale = __WEBPACK_IMPORTED_MODULE_0__common_constants__["b" /* DEFAULT_LOCALE */];

    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__cldr__["g" /* localeInfo */])(locale);
    var pattern = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__date_pattern__["a" /* default */])(format, info);
    var parts = [];
    var lastIndex = __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* dateFormatRegExp */].lastIndex = 0;
    var match = __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* dateFormatRegExp */].exec(pattern);

    while (match) {
        var value = match[0];

        if (lastIndex < match.index) {
            addLiteral(parts, pattern.substring(lastIndex, match.index));
        }

        if (value.startsWith('"') || value.startsWith("'")) {
            addLiteral(parts, value);
        } else {
            var specifier = value[0];
            var type = __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* DATE_FIELD_MAP */][specifier];
            var part = {
                type: type,
                pattern: value
            };

            if (type === 'hour') {
                part.hour12 = isHour12(value);
            }

            var names = NAME_TYPES[type];

            if (names) {
                var minLength = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_is_number__["a" /* default */])(names.minLength) ? names.minLength : names.minLength[specifier];
                var patternLength = value.length;

                if (patternLength >= minLength) {
                    part.names = {
                        type: names.type,
                        nameType: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__date_name_type__["a" /* default */])(patternLength),
                        standAlone: names.standAlone === specifier
                    };
                }
            }

            parts.push(part);
        }

        lastIndex = __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* dateFormatRegExp */].lastIndex;
        match = __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* dateFormatRegExp */].exec(pattern);
    }

    if (lastIndex < pattern.length) {
        addLiteral(parts, pattern.substring(lastIndex));
    }

    return parts;
}

//# sourceMappingURL=split-date-format.js.map


/***/ }),
/* 775 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["b"] = convertTimeZone;
/* harmony export (immutable) */ __webpack_exports__["a"] = adjustDST;
function convertTimeZone(date, fromOffset, toOffset) {
    var fromLocalOffset = date.getTimezoneOffset();

    var offsetDate = new Date(date.getTime() + (fromOffset - toOffset) * 60000);

    var toLocalOffset = offsetDate.getTimezoneOffset();

    return new Date(offsetDate.getTime() + (toLocalOffset - fromLocalOffset) * 60000);
}

function adjustDST(date, hours) {
    if (!hours && date.getHours() === 23) {
        date.setHours(date.getHours() + 2);
    }
}
//# sourceMappingURL=time-utils.js.map


/***/ }),
/* 776 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
//The error is represented by unique name and corresponding message
//The message can contain placeholders with index, e.g. {0}, {1}

/* harmony default export */ __webpack_exports__["a"] = ({
    "NoLocale": "Missing locale info for '{0}'",
    "NoCurrency": "Cannot determine currency information. Please load the locale currencies data.",
    "NoSupplementalCurrency": "Cannot determine currency. Please load the supplemental currencyData.",
    "NoCurrencyRegion": "No currency data for region '{0}'",
    "NoCurrencyDisplay": "Cannot determine currency display information. Please load the locale currencies data. The default culture does not include the all currencies data.",
    "NoGMTInfo": "Cannot determine locale GMT format. Please load the locale timeZoneNames data.",
    "NoWeekData": "Cannot determine locale first day of week. Please load the supplemental weekData.",
    "NoFirstDay": "Cannot determine locale first day of week. Please load the supplemental weekData. The default culture includes only the 'en-US' first day info.",
    "NoValidCurrency": "Cannot determine a default currency for the {0} locale. Please specify explicitly the currency with the format options.",
    "NoDateFieldNames": "Cannot determine the locale date field names. Please load the locale dateFields data."
});

//# sourceMappingURL=error-details.js.map


/***/ }),
/* 777 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["b"] = toString;
/* harmony export (immutable) */ __webpack_exports__["a"] = format;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dates__ = __webpack_require__(476);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__numbers__ = __webpack_require__(480);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_is_date__ = __webpack_require__(235);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_is_number__ = __webpack_require__(236);






var formatRegExp = /\{(\d+)(:[^\}]+)?\}/g;

function toString(value, format, locale) {
    if (format) {
        if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_is_date__["a" /* default */])(value)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__dates__["a" /* formatDate */])(value, format, locale);
        } else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_is_number__["a" /* default */])(value)) {
            return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__numbers__["a" /* formatNumber */])(value, format, locale);
        }
    }

    return value !== undefined && value !== null ? value : __WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */];
}

function format(format, values, locale) {
    return format.replace(formatRegExp, function(match, index, placeholderFormat) {
        var value = values[parseInt(index, 10)];

        return toString(value, placeholderFormat ? placeholderFormat.substring(1) : __WEBPACK_IMPORTED_MODULE_2__common_constants__["a" /* EMPTY */], locale);
    });
}

//# sourceMappingURL=format.js.map


/***/ }),
/* 778 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__numbers__ = __webpack_require__(480);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0__numbers__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_0__numbers__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dates__ = __webpack_require__(476);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_1__dates__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__dates__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_1__dates__["c"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cldr__ = __webpack_require__(46);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr__["c"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr__["d"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr__["e"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_2__cldr__["f"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__format__ = __webpack_require__(777);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_3__format__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_3__format__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__errors__ = __webpack_require__(79);
/* unused harmony namespace reexport */






//# sourceMappingURL=main.js.map


/***/ }),
/* 779 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = customNumberFormat;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__format_currency_symbol__ = __webpack_require__(481);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_integer__ = __webpack_require__(483);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__common_round__ = __webpack_require__(238);





var PLACEHOLDER = "__??__";

var SHARP = "#";
var ZERO = "0";

var literalRegExp = /(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g;
var trailingZerosRegExp = /(\.(?:[0-9]*[1-9])?)0+$/g;
var trailingPointRegExp = /\.$/;
var commaRegExp = /\,/g;

function setFormatLiterals(formatOptions) {
    var format = formatOptions.format;
    if (format.indexOf("'") > -1 || format.indexOf("\"") > -1 || format.indexOf("\\") > -1) {
        var literals = formatOptions.literals = [];
        formatOptions.format = format.replace(literalRegExp, function(match) {
            var quoteChar = match.charAt(0).replace("\\", __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */]);
            var literal = match.slice(1).replace(quoteChar, __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */]);

            literals.push(literal);

            return PLACEHOLDER;
        });
    }
}

function trimTrailingZeros(value, lastZero) {
    var trimRegex;

    if (lastZero === 0) {
        trimRegex = trailingZerosRegExp;
    } else {
        trimRegex = new RegExp(("(\\.[0-9]{" + lastZero + "}[1-9]*)0+$"), 'g');
    }

    return value.replace(trimRegex, '$1').replace(trailingPointRegExp, __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */]);
}

function roundNumber(formatOptions) {
    var number = formatOptions.number;
    var format = formatOptions.format;
    var decimalIndex = format.indexOf(__WEBPACK_IMPORTED_MODULE_0__common_constants__["f" /* POINT */]);

    if (decimalIndex !== -1) {
        var zeroIndex = format.lastIndexOf(ZERO) - decimalIndex;
        var sharpIndex = format.lastIndexOf(SHARP) - decimalIndex;
        var hasZero = zeroIndex > -1;
        var hasSharp = sharpIndex > -1;
        var fraction = number.toString().split("e");

        if (fraction[1]) {
            fraction = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_round__["a" /* default */])(number, Math.abs(fraction[1]));
        } else {
            fraction = fraction[0];
        }
        fraction = fraction.split(__WEBPACK_IMPORTED_MODULE_0__common_constants__["f" /* POINT */])[1] || __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */];

        var precision = fraction.length;
        var trailingZeros = -1;

        if (!hasZero && !hasSharp) {
            formatOptions.format = format.substring(0, decimalIndex) + format.substring(decimalIndex + 1);
            decimalIndex = -1;
            precision = 0;
        } else if (hasZero && zeroIndex > sharpIndex) {
            precision = zeroIndex;
        } else if (sharpIndex > zeroIndex) {
            if (hasSharp && precision > sharpIndex) {
                precision = sharpIndex;
            } else if (hasZero && precision < zeroIndex) {
                precision = zeroIndex;
            }

            trailingZeros = hasZero ? zeroIndex : 0;
        }

        if (precision > -1) {
            number = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_round__["a" /* default */])(number, precision);
            if (trailingZeros > -1) {
                number = trimTrailingZeros(number, trailingZeros);
            }
        }
    } else {
        number = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_round__["a" /* default */])(number);
    }

    if (formatOptions.negative && (number * -1) >= 0) {
        formatOptions.negative = false;
    }

    formatOptions.number = number;
    formatOptions.decimalIndex = decimalIndex;
}

function isConstantFormat(format) {
    return format.indexOf(SHARP) === -1 && format.indexOf(ZERO) === -1;
}

function setValueSpecificFormat(formatOptions) {
    var number = formatOptions.number;
    var format = formatOptions.format;
    format = format.split(__WEBPACK_IMPORTED_MODULE_0__common_constants__["e" /* LIST_SEPARATOR */]);
    if (formatOptions.negative && format[1]) {
        format = format[1];
        formatOptions.hasNegativeFormat = true;
    } else if (number === 0) {
        var zeroFormat = format[2];
        format = zeroFormat || format[0];
        if (zeroFormat && isConstantFormat(zeroFormat)) {
            formatOptions.constant = zeroFormat;
        }
    } else {
        format = format[0];
    }

    formatOptions.format = format;
}

function setStyleOptions(formatOptions, info) {
    var format = formatOptions.format;

    //multiply number if the format has percent
    if (format.indexOf(__WEBPACK_IMPORTED_MODULE_0__common_constants__["m" /* PERCENT_PLACEHOLDER */]) !== -1) {
        formatOptions.style = __WEBPACK_IMPORTED_MODULE_0__common_constants__["k" /* PERCENT */];
        formatOptions.symbol = info.numbers.symbols.percentSign;
        formatOptions.number *= 100;
    }

    if (format.indexOf(__WEBPACK_IMPORTED_MODULE_0__common_constants__["c" /* CURRENCY_PLACEHOLDER */]) !== -1) {
        formatOptions.style = __WEBPACK_IMPORTED_MODULE_0__common_constants__["h" /* CURRENCY */];
        formatOptions.symbol = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__format_currency_symbol__["a" /* default */])(info);
    }
}

function setGroupOptions(formatOptions) {
    formatOptions.hasGroup = formatOptions.format.indexOf(__WEBPACK_IMPORTED_MODULE_0__common_constants__["g" /* GROUP_SEPARATOR */]) > -1;
    if (formatOptions.hasGroup) {
        formatOptions.format = formatOptions.format.replace(commaRegExp, __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */]);
    }
}

function placeholderIndex(index1, index2, start) {
    var index;
    if (index1 === -1 && index2 !== -1) {
        index = index2;
    } else if (index1 !== -1 && index2 === -1) {
        index = index1;
    } else {
        index = start ? Math.min(index1, index2) : Math.max(index1, index2);
    }
    return index;
}

function setPlaceholderIndices(formatOptions) {
    var format = formatOptions.format;
    var sharpIndex = format.indexOf(SHARP);
    var zeroIndex = format.indexOf(ZERO);

    var start = placeholderIndex(sharpIndex, zeroIndex, true);

    sharpIndex = format.lastIndexOf(SHARP);
    zeroIndex = format.lastIndexOf(ZERO);

    var end = placeholderIndex(sharpIndex, zeroIndex);

    if (start === format.length) {
        end = start;
    }

    formatOptions.start = start;
    formatOptions.end = end;
    formatOptions.lastZeroIndex = zeroIndex;
}

function replaceStyleSymbols(number, style, symbol) {
    var result = number;
    if (style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["h" /* CURRENCY */] || style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["k" /* PERCENT */]) {
        result = __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */];
        for (var idx = 0, length = number.length; idx < length; idx++) {
            var ch = number.charAt(idx);
            result += (ch === __WEBPACK_IMPORTED_MODULE_0__common_constants__["c" /* CURRENCY_PLACEHOLDER */] || ch === __WEBPACK_IMPORTED_MODULE_0__common_constants__["m" /* PERCENT_PLACEHOLDER */]) ? symbol : ch;
        }
    }
    return result;
}

function replaceLiterals(number, literals) {
    var result = number;
    if (literals) {
        var length = literals.length;
        for (var idx = 0; idx < length; idx++) {
            result = result.replace(PLACEHOLDER, literals[idx]);
        }
    }
    return result;
}

function replacePlaceHolders(formatOptions, info) {
    var start = formatOptions.start;
    var end = formatOptions.end;
    var negative = formatOptions.negative;
    var format = formatOptions.format;
    var decimalIndex = formatOptions.decimalIndex;
    var lastZeroIndex = formatOptions.lastZeroIndex;
    var hasNegativeFormat = formatOptions.hasNegativeFormat;
    var hasGroup = formatOptions.hasGroup;
    var number = formatOptions.number;
    var value = number.toString().split(__WEBPACK_IMPORTED_MODULE_0__common_constants__["f" /* POINT */]);
    var length = format.length;
    var integer = value[0];
    var fraction = value[1] || __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */];
    var integerLength = integer.length;
    var replacement = __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */];

    number = format.substring(0, start);

    if (negative && !hasNegativeFormat) {
        number += "-";
    }

    for (var idx = start; idx < length; idx++) {
        var ch = format.charAt(idx);

        if (decimalIndex === -1) {
            if (end - idx < integerLength) {

                number += integer;
                break;
            }
        } else {
            if (lastZeroIndex !== -1 && lastZeroIndex < idx) {
                replacement = __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */];
            }

            if ((decimalIndex - idx) <= integerLength && decimalIndex - idx > -1) {
                number += integer;
                idx = decimalIndex;
            }

            if (decimalIndex === idx) {
                number += (fraction ? info.numbers.symbols.decimal : __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */]) + fraction;
                idx += end - decimalIndex + 1;
                continue;
            }
        }

        if (ch === ZERO) {
            number += ch;
            replacement = ch;
        } else if (ch === SHARP) {
            number += replacement;
        }
    }

    if (hasGroup) {
        number = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__group_integer__["a" /* default */])(number, start + (negative && !hasNegativeFormat ? 1 : 0), Math.max(end, (integerLength + start)), info.numbers.decimal, info);
    }

    if (end >= start) {
        number += format.substring(end + 1);
    }

    return number;
}

function applyCustomFormat(formatOptions, info) {
    var number = formatOptions.number;
    if (formatOptions.start !== -1) {
        number = replacePlaceHolders(formatOptions, info);
        number = replaceStyleSymbols(number, formatOptions.style, formatOptions.symbol);
        number = replaceLiterals(number, formatOptions.literals);
    }

    return number;
}

function customNumberFormat(number, format, info) {
    var formatOptions = {
        negative: number < 0,
        number: Math.abs(number),
        format: format
    };

    setValueSpecificFormat(formatOptions);

    if (formatOptions.constant) {
        return formatOptions.constant;
    }

    setFormatLiterals(formatOptions);
    setStyleOptions(formatOptions, info);
    setGroupOptions(formatOptions);
    roundNumber(formatOptions);
    setPlaceholderIndices(formatOptions);

    return applyCustomFormat(formatOptions, info);
}
//# sourceMappingURL=custom-number-format.js.map


/***/ }),
/* 780 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatNumber;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cldr__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__standard_number_format__ = __webpack_require__(782);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__custom_number_format__ = __webpack_require__(779);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__format_options__ = __webpack_require__(482);






function formatNumber(number, format, locale) {
    if ( format === void 0 ) format = __WEBPACK_IMPORTED_MODULE_1__common_constants__["d" /* NUMBER_PLACEHOLDER */];
    if ( locale === void 0 ) locale = __WEBPACK_IMPORTED_MODULE_1__common_constants__["b" /* DEFAULT_LOCALE */];

    if (number === undefined || number === null) {
        return __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */];
    }

    if (!isFinite(number)) {
        return String(number);
    }

    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["g" /* localeInfo */])(locale);
    var options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_options__["a" /* default */])(format);

    var result;
    if (options) {
        var style = (options || {}).style || __WEBPACK_IMPORTED_MODULE_1__common_constants__["i" /* DECIMAL */];
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__standard_number_format__["a" /* default */])(number, Object.assign({}, info.numbers[style], options), info);
    } else {
        result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__custom_number_format__["a" /* default */])(number, format, info);
    }

    return result;
}

//# sourceMappingURL=format-number.js.map


/***/ }),
/* 781 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = parseNumber;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cldr__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__common_is_number__ = __webpack_require__(236);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_currency_style__ = __webpack_require__(484);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__format_options__ = __webpack_require__(482);






var exponentRegExp = /[eE][\-+]?[0-9]+/;
var nonBreakingSpaceRegExp = /\u00A0/g;

function cleanNegativePattern(number, patterns) {
    if (patterns.length > 1) {
        var parts = (patterns[1] || __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]).replace(__WEBPACK_IMPORTED_MODULE_1__common_constants__["c" /* CURRENCY_PLACEHOLDER */], __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]).split(__WEBPACK_IMPORTED_MODULE_1__common_constants__["d" /* NUMBER_PLACEHOLDER */]);
        if (number.indexOf(parts[0]) > -1 && number.indexOf(parts[1]) > -1) {
            return number.replace(parts[0], __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]).replace(parts[1], __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]);
        }
    }
}

function cleanCurrencyNumber(value, info, format) {
    var options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__format_options__["a" /* default */])(format) || {};
    var isCurrency = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__is_currency_style__["a" /* default */])(options.style);
    var number = value;
    var negative;

    var currency = options.currency || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["h" /* localeCurrency */])(info, isCurrency);

    if (currency) {
        var displays = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["i" /* currencyDisplays */])(info, currency, isCurrency);
        if (displays) {
            for (var idx = 0; idx < displays.length; idx++) {
                var display = displays[idx];
                if (number.includes(display)) {
                    number = number.replace(display, __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]);
                    isCurrency = true;
                    break;
                }
            }
        }

        if (isCurrency) {
            var cleanNumber = cleanNegativePattern(number, info.numbers.currency.patterns) ||
                cleanNegativePattern(number, info.numbers.accounting.patterns);

            if (cleanNumber) {
                negative = true;
                number = cleanNumber;
            }

        }
    }

    return {
        number: number,
        negative: negative
    };
}

function parseNumber(value, locale, format) {
    if ( locale === void 0 ) locale = __WEBPACK_IMPORTED_MODULE_1__common_constants__["b" /* DEFAULT_LOCALE */];
    if ( format === void 0 ) format = {};

    if (!value && value !== 0) {
        return null;
    }

    if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_is_number__["a" /* default */])(value)) {
        return value;
    }

    var info = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cldr__["g" /* localeInfo */])(locale);
    var symbols = info.numbers.symbols;

    var number = value.toString();
    var isPercent;

    if (exponentRegExp.test(number)) {
        number = parseFloat(number.replace(symbols.decimal, __WEBPACK_IMPORTED_MODULE_1__common_constants__["f" /* POINT */]));
        return isNaN(number) ? null : number;
    }

    var negativeSignIndex = number.indexOf("-");
    if (negativeSignIndex > 0) {
        return null;
    }

    var isNegative = negativeSignIndex > -1;
    var ref = cleanCurrencyNumber(number, info, format);
    var negativeCurrency = ref.negative;
    var newNumber = ref.number;

    number = newNumber;
    isNegative = negativeCurrency !== undefined ? negativeCurrency : isNegative;

    if (format.style === __WEBPACK_IMPORTED_MODULE_1__common_constants__["k" /* PERCENT */] || number.indexOf(symbols.percentSign) > -1) {
        number = number.replace(symbols.percentSign, __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */]);
        isPercent = true;
    }

    number = number.replace("-", __WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */])
          .replace(nonBreakingSpaceRegExp, " ")
          .split(symbols.group.replace(nonBreakingSpaceRegExp, " ")).join(__WEBPACK_IMPORTED_MODULE_1__common_constants__["a" /* EMPTY */])
          .replace(symbols.decimal, __WEBPACK_IMPORTED_MODULE_1__common_constants__["f" /* POINT */]);

    number = parseFloat(number);

    if (isNaN(number)) {
        number = null;
    } else if (isNegative) {
        number *= -1;
    }

    if (number && isPercent) {
        number /= 100;
    }

    return number;
}

//# sourceMappingURL=parse-number.js.map


/***/ }),
/* 782 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = standardNumberFormat;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_constants__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__format_currency_symbol__ = __webpack_require__(481);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_integer__ = __webpack_require__(483);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_currency_style__ = __webpack_require__(484);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__common_pad__ = __webpack_require__(475);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__common_round__ = __webpack_require__(238);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__cldr__ = __webpack_require__(46);








var DEFAULT_DECIMAL_ROUNDING = 3;
var DEFAULT_PERCENT_ROUNDING = 0;

var trailingZeroRegex = /0+$/;

function fractionOptions(options) {
    var minimumFractionDigits = options.minimumFractionDigits;
    var maximumFractionDigits = options.maximumFractionDigits;
    var style = options.style;
    var isCurrency = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__is_currency_style__["a" /* default */])(style);
    var currencyFractions;
    if (isCurrency) {
        currencyFractions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__cldr__["k" /* currencyFractionOptions */])(options.currency);
    }

    if (minimumFractionDigits === undefined) {
        minimumFractionDigits = isCurrency ? currencyFractions.minimumFractionDigits : 0;
    }

    if (maximumFractionDigits === undefined) {
        if (style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["k" /* PERCENT */]) {
            maximumFractionDigits = Math.max(minimumFractionDigits, DEFAULT_PERCENT_ROUNDING);
        } else if (isCurrency) {
            maximumFractionDigits = Math.max(minimumFractionDigits, currencyFractions.maximumFractionDigits);
        } else {
            maximumFractionDigits = Math.max(minimumFractionDigits, DEFAULT_DECIMAL_ROUNDING);
        }
    }

    return {
        minimumFractionDigits: minimumFractionDigits,
        maximumFractionDigits: maximumFractionDigits
    };
}

function applyPattern(value, pattern, symbol) {
    var result = __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */];
    for (var idx = 0, length = pattern.length; idx < length; idx++) {
        var ch = pattern.charAt(idx);

        if (ch === __WEBPACK_IMPORTED_MODULE_0__common_constants__["d" /* NUMBER_PLACEHOLDER */]) {
            result += value;
        } else if (ch === __WEBPACK_IMPORTED_MODULE_0__common_constants__["c" /* CURRENCY_PLACEHOLDER */] || ch === __WEBPACK_IMPORTED_MODULE_0__common_constants__["m" /* PERCENT_PLACEHOLDER */]) {
            result += symbol;
        } else {
            result += ch;
        }
    }
    return result;
}

function currencyUnitPattern(info, value) {
    var currencyInfo = info.numbers.currency;
    var pattern = value !== 1 ? currencyInfo["unitPattern-count-other"] : currencyInfo["unitPattern-count-one"];
    if (value < 0) {
        pattern = pattern.replace(__WEBPACK_IMPORTED_MODULE_0__common_constants__["d" /* NUMBER_PLACEHOLDER */], ("-" + __WEBPACK_IMPORTED_MODULE_0__common_constants__["d" /* NUMBER_PLACEHOLDER */]));
    }

    return pattern;
}


function standardNumberFormat(number, options, info) {
    var symbols = info.numbers.symbols;
    var style = options.style;
    var isCurrency = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__is_currency_style__["a" /* default */])(style);

    //return number in exponential format
    if (style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["l" /* SCIENTIFIC */]) {
        var exponential = options.minimumFractionDigits !== undefined ? number.toExponential(options.minimumFractionDigits) : number.toExponential();
        return exponential.replace(__WEBPACK_IMPORTED_MODULE_0__common_constants__["f" /* POINT */], symbols.decimal);
    }

    var value = number;
    var symbol;

    if (isCurrency) {
        options.value = value;
        symbol = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__format_currency_symbol__["a" /* default */])(info, options);
    }

    if (style === __WEBPACK_IMPORTED_MODULE_0__common_constants__["k" /* PERCENT */]) {
        value *= 100;
        symbol = symbols.percentSign;
    }

    var ref = fractionOptions(options);
    var minimumFractionDigits = ref.minimumFractionDigits;
    var maximumFractionDigits = ref.maximumFractionDigits;

    value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_round__["a" /* default */])(value, maximumFractionDigits);

    var negative = value < 0;

    var parts = value.split(__WEBPACK_IMPORTED_MODULE_0__common_constants__["f" /* POINT */]);

    var integer = parts[0];
    var fraction = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_pad__["a" /* default */])(parts[1] ? parts[1].replace(trailingZeroRegex, __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */]) : __WEBPACK_IMPORTED_MODULE_0__common_constants__["a" /* EMPTY */], minimumFractionDigits, true);

    //exclude "-" if number is negative.
    if (negative) {
        integer = integer.substring(1);
    }

    if (options.minimumIntegerDigits) {
        integer = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_pad__["a" /* default */])(integer, options.minimumIntegerDigits);
    }

    var formattedValue = options.useGrouping !== false ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__group_integer__["a" /* default */])(integer, 0, integer.length, options, info) : integer;

    if (fraction) {
        formattedValue += symbols.decimal + fraction;
    }

    var pattern;

    if (isCurrency && options.currencyDisplay === "name") {
        pattern = currencyUnitPattern(info, number);
    } else {
        var patterns = options.patterns;
        pattern = negative ? patterns[1] || ("-" + patterns[0]) : patterns[0];
    }

    if (pattern === __WEBPACK_IMPORTED_MODULE_0__common_constants__["d" /* NUMBER_PLACEHOLDER */] && !negative) {
        return formattedValue;
    }

    var result = applyPattern(formattedValue, pattern, symbol);

    return result;
}
//# sourceMappingURL=standard-number-format.js.map


/***/ }),
/* 783 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = ansiHTML

// Reference to https://github.com/sindresorhus/ansi-regex
var _regANSI = /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/

var _defColors = {
  reset: ['fff', '000'], // [FOREGROUD_COLOR, BACKGROUND_COLOR]
  black: '000',
  red: 'ff0000',
  green: '209805',
  yellow: 'e8bf03',
  blue: '0000ff',
  magenta: 'ff00ff',
  cyan: '00ffee',
  lightgrey: 'f0f0f0',
  darkgrey: '888'
}
var _styles = {
  30: 'black',
  31: 'red',
  32: 'green',
  33: 'yellow',
  34: 'blue',
  35: 'magenta',
  36: 'cyan',
  37: 'lightgrey'
}
var _openTags = {
  '1': 'font-weight:bold', // bold
  '2': 'opacity:0.5', // dim
  '3': '<i>', // italic
  '4': '<u>', // underscore
  '8': 'display:none', // hidden
  '9': '<del>' // delete
}
var _closeTags = {
  '23': '</i>', // reset italic
  '24': '</u>', // reset underscore
  '29': '</del>' // reset delete
}

;[0, 21, 22, 27, 28, 39, 49].forEach(function (n) {
  _closeTags[n] = '</span>'
})

/**
 * Converts text with ANSI color codes to HTML markup.
 * @param {String} text
 * @returns {*}
 */
function ansiHTML (text) {
  // Returns the text if the string has no ANSI escape code.
  if (!_regANSI.test(text)) {
    return text
  }

  // Cache opened sequence.
  var ansiCodes = []
  // Replace with markup.
  var ret = text.replace(/\033\[(\d+)*m/g, function (match, seq) {
    var ot = _openTags[seq]
    if (ot) {
      // If current sequence has been opened, close it.
      if (!!~ansiCodes.indexOf(seq)) { // eslint-disable-line no-extra-boolean-cast
        ansiCodes.pop()
        return '</span>'
      }
      // Open tag.
      ansiCodes.push(seq)
      return ot[0] === '<' ? ot : '<span style="' + ot + ';">'
    }

    var ct = _closeTags[seq]
    if (ct) {
      // Pop sequence
      ansiCodes.pop()
      return ct
    }
    return ''
  })

  // Make sure tags are closed.
  var l = ansiCodes.length
  ;(l > 0) && (ret += Array(l + 1).join('</span>'))

  return ret
}

/**
 * Customize colors.
 * @param {Object} colors reference to _defColors
 */
ansiHTML.setColors = function (colors) {
  if (typeof colors !== 'object') {
    throw new Error('`colors` parameter must be an Object.')
  }

  var _finalColors = {}
  for (var key in _defColors) {
    var hex = colors.hasOwnProperty(key) ? colors[key] : null
    if (!hex) {
      _finalColors[key] = _defColors[key]
      continue
    }
    if ('reset' === key) {
      if (typeof hex === 'string') {
        hex = [hex]
      }
      if (!Array.isArray(hex) || hex.length === 0 || hex.some(function (h) {
        return typeof h !== 'string'
      })) {
        throw new Error('The value of `' + key + '` property must be an Array and each item could only be a hex string, e.g.: FF0000')
      }
      var defHexColor = _defColors[key]
      if (!hex[0]) {
        hex[0] = defHexColor[0]
      }
      if (hex.length === 1 || !hex[1]) {
        hex = [hex[0]]
        hex.push(defHexColor[1])
      }

      hex = hex.slice(0, 2)
    } else if (typeof hex !== 'string') {
      throw new Error('The value of `' + key + '` property must be a hex string, e.g.: FF0000')
    }
    _finalColors[key] = hex
  }
  _setTags(_finalColors)
}

/**
 * Reset colors.
 */
ansiHTML.reset = function () {
  _setTags(_defColors)
}

/**
 * Expose tags, including open and close.
 * @type {Object}
 */
ansiHTML.tags = {}

if (Object.defineProperty) {
  Object.defineProperty(ansiHTML.tags, 'open', {
    get: function () { return _openTags }
  })
  Object.defineProperty(ansiHTML.tags, 'close', {
    get: function () { return _closeTags }
  })
} else {
  ansiHTML.tags.open = _openTags
  ansiHTML.tags.close = _closeTags
}

function _setTags (colors) {
  // reset all
  _openTags['0'] = 'font-weight:normal;opacity:1;color:#' + colors.reset[0] + ';background:#' + colors.reset[1]
  // inverse
  _openTags['7'] = 'color:#' + colors.reset[1] + ';background:#' + colors.reset[0]
  // dark grey
  _openTags['90'] = 'color:#' + colors.darkgrey

  for (var code in _styles) {
    var color = _styles[code]
    var oriColor = colors[color] || '000'
    _openTags[code] = 'color:#' + oriColor
    code = parseInt(code)
    _openTags[(code + 10).toString()] = 'background:#' + oriColor
  }
}

ansiHTML.reset()


/***/ }),
/* 784 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

module.exports = function () {
	return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
};


/***/ }),
/* 785 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
/* unused harmony export getBaseUrl */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__ = __webpack_require__(251);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_shared_module__ = __webpack_require__(786);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_app_app_component__ = __webpack_require__(485);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




var AppModule = (function () {
    function AppModule() {
    }
    AppModule = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            bootstrap: [__WEBPACK_IMPORTED_MODULE_3__components_app_app_component__["a" /* AppComponent */]],
            imports: [
                __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__["BrowserModule"],
                __WEBPACK_IMPORTED_MODULE_2__app_shared_module__["a" /* AppModuleShared */]
            ],
            providers: [
                { provide: 'BASE_URL', useFactory: getBaseUrl }
            ]
        })
    ], AppModule);
    return AppModule;
}());

function getBaseUrl() {
    return document.getElementsByTagName('base')[0].href;
}


/***/ }),
/* 786 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModuleShared; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__ = __webpack_require__(251);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser_animations__ = __webpack_require__(533);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_dateinputs__ = __webpack_require__(160);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_common__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_forms__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__angular_http__ = __webpack_require__(250);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__angular_router__ = __webpack_require__(1052);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_grid__ = __webpack_require__(595);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_app_app_component__ = __webpack_require__(485);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_navmenu_navmenu_component__ = __webpack_require__(790);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_home_home_component__ = __webpack_require__(789);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__components_fetchdata_fetchdata_component__ = __webpack_require__(788);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__components_fetchdata_fetchdata_service__ = __webpack_require__(486);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__components_counter_counter_component__ = __webpack_require__(787);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
















var AppModuleShared = (function () {
    function AppModuleShared() {
    }
    AppModuleShared = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_10__components_app_app_component__["a" /* AppComponent */],
                __WEBPACK_IMPORTED_MODULE_11__components_navmenu_navmenu_component__["a" /* NavMenuComponent */],
                __WEBPACK_IMPORTED_MODULE_15__components_counter_counter_component__["a" /* CounterComponent */],
                __WEBPACK_IMPORTED_MODULE_13__components_fetchdata_fetchdata_component__["a" /* FetchDataComponent */],
                __WEBPACK_IMPORTED_MODULE_12__components_home_home_component__["a" /* HomeComponent */]
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser_animations__["a" /* BrowserAnimationsModule */],
                __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__["BrowserModule"],
                __WEBPACK_IMPORTED_MODULE_5__angular_common__["CommonModule"],
                __WEBPACK_IMPORTED_MODULE_4__progress_kendo_angular_dateinputs__["a" /* DateInputsModule */],
                __WEBPACK_IMPORTED_MODULE_6__angular_forms__["FormsModule"],
                __WEBPACK_IMPORTED_MODULE_9__progress_kendo_angular_grid__["a" /* GridModule */],
                __WEBPACK_IMPORTED_MODULE_7__angular_http__["HttpModule"],
                __WEBPACK_IMPORTED_MODULE_3__progress_kendo_angular_intl__["a" /* IntlModule */],
                __WEBPACK_IMPORTED_MODULE_8__angular_router__["RouterModule"].forRoot([
                    { path: '', redirectTo: 'home', pathMatch: 'full' },
                    { path: 'home', component: __WEBPACK_IMPORTED_MODULE_12__components_home_home_component__["a" /* HomeComponent */] },
                    { path: 'counter', component: __WEBPACK_IMPORTED_MODULE_15__components_counter_counter_component__["a" /* CounterComponent */] },
                    { path: 'fetch-data', component: __WEBPACK_IMPORTED_MODULE_13__components_fetchdata_fetchdata_component__["a" /* FetchDataComponent */] },
                    { path: '**', redirectTo: 'home' }
                ])
            ],
            providers: [
                __WEBPACK_IMPORTED_MODULE_14__components_fetchdata_fetchdata_service__["a" /* FetchDataService */]
            ]
        })
    ], AppModuleShared);
    return AppModuleShared;
}());



/***/ }),
/* 787 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CounterComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

var CounterComponent = (function () {
    function CounterComponent() {
        this.currentCount = 0;
    }
    CounterComponent.prototype.incrementCounter = function () {
        this.currentCount++;
    };
    CounterComponent = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'counter',
            template: __webpack_require__(799)
        })
    ], CounterComponent);
    return CounterComponent;
}());



/***/ }),
/* 788 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FetchDataComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__ = __webpack_require__(75);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_http__ = __webpack_require__(250);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fetchdata_service__ = __webpack_require__(486);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var FetchDataComponent = (function () {
    function FetchDataComponent(http, fetchDataService) {
        this.http = http;
        this.fetchDataService = fetchDataService;
        this.gridState = {
            sort: [],
            skip: 0,
            take: 10
        };
    }
    FetchDataComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.view = this.fetchDataService.map(function (data) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["a" /* process */])(data, _this.gridState); });
        this.fetchDataService.read();
    };
    FetchDataComponent.prototype.updateFromParent = function () {
        var _this = this;
        this.view = this.fetchDataService.map(function (data) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__progress_kendo_data_query__["a" /* process */])(data, _this.gridState); });
        this.fetchDataService.read();
    };
    FetchDataComponent.prototype.onStateChange = function (state) {
        this.gridState = state;
        this.fetchDataService.read();
    };
    FetchDataComponent = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'fetch-data',
            template: __webpack_require__(800)
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__angular_http__["Http"],
            __WEBPACK_IMPORTED_MODULE_3__fetchdata_service__["a" /* FetchDataService */]])
    ], FetchDataComponent);
    return FetchDataComponent;
}());



/***/ }),
/* 789 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HomeComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

var HomeComponent = (function () {
    function HomeComponent() {
    }
    HomeComponent = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'home',
            template: __webpack_require__(801)
        })
    ], HomeComponent);
    return HomeComponent;
}());



/***/ }),
/* 790 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavMenuComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

var NavMenuComponent = (function () {
    function NavMenuComponent() {
    }
    NavMenuComponent = __decorate([
        __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'nav-menu',
            template: __webpack_require__(802),
            styles: [__webpack_require__(1042)]
        })
    ], NavMenuComponent);
    return NavMenuComponent;
}());



/***/ }),
/* 791 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray

var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array

var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
  lookup[i] = code[i]
  revLookup[code.charCodeAt(i)] = i
}

revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63

function placeHoldersCount (b64) {
  var len = b64.length
  if (len % 4 > 0) {
    throw new Error('Invalid string. Length must be a multiple of 4')
  }

  // the number of equal signs (place holders)
  // if there are two placeholders, than the two characters before it
  // represent one byte
  // if there is only one, then the three characters before it represent 2 bytes
  // this is just a cheap hack to not do indexOf twice
  return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
}

function byteLength (b64) {
  // base64 is 4/3 + up to two characters of the original data
  return (b64.length * 3 / 4) - placeHoldersCount(b64)
}

function toByteArray (b64) {
  var i, l, tmp, placeHolders, arr
  var len = b64.length
  placeHolders = placeHoldersCount(b64)

  arr = new Arr((len * 3 / 4) - placeHolders)

  // if there are placeholders, only get up to the last complete 4 chars
  l = placeHolders > 0 ? len - 4 : len

  var L = 0

  for (i = 0; i < l; i += 4) {
    tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
    arr[L++] = (tmp >> 16) & 0xFF
    arr[L++] = (tmp >> 8) & 0xFF
    arr[L++] = tmp & 0xFF
  }

  if (placeHolders === 2) {
    tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
    arr[L++] = tmp & 0xFF
  } else if (placeHolders === 1) {
    tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
    arr[L++] = (tmp >> 8) & 0xFF
    arr[L++] = tmp & 0xFF
  }

  return arr
}

function tripletToBase64 (num) {
  return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
}

function encodeChunk (uint8, start, end) {
  var tmp
  var output = []
  for (var i = start; i < end; i += 3) {
    tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
    output.push(tripletToBase64(tmp))
  }
  return output.join('')
}

function fromByteArray (uint8) {
  var tmp
  var len = uint8.length
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  var output = ''
  var parts = []
  var maxChunkLength = 16383 // must be multiple of 3

  // go through the array every three bytes, we'll deal with trailing stuff later
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  }

  // pad the end with zeros, but make sure to not forget the extra bytes
  if (extraBytes === 1) {
    tmp = uint8[len - 1]
    output += lookup[tmp >> 2]
    output += lookup[(tmp << 4) & 0x3F]
    output += '=='
  } else if (extraBytes === 2) {
    tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
    output += lookup[tmp >> 10]
    output += lookup[(tmp >> 4) & 0x3F]
    output += lookup[(tmp << 2) & 0x3F]
    output += '='
  }

  parts.push(output)

  return parts.join('')
}


/***/ }),
/* 792 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
/* eslint-disable no-proto */



var base64 = __webpack_require__(791)
var ieee754 = __webpack_require__(803)
var isArray = __webpack_require__(804)

exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50

/**
 * If `Buffer.TYPED_ARRAY_SUPPORT`:
 *   === true    Use Uint8Array implementation (fastest)
 *   === false   Use Object implementation (most compatible, even IE6)
 *
 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
 * Opera 11.6+, iOS 4.2+.
 *
 * Due to various browser bugs, sometimes the Object implementation will be used even
 * when the browser supports typed arrays.
 *
 * Note:
 *
 *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
 *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
 *
 *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
 *
 *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
 *     incorrect length in some situations.

 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
 * get the Object implementation, which is slower but behaves correctly.
 */
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  ? global.TYPED_ARRAY_SUPPORT
  : typedArraySupport()

/*
 * Export kMaxLength after typed array support is determined.
 */
exports.kMaxLength = kMaxLength()

function typedArraySupport () {
  try {
    var arr = new Uint8Array(1)
    arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
    return arr.foo() === 42 && // typed array instances can be augmented
        typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
        arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  } catch (e) {
    return false
  }
}

function kMaxLength () {
  return Buffer.TYPED_ARRAY_SUPPORT
    ? 0x7fffffff
    : 0x3fffffff
}

function createBuffer (that, length) {
  if (kMaxLength() < length) {
    throw new RangeError('Invalid typed array length')
  }
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    // Return an augmented `Uint8Array` instance, for best performance
    that = new Uint8Array(length)
    that.__proto__ = Buffer.prototype
  } else {
    // Fallback: Return an object instance of the Buffer class
    if (that === null) {
      that = new Buffer(length)
    }
    that.length = length
  }

  return that
}

/**
 * The Buffer constructor returns instances of `Uint8Array` that have their
 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
 * returns a single octet.
 *
 * The `Uint8Array` prototype remains unmodified.
 */

function Buffer (arg, encodingOrOffset, length) {
  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
    return new Buffer(arg, encodingOrOffset, length)
  }

  // Common case.
  if (typeof arg === 'number') {
    if (typeof encodingOrOffset === 'string') {
      throw new Error(
        'If encoding is specified then the first argument must be a string'
      )
    }
    return allocUnsafe(this, arg)
  }
  return from(this, arg, encodingOrOffset, length)
}

Buffer.poolSize = 8192 // not used by this implementation

// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
  arr.__proto__ = Buffer.prototype
  return arr
}

function from (that, value, encodingOrOffset, length) {
  if (typeof value === 'number') {
    throw new TypeError('"value" argument must not be a number')
  }

  if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
    return fromArrayBuffer(that, value, encodingOrOffset, length)
  }

  if (typeof value === 'string') {
    return fromString(that, value, encodingOrOffset)
  }

  return fromObject(that, value)
}

/**
 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
 * if value is a number.
 * Buffer.from(str[, encoding])
 * Buffer.from(array)
 * Buffer.from(buffer)
 * Buffer.from(arrayBuffer[, byteOffset[, length]])
 **/
Buffer.from = function (value, encodingOrOffset, length) {
  return from(null, value, encodingOrOffset, length)
}

if (Buffer.TYPED_ARRAY_SUPPORT) {
  Buffer.prototype.__proto__ = Uint8Array.prototype
  Buffer.__proto__ = Uint8Array
  if (typeof Symbol !== 'undefined' && Symbol.species &&
      Buffer[Symbol.species] === Buffer) {
    // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
    Object.defineProperty(Buffer, Symbol.species, {
      value: null,
      configurable: true
    })
  }
}

function assertSize (size) {
  if (typeof size !== 'number') {
    throw new TypeError('"size" argument must be a number')
  } else if (size < 0) {
    throw new RangeError('"size" argument must not be negative')
  }
}

function alloc (that, size, fill, encoding) {
  assertSize(size)
  if (size <= 0) {
    return createBuffer(that, size)
  }
  if (fill !== undefined) {
    // Only pay attention to encoding if it's a string. This
    // prevents accidentally sending in a number that would
    // be interpretted as a start offset.
    return typeof encoding === 'string'
      ? createBuffer(that, size).fill(fill, encoding)
      : createBuffer(that, size).fill(fill)
  }
  return createBuffer(that, size)
}

/**
 * Creates a new filled Buffer instance.
 * alloc(size[, fill[, encoding]])
 **/
Buffer.alloc = function (size, fill, encoding) {
  return alloc(null, size, fill, encoding)
}

function allocUnsafe (that, size) {
  assertSize(size)
  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  if (!Buffer.TYPED_ARRAY_SUPPORT) {
    for (var i = 0; i < size; ++i) {
      that[i] = 0
    }
  }
  return that
}

/**
 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
 * */
Buffer.allocUnsafe = function (size) {
  return allocUnsafe(null, size)
}
/**
 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
 */
Buffer.allocUnsafeSlow = function (size) {
  return allocUnsafe(null, size)
}

function fromString (that, string, encoding) {
  if (typeof encoding !== 'string' || encoding === '') {
    encoding = 'utf8'
  }

  if (!Buffer.isEncoding(encoding)) {
    throw new TypeError('"encoding" must be a valid string encoding')
  }

  var length = byteLength(string, encoding) | 0
  that = createBuffer(that, length)

  var actual = that.write(string, encoding)

  if (actual !== length) {
    // Writing a hex string, for example, that contains invalid characters will
    // cause everything after the first invalid character to be ignored. (e.g.
    // 'abxxcd' will be treated as 'ab')
    that = that.slice(0, actual)
  }

  return that
}

function fromArrayLike (that, array) {
  var length = array.length < 0 ? 0 : checked(array.length) | 0
  that = createBuffer(that, length)
  for (var i = 0; i < length; i += 1) {
    that[i] = array[i] & 255
  }
  return that
}

function fromArrayBuffer (that, array, byteOffset, length) {
  array.byteLength // this throws if `array` is not a valid ArrayBuffer

  if (byteOffset < 0 || array.byteLength < byteOffset) {
    throw new RangeError('\'offset\' is out of bounds')
  }

  if (array.byteLength < byteOffset + (length || 0)) {
    throw new RangeError('\'length\' is out of bounds')
  }

  if (byteOffset === undefined && length === undefined) {
    array = new Uint8Array(array)
  } else if (length === undefined) {
    array = new Uint8Array(array, byteOffset)
  } else {
    array = new Uint8Array(array, byteOffset, length)
  }

  if (Buffer.TYPED_ARRAY_SUPPORT) {
    // Return an augmented `Uint8Array` instance, for best performance
    that = array
    that.__proto__ = Buffer.prototype
  } else {
    // Fallback: Return an object instance of the Buffer class
    that = fromArrayLike(that, array)
  }
  return that
}

function fromObject (that, obj) {
  if (Buffer.isBuffer(obj)) {
    var len = checked(obj.length) | 0
    that = createBuffer(that, len)

    if (that.length === 0) {
      return that
    }

    obj.copy(that, 0, 0, len)
    return that
  }

  if (obj) {
    if ((typeof ArrayBuffer !== 'undefined' &&
        obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
      if (typeof obj.length !== 'number' || isnan(obj.length)) {
        return createBuffer(that, 0)
      }
      return fromArrayLike(that, obj)
    }

    if (obj.type === 'Buffer' && isArray(obj.data)) {
      return fromArrayLike(that, obj.data)
    }
  }

  throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}

function checked (length) {
  // Note: cannot use `length < kMaxLength()` here because that fails when
  // length is NaN (which is otherwise coerced to zero.)
  if (length >= kMaxLength()) {
    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                         'size: 0x' + kMaxLength().toString(16) + ' bytes')
  }
  return length | 0
}

function SlowBuffer (length) {
  if (+length != length) { // eslint-disable-line eqeqeq
    length = 0
  }
  return Buffer.alloc(+length)
}

Buffer.isBuffer = function isBuffer (b) {
  return !!(b != null && b._isBuffer)
}

Buffer.compare = function compare (a, b) {
  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
    throw new TypeError('Arguments must be Buffers')
  }

  if (a === b) return 0

  var x = a.length
  var y = b.length

  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
    if (a[i] !== b[i]) {
      x = a[i]
      y = b[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

Buffer.isEncoding = function isEncoding (encoding) {
  switch (String(encoding).toLowerCase()) {
    case 'hex':
    case 'utf8':
    case 'utf-8':
    case 'ascii':
    case 'latin1':
    case 'binary':
    case 'base64':
    case 'ucs2':
    case 'ucs-2':
    case 'utf16le':
    case 'utf-16le':
      return true
    default:
      return false
  }
}

Buffer.concat = function concat (list, length) {
  if (!isArray(list)) {
    throw new TypeError('"list" argument must be an Array of Buffers')
  }

  if (list.length === 0) {
    return Buffer.alloc(0)
  }

  var i
  if (length === undefined) {
    length = 0
    for (i = 0; i < list.length; ++i) {
      length += list[i].length
    }
  }

  var buffer = Buffer.allocUnsafe(length)
  var pos = 0
  for (i = 0; i < list.length; ++i) {
    var buf = list[i]
    if (!Buffer.isBuffer(buf)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    }
    buf.copy(buffer, pos)
    pos += buf.length
  }
  return buffer
}

function byteLength (string, encoding) {
  if (Buffer.isBuffer(string)) {
    return string.length
  }
  if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
    return string.byteLength
  }
  if (typeof string !== 'string') {
    string = '' + string
  }

  var len = string.length
  if (len === 0) return 0

  // Use a for loop to avoid recursion
  var loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'ascii':
      case 'latin1':
      case 'binary':
        return len
      case 'utf8':
      case 'utf-8':
      case undefined:
        return utf8ToBytes(string).length
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return len * 2
      case 'hex':
        return len >>> 1
      case 'base64':
        return base64ToBytes(string).length
      default:
        if (loweredCase) return utf8ToBytes(string).length // assume utf8
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}
Buffer.byteLength = byteLength

function slowToString (encoding, start, end) {
  var loweredCase = false

  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  // property of a typed array.

  // This behaves neither like String nor Uint8Array in that we set start/end
  // to their upper/lower bounds if the value passed is out of range.
  // undefined is handled specially as per ECMA-262 6th Edition,
  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  if (start === undefined || start < 0) {
    start = 0
  }
  // Return early if start > this.length. Done here to prevent potential uint32
  // coercion fail below.
  if (start > this.length) {
    return ''
  }

  if (end === undefined || end > this.length) {
    end = this.length
  }

  if (end <= 0) {
    return ''
  }

  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  end >>>= 0
  start >>>= 0

  if (end <= start) {
    return ''
  }

  if (!encoding) encoding = 'utf8'

  while (true) {
    switch (encoding) {
      case 'hex':
        return hexSlice(this, start, end)

      case 'utf8':
      case 'utf-8':
        return utf8Slice(this, start, end)

      case 'ascii':
        return asciiSlice(this, start, end)

      case 'latin1':
      case 'binary':
        return latin1Slice(this, start, end)

      case 'base64':
        return base64Slice(this, start, end)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return utf16leSlice(this, start, end)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = (encoding + '').toLowerCase()
        loweredCase = true
    }
  }
}

// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true

function swap (b, n, m) {
  var i = b[n]
  b[n] = b[m]
  b[m] = i
}

Buffer.prototype.swap16 = function swap16 () {
  var len = this.length
  if (len % 2 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 16-bits')
  }
  for (var i = 0; i < len; i += 2) {
    swap(this, i, i + 1)
  }
  return this
}

Buffer.prototype.swap32 = function swap32 () {
  var len = this.length
  if (len % 4 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 32-bits')
  }
  for (var i = 0; i < len; i += 4) {
    swap(this, i, i + 3)
    swap(this, i + 1, i + 2)
  }
  return this
}

Buffer.prototype.swap64 = function swap64 () {
  var len = this.length
  if (len % 8 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 64-bits')
  }
  for (var i = 0; i < len; i += 8) {
    swap(this, i, i + 7)
    swap(this, i + 1, i + 6)
    swap(this, i + 2, i + 5)
    swap(this, i + 3, i + 4)
  }
  return this
}

Buffer.prototype.toString = function toString () {
  var length = this.length | 0
  if (length === 0) return ''
  if (arguments.length === 0) return utf8Slice(this, 0, length)
  return slowToString.apply(this, arguments)
}

Buffer.prototype.equals = function equals (b) {
  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  if (this === b) return true
  return Buffer.compare(this, b) === 0
}

Buffer.prototype.inspect = function inspect () {
  var str = ''
  var max = exports.INSPECT_MAX_BYTES
  if (this.length > 0) {
    str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
    if (this.length > max) str += ' ... '
  }
  return '<Buffer ' + str + '>'
}

Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  if (!Buffer.isBuffer(target)) {
    throw new TypeError('Argument must be a Buffer')
  }

  if (start === undefined) {
    start = 0
  }
  if (end === undefined) {
    end = target ? target.length : 0
  }
  if (thisStart === undefined) {
    thisStart = 0
  }
  if (thisEnd === undefined) {
    thisEnd = this.length
  }

  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
    throw new RangeError('out of range index')
  }

  if (thisStart >= thisEnd && start >= end) {
    return 0
  }
  if (thisStart >= thisEnd) {
    return -1
  }
  if (start >= end) {
    return 1
  }

  start >>>= 0
  end >>>= 0
  thisStart >>>= 0
  thisEnd >>>= 0

  if (this === target) return 0

  var x = thisEnd - thisStart
  var y = end - start
  var len = Math.min(x, y)

  var thisCopy = this.slice(thisStart, thisEnd)
  var targetCopy = target.slice(start, end)

  for (var i = 0; i < len; ++i) {
    if (thisCopy[i] !== targetCopy[i]) {
      x = thisCopy[i]
      y = targetCopy[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  // Empty buffer means no match
  if (buffer.length === 0) return -1

  // Normalize byteOffset
  if (typeof byteOffset === 'string') {
    encoding = byteOffset
    byteOffset = 0
  } else if (byteOffset > 0x7fffffff) {
    byteOffset = 0x7fffffff
  } else if (byteOffset < -0x80000000) {
    byteOffset = -0x80000000
  }
  byteOffset = +byteOffset  // Coerce to Number.
  if (isNaN(byteOffset)) {
    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
    byteOffset = dir ? 0 : (buffer.length - 1)
  }

  // Normalize byteOffset: negative offsets start from the end of the buffer
  if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  if (byteOffset >= buffer.length) {
    if (dir) return -1
    else byteOffset = buffer.length - 1
  } else if (byteOffset < 0) {
    if (dir) byteOffset = 0
    else return -1
  }

  // Normalize val
  if (typeof val === 'string') {
    val = Buffer.from(val, encoding)
  }

  // Finally, search either indexOf (if dir is true) or lastIndexOf
  if (Buffer.isBuffer(val)) {
    // Special case: looking for empty string/buffer always fails
    if (val.length === 0) {
      return -1
    }
    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  } else if (typeof val === 'number') {
    val = val & 0xFF // Search for a byte value [0-255]
    if (Buffer.TYPED_ARRAY_SUPPORT &&
        typeof Uint8Array.prototype.indexOf === 'function') {
      if (dir) {
        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
      } else {
        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
      }
    }
    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  }

  throw new TypeError('val must be string, number or Buffer')
}

function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  var indexSize = 1
  var arrLength = arr.length
  var valLength = val.length

  if (encoding !== undefined) {
    encoding = String(encoding).toLowerCase()
    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
        encoding === 'utf16le' || encoding === 'utf-16le') {
      if (arr.length < 2 || val.length < 2) {
        return -1
      }
      indexSize = 2
      arrLength /= 2
      valLength /= 2
      byteOffset /= 2
    }
  }

  function read (buf, i) {
    if (indexSize === 1) {
      return buf[i]
    } else {
      return buf.readUInt16BE(i * indexSize)
    }
  }

  var i
  if (dir) {
    var foundIndex = -1
    for (i = byteOffset; i < arrLength; i++) {
      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
        if (foundIndex === -1) foundIndex = i
        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
      } else {
        if (foundIndex !== -1) i -= i - foundIndex
        foundIndex = -1
      }
    }
  } else {
    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
    for (i = byteOffset; i >= 0; i--) {
      var found = true
      for (var j = 0; j < valLength; j++) {
        if (read(arr, i + j) !== read(val, j)) {
          found = false
          break
        }
      }
      if (found) return i
    }
  }

  return -1
}

Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  return this.indexOf(val, byteOffset, encoding) !== -1
}

Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}

Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}

function hexWrite (buf, string, offset, length) {
  offset = Number(offset) || 0
  var remaining = buf.length - offset
  if (!length) {
    length = remaining
  } else {
    length = Number(length)
    if (length > remaining) {
      length = remaining
    }
  }

  // must be an even number of digits
  var strLen = string.length
  if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')

  if (length > strLen / 2) {
    length = strLen / 2
  }
  for (var i = 0; i < length; ++i) {
    var parsed = parseInt(string.substr(i * 2, 2), 16)
    if (isNaN(parsed)) return i
    buf[offset + i] = parsed
  }
  return i
}

function utf8Write (buf, string, offset, length) {
  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}

function asciiWrite (buf, string, offset, length) {
  return blitBuffer(asciiToBytes(string), buf, offset, length)
}

function latin1Write (buf, string, offset, length) {
  return asciiWrite(buf, string, offset, length)
}

function base64Write (buf, string, offset, length) {
  return blitBuffer(base64ToBytes(string), buf, offset, length)
}

function ucs2Write (buf, string, offset, length) {
  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}

Buffer.prototype.write = function write (string, offset, length, encoding) {
  // Buffer#write(string)
  if (offset === undefined) {
    encoding = 'utf8'
    length = this.length
    offset = 0
  // Buffer#write(string, encoding)
  } else if (length === undefined && typeof offset === 'string') {
    encoding = offset
    length = this.length
    offset = 0
  // Buffer#write(string, offset[, length][, encoding])
  } else if (isFinite(offset)) {
    offset = offset | 0
    if (isFinite(length)) {
      length = length | 0
      if (encoding === undefined) encoding = 'utf8'
    } else {
      encoding = length
      length = undefined
    }
  // legacy write(string, encoding, offset, length) - remove in v0.13
  } else {
    throw new Error(
      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
    )
  }

  var remaining = this.length - offset
  if (length === undefined || length > remaining) length = remaining

  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
    throw new RangeError('Attempt to write outside buffer bounds')
  }

  if (!encoding) encoding = 'utf8'

  var loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'hex':
        return hexWrite(this, string, offset, length)

      case 'utf8':
      case 'utf-8':
        return utf8Write(this, string, offset, length)

      case 'ascii':
        return asciiWrite(this, string, offset, length)

      case 'latin1':
      case 'binary':
        return latin1Write(this, string, offset, length)

      case 'base64':
        // Warning: maxLength not taken into account in base64Write
        return base64Write(this, string, offset, length)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return ucs2Write(this, string, offset, length)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}

Buffer.prototype.toJSON = function toJSON () {
  return {
    type: 'Buffer',
    data: Array.prototype.slice.call(this._arr || this, 0)
  }
}

function base64Slice (buf, start, end) {
  if (start === 0 && end === buf.length) {
    return base64.fromByteArray(buf)
  } else {
    return base64.fromByteArray(buf.slice(start, end))
  }
}

function utf8Slice (buf, start, end) {
  end = Math.min(buf.length, end)
  var res = []

  var i = start
  while (i < end) {
    var firstByte = buf[i]
    var codePoint = null
    var bytesPerSequence = (firstByte > 0xEF) ? 4
      : (firstByte > 0xDF) ? 3
      : (firstByte > 0xBF) ? 2
      : 1

    if (i + bytesPerSequence <= end) {
      var secondByte, thirdByte, fourthByte, tempCodePoint

      switch (bytesPerSequence) {
        case 1:
          if (firstByte < 0x80) {
            codePoint = firstByte
          }
          break
        case 2:
          secondByte = buf[i + 1]
          if ((secondByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
            if (tempCodePoint > 0x7F) {
              codePoint = tempCodePoint
            }
          }
          break
        case 3:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
              codePoint = tempCodePoint
            }
          }
          break
        case 4:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          fourthByte = buf[i + 3]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
              codePoint = tempCodePoint
            }
          }
      }
    }

    if (codePoint === null) {
      // we did not generate a valid codePoint so insert a
      // replacement char (U+FFFD) and advance only 1 byte
      codePoint = 0xFFFD
      bytesPerSequence = 1
    } else if (codePoint > 0xFFFF) {
      // encode to utf16 (surrogate pair dance)
      codePoint -= 0x10000
      res.push(codePoint >>> 10 & 0x3FF | 0xD800)
      codePoint = 0xDC00 | codePoint & 0x3FF
    }

    res.push(codePoint)
    i += bytesPerSequence
  }

  return decodeCodePointsArray(res)
}

// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000

function decodeCodePointsArray (codePoints) {
  var len = codePoints.length
  if (len <= MAX_ARGUMENTS_LENGTH) {
    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  }

  // Decode in chunks to avoid "call stack size exceeded".
  var res = ''
  var i = 0
  while (i < len) {
    res += String.fromCharCode.apply(
      String,
      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
    )
  }
  return res
}

function asciiSlice (buf, start, end) {
  var ret = ''
  end = Math.min(buf.length, end)

  for (var i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i] & 0x7F)
  }
  return ret
}

function latin1Slice (buf, start, end) {
  var ret = ''
  end = Math.min(buf.length, end)

  for (var i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i])
  }
  return ret
}

function hexSlice (buf, start, end) {
  var len = buf.length

  if (!start || start < 0) start = 0
  if (!end || end < 0 || end > len) end = len

  var out = ''
  for (var i = start; i < end; ++i) {
    out += toHex(buf[i])
  }
  return out
}

function utf16leSlice (buf, start, end) {
  var bytes = buf.slice(start, end)
  var res = ''
  for (var i = 0; i < bytes.length; i += 2) {
    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  }
  return res
}

Buffer.prototype.slice = function slice (start, end) {
  var len = this.length
  start = ~~start
  end = end === undefined ? len : ~~end

  if (start < 0) {
    start += len
    if (start < 0) start = 0
  } else if (start > len) {
    start = len
  }

  if (end < 0) {
    end += len
    if (end < 0) end = 0
  } else if (end > len) {
    end = len
  }

  if (end < start) end = start

  var newBuf
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    newBuf = this.subarray(start, end)
    newBuf.__proto__ = Buffer.prototype
  } else {
    var sliceLen = end - start
    newBuf = new Buffer(sliceLen, undefined)
    for (var i = 0; i < sliceLen; ++i) {
      newBuf[i] = this[i + start]
    }
  }

  return newBuf
}

/*
 * Need to make sure that buffer isn't trying to write out of bounds.
 */
function checkOffset (offset, ext, length) {
  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}

Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  var val = this[offset]
  var mul = 1
  var i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }

  return val
}

Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) {
    checkOffset(offset, byteLength, this.length)
  }

  var val = this[offset + --byteLength]
  var mul = 1
  while (byteLength > 0 && (mul *= 0x100)) {
    val += this[offset + --byteLength] * mul
  }

  return val
}

Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 1, this.length)
  return this[offset]
}

Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  return this[offset] | (this[offset + 1] << 8)
}

Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  return (this[offset] << 8) | this[offset + 1]
}

Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return ((this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16)) +
      (this[offset + 3] * 0x1000000)
}

Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] * 0x1000000) +
    ((this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    this[offset + 3])
}

Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  var val = this[offset]
  var mul = 1
  var i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  var i = byteLength
  var mul = 1
  var val = this[offset + --i]
  while (i > 0 && (mul *= 0x100)) {
    val += this[offset + --i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 1, this.length)
  if (!(this[offset] & 0x80)) return (this[offset])
  return ((0xff - this[offset] + 1) * -1)
}

Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  var val = this[offset] | (this[offset + 1] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  var val = this[offset + 1] | (this[offset] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset]) |
    (this[offset + 1] << 8) |
    (this[offset + 2] << 16) |
    (this[offset + 3] << 24)
}

Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] << 24) |
    (this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    (this[offset + 3])
}

Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, true, 23, 4)
}

Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, false, 23, 4)
}

Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, true, 52, 8)
}

Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, false, 52, 8)
}

function checkInt (buf, value, offset, ext, max, min) {
  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
}

Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) {
    var maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  var mul = 1
  var i = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) {
    var maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  var i = byteLength - 1
  var mul = 1
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  this[offset] = (value & 0xff)
  return offset + 1
}

function objectWriteUInt16 (buf, value, offset, littleEndian) {
  if (value < 0) value = 0xffff + value + 1
  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
      (littleEndian ? i : 1 - i) * 8
  }
}

Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff)
    this[offset + 1] = (value >>> 8)
  } else {
    objectWriteUInt16(this, value, offset, true)
  }
  return offset + 2
}

Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 8)
    this[offset + 1] = (value & 0xff)
  } else {
    objectWriteUInt16(this, value, offset, false)
  }
  return offset + 2
}

function objectWriteUInt32 (buf, value, offset, littleEndian) {
  if (value < 0) value = 0xffffffff + value + 1
  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  }
}

Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset + 3] = (value >>> 24)
    this[offset + 2] = (value >>> 16)
    this[offset + 1] = (value >>> 8)
    this[offset] = (value & 0xff)
  } else {
    objectWriteUInt32(this, value, offset, true)
  }
  return offset + 4
}

Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 24)
    this[offset + 1] = (value >>> 16)
    this[offset + 2] = (value >>> 8)
    this[offset + 3] = (value & 0xff)
  } else {
    objectWriteUInt32(this, value, offset, false)
  }
  return offset + 4
}

Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  var i = 0
  var mul = 1
  var sub = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  var i = byteLength - 1
  var mul = 1
  var sub = 0
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  if (value < 0) value = 0xff + value + 1
  this[offset] = (value & 0xff)
  return offset + 1
}

Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff)
    this[offset + 1] = (value >>> 8)
  } else {
    objectWriteUInt16(this, value, offset, true)
  }
  return offset + 2
}

Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 8)
    this[offset + 1] = (value & 0xff)
  } else {
    objectWriteUInt16(this, value, offset, false)
  }
  return offset + 2
}

Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff)
    this[offset + 1] = (value >>> 8)
    this[offset + 2] = (value >>> 16)
    this[offset + 3] = (value >>> 24)
  } else {
    objectWriteUInt32(this, value, offset, true)
  }
  return offset + 4
}

Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  if (value < 0) value = 0xffffffff + value + 1
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 24)
    this[offset + 1] = (value >>> 16)
    this[offset + 2] = (value >>> 8)
    this[offset + 3] = (value & 0xff)
  } else {
    objectWriteUInt32(this, value, offset, false)
  }
  return offset + 4
}

function checkIEEE754 (buf, value, offset, ext, max, min) {
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
  if (offset < 0) throw new RangeError('Index out of range')
}

function writeFloat (buf, value, offset, littleEndian, noAssert) {
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  }
  ieee754.write(buf, value, offset, littleEndian, 23, 4)
  return offset + 4
}

Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  return writeFloat(this, value, offset, true, noAssert)
}

Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  return writeFloat(this, value, offset, false, noAssert)
}

function writeDouble (buf, value, offset, littleEndian, noAssert) {
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  }
  ieee754.write(buf, value, offset, littleEndian, 52, 8)
  return offset + 8
}

Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  return writeDouble(this, value, offset, true, noAssert)
}

Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  return writeDouble(this, value, offset, false, noAssert)
}

// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  if (!start) start = 0
  if (!end && end !== 0) end = this.length
  if (targetStart >= target.length) targetStart = target.length
  if (!targetStart) targetStart = 0
  if (end > 0 && end < start) end = start

  // Copy 0 bytes; we're done
  if (end === start) return 0
  if (target.length === 0 || this.length === 0) return 0

  // Fatal error conditions
  if (targetStart < 0) {
    throw new RangeError('targetStart out of bounds')
  }
  if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  if (end < 0) throw new RangeError('sourceEnd out of bounds')

  // Are we oob?
  if (end > this.length) end = this.length
  if (target.length - targetStart < end - start) {
    end = target.length - targetStart + start
  }

  var len = end - start
  var i

  if (this === target && start < targetStart && targetStart < end) {
    // descending copy from end
    for (i = len - 1; i >= 0; --i) {
      target[i + targetStart] = this[i + start]
    }
  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
    // ascending copy from start
    for (i = 0; i < len; ++i) {
      target[i + targetStart] = this[i + start]
    }
  } else {
    Uint8Array.prototype.set.call(
      target,
      this.subarray(start, start + len),
      targetStart
    )
  }

  return len
}

// Usage:
//    buffer.fill(number[, offset[, end]])
//    buffer.fill(buffer[, offset[, end]])
//    buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
  // Handle string cases:
  if (typeof val === 'string') {
    if (typeof start === 'string') {
      encoding = start
      start = 0
      end = this.length
    } else if (typeof end === 'string') {
      encoding = end
      end = this.length
    }
    if (val.length === 1) {
      var code = val.charCodeAt(0)
      if (code < 256) {
        val = code
      }
    }
    if (encoding !== undefined && typeof encoding !== 'string') {
      throw new TypeError('encoding must be a string')
    }
    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
      throw new TypeError('Unknown encoding: ' + encoding)
    }
  } else if (typeof val === 'number') {
    val = val & 255
  }

  // Invalid ranges are not set to a default, so can range check early.
  if (start < 0 || this.length < start || this.length < end) {
    throw new RangeError('Out of range index')
  }

  if (end <= start) {
    return this
  }

  start = start >>> 0
  end = end === undefined ? this.length : end >>> 0

  if (!val) val = 0

  var i
  if (typeof val === 'number') {
    for (i = start; i < end; ++i) {
      this[i] = val
    }
  } else {
    var bytes = Buffer.isBuffer(val)
      ? val
      : utf8ToBytes(new Buffer(val, encoding).toString())
    var len = bytes.length
    for (i = 0; i < end - start; ++i) {
      this[i + start] = bytes[i % len]
    }
  }

  return this
}

// HELPER FUNCTIONS
// ================

var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g

function base64clean (str) {
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
  str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  // Node converts strings with length < 2 to ''
  if (str.length < 2) return ''
  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  while (str.length % 4 !== 0) {
    str = str + '='
  }
  return str
}

function stringtrim (str) {
  if (str.trim) return str.trim()
  return str.replace(/^\s+|\s+$/g, '')
}

function toHex (n) {
  if (n < 16) return '0' + n.toString(16)
  return n.toString(16)
}

function utf8ToBytes (string, units) {
  units = units || Infinity
  var codePoint
  var length = string.length
  var leadSurrogate = null
  var bytes = []

  for (var i = 0; i < length; ++i) {
    codePoint = string.charCodeAt(i)

    // is surrogate component
    if (codePoint > 0xD7FF && codePoint < 0xE000) {
      // last char was a lead
      if (!leadSurrogate) {
        // no lead yet
        if (codePoint > 0xDBFF) {
          // unexpected trail
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        } else if (i + 1 === length) {
          // unpaired lead
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        }

        // valid lead
        leadSurrogate = codePoint

        continue
      }

      // 2 leads in a row
      if (codePoint < 0xDC00) {
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
        leadSurrogate = codePoint
        continue
      }

      // valid surrogate pair
      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
    } else if (leadSurrogate) {
      // valid bmp char, but last char was a lead
      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
    }

    leadSurrogate = null

    // encode utf8
    if (codePoint < 0x80) {
      if ((units -= 1) < 0) break
      bytes.push(codePoint)
    } else if (codePoint < 0x800) {
      if ((units -= 2) < 0) break
      bytes.push(
        codePoint >> 0x6 | 0xC0,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x10000) {
      if ((units -= 3) < 0) break
      bytes.push(
        codePoint >> 0xC | 0xE0,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x110000) {
      if ((units -= 4) < 0) break
      bytes.push(
        codePoint >> 0x12 | 0xF0,
        codePoint >> 0xC & 0x3F | 0x80,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else {
      throw new Error('Invalid code point')
    }
  }

  return bytes
}

function asciiToBytes (str) {
  var byteArray = []
  for (var i = 0; i < str.length; ++i) {
    // Node's code seems to be doing this and not & 0x7F..
    byteArray.push(str.charCodeAt(i) & 0xFF)
  }
  return byteArray
}

function utf16leToBytes (str, units) {
  var c, hi, lo
  var byteArray = []
  for (var i = 0; i < str.length; ++i) {
    if ((units -= 2) < 0) break

    c = str.charCodeAt(i)
    hi = c >> 8
    lo = c % 256
    byteArray.push(lo)
    byteArray.push(hi)
  }

  return byteArray
}

function base64ToBytes (str) {
  return base64.toByteArray(base64clean(str))
}

function blitBuffer (src, dst, offset, length) {
  for (var i = 0; i < length; ++i) {
    if ((i + offset >= dst.length) || (i >= src.length)) break
    dst[i + offset] = src[i]
  }
  return i
}

function isnan (val) {
  return val !== val // eslint-disable-line no-self-compare
}

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(152)))

/***/ }),
/* 793 */
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(487)(undefined);
// imports


// module
exports.push([module.i, "@media (max-width: 767px) {\r\n    /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */\r\n    .body-content {\r\n        padding-top: 50px;\r\n    }\r\n}\r\n", ""]);

// exports


/***/ }),
/* 794 */
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(487)(undefined);
// imports


// module
exports.push([module.i, "li .glyphicon {\r\n    margin-right: 10px;\r\n}\r\n\r\n/* Highlighting rules for nav menu items */\r\nli.link-active a,\r\nli.link-active a:hover,\r\nli.link-active a:focus {\r\n    background-color: #4189C7;\r\n    color: white;\r\n}\r\n\r\n/* Keep the nav menu independent of scrolling and on top of other items */\r\n.main-nav {\r\n    position: fixed;\r\n    top: 0;\r\n    left: 0;\r\n    right: 0;\r\n    z-index: 1;\r\n}\r\n\r\n@media (min-width: 768px) {\r\n    /* On small screens, convert the nav menu to a vertical sidebar */\r\n    .main-nav {\r\n        height: 100%;\r\n        width: calc(25% - 20px);\r\n    }\r\n    .navbar {\r\n        border-radius: 0px;\r\n        border-width: 0px;\r\n        height: 100%;\r\n    }\r\n    .navbar-header {\r\n        float: none;\r\n    }\r\n    .navbar-collapse {\r\n        border-top: 1px solid #444;\r\n        padding: 0px;\r\n    }\r\n    .navbar ul {\r\n        float: none;\r\n    }\r\n    .navbar li {\r\n        float: none;\r\n        font-size: 15px;\r\n        margin: 6px;\r\n    }\r\n    .navbar li a {\r\n        padding: 10px 16px;\r\n        border-radius: 4px;\r\n    }\r\n    .navbar a {\r\n        /* If a menu item's text is too long, truncate it */\r\n        width: 100%;\r\n        white-space: nowrap;\r\n        overflow: hidden;\r\n        text-overflow: ellipsis;\r\n    }\r\n}\r\n", ""]);

// exports


/***/ }),
/* 795 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = {
  XmlEntities: __webpack_require__(797),
  Html4Entities: __webpack_require__(796),
  Html5Entities: __webpack_require__(488),
  AllHtmlEntities: __webpack_require__(488)
};


/***/ }),
/* 796 */
/***/ (function(module, exports) {

var HTML_ALPHA = ['apos', 'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'Aelig', 'Ccedil', 'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml', 'quot', 'amp', 'lt', 'gt', 'OElig', 'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde', 'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm', 'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo', 'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil', 'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym', 'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime', 'oline', 'frasl', 'weierp', 'image', 'real', 'trade', 'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr', 'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr', 'forall', 'part', 'exist', 'empty', 'nabla', 'isin', 'notin', 'ni', 'prod', 'sum', 'minus', 'lowast', 'radic', 'prop', 'infin', 'ang', 'and', 'or', 'cap', 'cup', 'int', 'there4', 'sim', 'cong', 'asymp', 'ne', 'equiv', 'le', 'ge', 'sub', 'sup', 'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp', 'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang', 'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams'];
var HTML_CODES = [39, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 34, 38, 60, 62, 338, 339, 352, 353, 376, 710, 732, 8194, 8195, 8201, 8204, 8205, 8206, 8207, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8240, 8249, 8250, 8364, 402, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 977, 978, 982, 8226, 8230, 8242, 8243, 8254, 8260, 8472, 8465, 8476, 8482, 8501, 8592, 8593, 8594, 8595, 8596, 8629, 8656, 8657, 8658, 8659, 8660, 8704, 8706, 8707, 8709, 8711, 8712, 8713, 8715, 8719, 8721, 8722, 8727, 8730, 8733, 8734, 8736, 8743, 8744, 8745, 8746, 8747, 8756, 8764, 8773, 8776, 8800, 8801, 8804, 8805, 8834, 8835, 8836, 8838, 8839, 8853, 8855, 8869, 8901, 8968, 8969, 8970, 8971, 9001, 9002, 9674, 9824, 9827, 9829, 9830];

var alphaIndex = {};
var numIndex = {};

var i = 0;
var length = HTML_ALPHA.length;
while (i < length) {
    var a = HTML_ALPHA[i];
    var c = HTML_CODES[i];
    alphaIndex[a] = String.fromCharCode(c);
    numIndex[c] = a;
    i++;
}

/**
 * @constructor
 */
function Html4Entities() {}

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.prototype.decode = function(str) {
    if (!str || !str.length) {
        return '';
    }
    return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) {
        var chr;
        if (entity.charAt(0) === "#") {
            var code = entity.charAt(1).toLowerCase() === 'x' ?
                parseInt(entity.substr(2), 16) :
                parseInt(entity.substr(1));

            if (!(isNaN(code) || code < -32768 || code > 65535)) {
                chr = String.fromCharCode(code);
            }
        } else {
            chr = alphaIndex[entity];
        }
        return chr || s;
    });
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.decode = function(str) {
    return new Html4Entities().decode(str);
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.prototype.encode = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var alpha = numIndex[str.charCodeAt(i)];
        result += alpha ? "&" + alpha + ";" : str.charAt(i);
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.encode = function(str) {
    return new Html4Entities().encode(str);
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.prototype.encodeNonUTF = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var cc = str.charCodeAt(i);
        var alpha = numIndex[cc];
        if (alpha) {
            result += "&" + alpha + ";";
        } else if (cc < 32 || cc > 126) {
            result += "&#" + cc + ";";
        } else {
            result += str.charAt(i);
        }
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.encodeNonUTF = function(str) {
    return new Html4Entities().encodeNonUTF(str);
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.prototype.encodeNonASCII = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var c = str.charCodeAt(i);
        if (c <= 255) {
            result += str[i++];
            continue;
        }
        result += '&#' + c + ';';
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
Html4Entities.encodeNonASCII = function(str) {
    return new Html4Entities().encodeNonASCII(str);
};

module.exports = Html4Entities;


/***/ }),
/* 797 */
/***/ (function(module, exports) {

var ALPHA_INDEX = {
    '&lt': '<',
    '&gt': '>',
    '&quot': '"',
    '&apos': '\'',
    '&amp': '&',
    '&lt;': '<',
    '&gt;': '>',
    '&quot;': '"',
    '&apos;': '\'',
    '&amp;': '&'
};

var CHAR_INDEX = {
    60: 'lt',
    62: 'gt',
    34: 'quot',
    39: 'apos',
    38: 'amp'
};

var CHAR_S_INDEX = {
    '<': '&lt;',
    '>': '&gt;',
    '"': '&quot;',
    '\'': '&apos;',
    '&': '&amp;'
};

/**
 * @constructor
 */
function XmlEntities() {}

/**
 * @param {String} str
 * @returns {String}
 */
XmlEntities.prototype.encode = function(str) {
    if (!str || !str.length) {
        return '';
    }
    return str.replace(/<|>|"|'|&/g, function(s) {
        return CHAR_S_INDEX[s];
    });
};

/**
 * @param {String} str
 * @returns {String}
 */
 XmlEntities.encode = function(str) {
    return new XmlEntities().encode(str);
 };

/**
 * @param {String} str
 * @returns {String}
 */
XmlEntities.prototype.decode = function(str) {
    if (!str || !str.length) {
        return '';
    }
    return str.replace(/&#?[0-9a-zA-Z]+;?/g, function(s) {
        if (s.charAt(1) === '#') {
            var code = s.charAt(2).toLowerCase() === 'x' ?
                parseInt(s.substr(3), 16) :
                parseInt(s.substr(2));

            if (isNaN(code) || code < -32768 || code > 65535) {
                return '';
            }
            return String.fromCharCode(code);
        }
        return ALPHA_INDEX[s] || s;
    });
};

/**
 * @param {String} str
 * @returns {String}
 */
 XmlEntities.decode = function(str) {
    return new XmlEntities().decode(str);
 };

/**
 * @param {String} str
 * @returns {String}
 */
XmlEntities.prototype.encodeNonUTF = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLength = str.length;
    var result = '';
    var i = 0;
    while (i < strLength) {
        var c = str.charCodeAt(i);
        var alpha = CHAR_INDEX[c];
        if (alpha) {
            result += "&" + alpha + ";";
            i++;
            continue;
        }
        if (c < 32 || c > 126) {
            result += '&#' + c + ';';
        } else {
            result += str.charAt(i);
        }
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
 XmlEntities.encodeNonUTF = function(str) {
    return new XmlEntities().encodeNonUTF(str);
 };

/**
 * @param {String} str
 * @returns {String}
 */
XmlEntities.prototype.encodeNonASCII = function(str) {
    if (!str || !str.length) {
        return '';
    }
    var strLenght = str.length;
    var result = '';
    var i = 0;
    while (i < strLenght) {
        var c = str.charCodeAt(i);
        if (c <= 255) {
            result += str[i++];
            continue;
        }
        result += '&#' + c + ';';
        i++;
    }
    return result;
};

/**
 * @param {String} str
 * @returns {String}
 */
 XmlEntities.encodeNonASCII = function(str) {
    return new XmlEntities().encodeNonASCII(str);
 };

module.exports = XmlEntities;


/***/ }),
/* 798 */
/***/ (function(module, exports) {

module.exports = "<div class='container-fluid'>\r\n    <div class='row'>\r\n        <div class='col-sm-3'>\r\n            <nav-menu></nav-menu>\r\n        </div>\r\n        <div class='col-sm-9 body-content'>\r\n            <router-outlet></router-outlet>\r\n        </div>\r\n    </div>\r\n</div>\r\n";

/***/ }),
/* 799 */
/***/ (function(module, exports) {

module.exports = "<h1>Counter</h1>\r\n\r\n<p>This is a simple example of an Angular component.</p>\r\n\r\n<p>Current count: <strong>{{ currentCount }}</strong></p>\r\n\r\n<button (click)=\"incrementCounter()\">Increment</button>\r\n";

/***/ }),
/* 800 */
/***/ (function(module, exports) {

module.exports = "<kendo-grid [data]=\"view | async\"\r\n            [pageSize]=\"gridState.take\"\r\n            [skip]=\"gridState.skip\"\r\n            [sort]=\"gridState.sort\"\r\n            [filter]=\"gridState.filter\"\r\n            [pageable]=\"true\"\r\n            [sortable]=\"true\"\r\n            filterable=\"menu\"\r\n            [selectable]=\"true\"\r\n            (dataStateChange)=\"onStateChange($event)\"\r\n            (selectionChange)=\"onSelect($event)\">\r\n    <ng-template kendoGridToolbarTemplate>\r\n        <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n                <div class=\"k-title\">Weather Forecast</div>\r\n            </div>\r\n        </div>\r\n    </ng-template>\r\n    <kendo-grid-column field=\"dateFormatted\" title=\"Weather Date\" width=\"100\" filter=\"date\" format=\"{0:d}\">\r\n    </kendo-grid-column>\r\n    <kendo-grid-column field=\"temperatureC\" title=\"Last Name\" width=\"100\" filter=\"numeric\">\r\n    </kendo-grid-column>\r\n    <kendo-grid-column field=\"temperatureF\" title=\"Company\" width=\"100\" filter=\"numeric\">\r\n    </kendo-grid-column>\r\n    <kendo-grid-column field=\"summary\" title=\"Summary\" width=\"150\">\r\n    </kendo-grid-column>\r\n</kendo-grid>\r\n";

/***/ }),
/* 801 */
/***/ (function(module, exports) {

module.exports = "<h1>Hello, world!</h1>\r\n<p>Welcome to your new single-page application, built with:</p>\r\n<ul>\r\n    <li><a href='https://get.asp.net/'>ASP.NET Core</a> and <a href='https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx'>C#</a> for cross-platform server-side code</li>\r\n    <li><a href='https://angular.io/'>Angular</a> and <a href='http://www.typescriptlang.org/'>TypeScript</a> for client-side code</li>\r\n    <li><a href='https://webpack.github.io/'>Webpack</a> for building and bundling client-side resources</li>\r\n    <li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li>\r\n</ul>\r\n<p>To help you get started, we've also set up:</p>\r\n<ul>\r\n    <li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li>\r\n    <li><strong>Server-side prerendering</strong>. For faster initial loading and improved SEO, your Angular app is prerendered on the server. The resulting HTML is then transferred to the browser where a client-side copy of the app takes over.</li>\r\n    <li><strong>Webpack dev middleware</strong>. In development mode, there's no need to run the <code>webpack</code> build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file.</li>\r\n    <li><strong>Hot module replacement</strong>. In development mode, you don't even need to reload the page after making most changes. Within seconds of saving changes to files, your Angular app will be rebuilt and a new instance injected into the page.</li>\r\n    <li><strong>Efficient production builds</strong>. In production mode, development-time features are disabled, and the <code>webpack</code> build tool produces minified static CSS and JavaScript files.</li>\r\n</ul>\r\n";

/***/ }),
/* 802 */
/***/ (function(module, exports) {

module.exports = "<div class='main-nav'>\r\n    <div class='navbar navbar-inverse'>\r\n        <div class='navbar-header'>\r\n            <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>\r\n                <span class='sr-only'>Toggle navigation</span>\r\n                <span class='icon-bar'></span>\r\n                <span class='icon-bar'></span>\r\n                <span class='icon-bar'></span>\r\n            </button>\r\n            <a class='navbar-brand' [routerLink]=\"['/home']\">npmtest2</a>\r\n        </div>\r\n        <div class='clearfix'></div>\r\n        <div class='navbar-collapse collapse'>\r\n            <ul class='nav navbar-nav'>\r\n                <li [routerLinkActive]=\"['link-active']\">\r\n                    <a [routerLink]=\"['/home']\">\r\n                        <span class='glyphicon glyphicon-home'></span> Home\r\n                    </a>\r\n                </li>\r\n                <li [routerLinkActive]=\"['link-active']\">\r\n                    <a [routerLink]=\"['/counter']\">\r\n                        <span class='glyphicon glyphicon-education'></span> Counter\r\n                    </a>\r\n                </li>\r\n                <li [routerLinkActive]=\"['link-active']\">\r\n                    <a [routerLink]=\"['/fetch-data']\">\r\n                        <span class='glyphicon glyphicon-th-list'></span> Fetch data\r\n                    </a>\r\n                </li>\r\n            </ul>\r\n        </div>\r\n    </div>\r\n</div>\r\n";

/***/ }),
/* 803 */
/***/ (function(module, exports) {

exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  var e, m
  var eLen = nBytes * 8 - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var nBits = -7
  var i = isLE ? (nBytes - 1) : 0
  var d = isLE ? -1 : 1
  var s = buffer[offset + i]

  i += d

  e = s & ((1 << (-nBits)) - 1)
  s >>= (-nBits)
  nBits += eLen
  for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}

  m = e & ((1 << (-nBits)) - 1)
  e >>= (-nBits)
  nBits += mLen
  for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}

  if (e === 0) {
    e = 1 - eBias
  } else if (e === eMax) {
    return m ? NaN : ((s ? -1 : 1) * Infinity)
  } else {
    m = m + Math.pow(2, mLen)
    e = e - eBias
  }
  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}

exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  var e, m, c
  var eLen = nBytes * 8 - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  var i = isLE ? 0 : (nBytes - 1)
  var d = isLE ? 1 : -1
  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0

  value = Math.abs(value)

  if (isNaN(value) || value === Infinity) {
    m = isNaN(value) ? 1 : 0
    e = eMax
  } else {
    e = Math.floor(Math.log(value) / Math.LN2)
    if (value * (c = Math.pow(2, -e)) < 1) {
      e--
      c *= 2
    }
    if (e + eBias >= 1) {
      value += rt / c
    } else {
      value += rt * Math.pow(2, 1 - eBias)
    }
    if (value * c >= 2) {
      e++
      c /= 2
    }

    if (e + eBias >= eMax) {
      m = 0
      e = eMax
    } else if (e + eBias >= 1) {
      m = (value * c - 1) * Math.pow(2, mLen)
      e = e + eBias
    } else {
      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
      e = 0
    }
  }

  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}

  e = (e << mLen) | m
  eLen += mLen
  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}

  buffer[offset + i - d] |= s * 128
}


/***/ }),
/* 804 */
/***/ (function(module, exports) {

var toString = {}.toString;

module.exports = Array.isArray || function (arr) {
  return toString.call(arr) == '[object Array]';
};


/***/ }),
/* 805 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(Buffer, global) {var require;var require;/*!

JSZip v3.1.5 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>

(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.

JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
*/

(function(f){if(true){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSZip = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return require(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var support = require('./support');
// private property
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";


// public method for encoding
exports.encode = function(input) {
    var output = [];
    var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
    var i = 0, len = input.length, remainingBytes = len;

    var isArray = utils.getTypeOf(input) !== "string";
    while (i < input.length) {
        remainingBytes = len - i;

        if (!isArray) {
            chr1 = input.charCodeAt(i++);
            chr2 = i < len ? input.charCodeAt(i++) : 0;
            chr3 = i < len ? input.charCodeAt(i++) : 0;
        } else {
            chr1 = input[i++];
            chr2 = i < len ? input[i++] : 0;
            chr3 = i < len ? input[i++] : 0;
        }

        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64;
        enc4 = remainingBytes > 2 ? (chr3 & 63) : 64;

        output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4));

    }

    return output.join("");
};

// public method for decoding
exports.decode = function(input) {
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0, resultIndex = 0;

    var dataUrlPrefix = "data:";

    if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) {
        // This is a common error: people give a data url
        // (data:image/png;base64,iVBOR...) with a {base64: true} and
        // wonders why things don't work.
        // We can detect that the string input looks like a data url but we
        // *can't* be sure it is one: removing everything up to the comma would
        // be too dangerous.
        throw new Error("Invalid base64 input, it looks like a data url.");
    }

    input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

    var totalLength = input.length * 3 / 4;
    if(input.charAt(input.length - 1) === _keyStr.charAt(64)) {
        totalLength--;
    }
    if(input.charAt(input.length - 2) === _keyStr.charAt(64)) {
        totalLength--;
    }
    if (totalLength % 1 !== 0) {
        // totalLength is not an integer, the length does not match a valid
        // base64 content. That can happen if:
        // - the input is not a base64 content
        // - the input is *almost* a base64 content, with a extra chars at the
        //   beginning or at the end
        // - the input uses a base64 variant (base64url for example)
        throw new Error("Invalid base64 input, bad content length.");
    }
    var output;
    if (support.uint8array) {
        output = new Uint8Array(totalLength|0);
    } else {
        output = new Array(totalLength|0);
    }

    while (i < input.length) {

        enc1 = _keyStr.indexOf(input.charAt(i++));
        enc2 = _keyStr.indexOf(input.charAt(i++));
        enc3 = _keyStr.indexOf(input.charAt(i++));
        enc4 = _keyStr.indexOf(input.charAt(i++));

        chr1 = (enc1 << 2) | (enc2 >> 4);
        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
        chr3 = ((enc3 & 3) << 6) | enc4;

        output[resultIndex++] = chr1;

        if (enc3 !== 64) {
            output[resultIndex++] = chr2;
        }
        if (enc4 !== 64) {
            output[resultIndex++] = chr3;
        }

    }

    return output;
};

},{"./support":30,"./utils":32}],2:[function(require,module,exports){
'use strict';

var external = require("./external");
var DataWorker = require('./stream/DataWorker');
var DataLengthProbe = require('./stream/DataLengthProbe');
var Crc32Probe = require('./stream/Crc32Probe');
var DataLengthProbe = require('./stream/DataLengthProbe');

/**
 * Represent a compressed object, with everything needed to decompress it.
 * @constructor
 * @param {number} compressedSize the size of the data compressed.
 * @param {number} uncompressedSize the size of the data after decompression.
 * @param {number} crc32 the crc32 of the decompressed file.
 * @param {object} compression the type of compression, see lib/compressions.js.
 * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data.
 */
function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) {
    this.compressedSize = compressedSize;
    this.uncompressedSize = uncompressedSize;
    this.crc32 = crc32;
    this.compression = compression;
    this.compressedContent = data;
}

CompressedObject.prototype = {
    /**
     * Create a worker to get the uncompressed content.
     * @return {GenericWorker} the worker.
     */
    getContentWorker : function () {
        var worker = new DataWorker(external.Promise.resolve(this.compressedContent))
        .pipe(this.compression.uncompressWorker())
        .pipe(new DataLengthProbe("data_length"));

        var that = this;
        worker.on("end", function () {
            if(this.streamInfo['data_length'] !== that.uncompressedSize) {
                throw new Error("Bug : uncompressed data size mismatch");
            }
        });
        return worker;
    },
    /**
     * Create a worker to get the compressed content.
     * @return {GenericWorker} the worker.
     */
    getCompressedWorker : function () {
        return new DataWorker(external.Promise.resolve(this.compressedContent))
        .withStreamInfo("compressedSize", this.compressedSize)
        .withStreamInfo("uncompressedSize", this.uncompressedSize)
        .withStreamInfo("crc32", this.crc32)
        .withStreamInfo("compression", this.compression)
        ;
    }
};

/**
 * Chain the given worker with other workers to compress the content with the
 * given compresion.
 * @param {GenericWorker} uncompressedWorker the worker to pipe.
 * @param {Object} compression the compression object.
 * @param {Object} compressionOptions the options to use when compressing.
 * @return {GenericWorker} the new worker compressing the content.
 */
CompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) {
    return uncompressedWorker
    .pipe(new Crc32Probe())
    .pipe(new DataLengthProbe("uncompressedSize"))
    .pipe(compression.compressWorker(compressionOptions))
    .pipe(new DataLengthProbe("compressedSize"))
    .withStreamInfo("compression", compression);
};

module.exports = CompressedObject;

},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(require,module,exports){
'use strict';

var GenericWorker = require("./stream/GenericWorker");

exports.STORE = {
    magic: "\x00\x00",
    compressWorker : function (compressionOptions) {
        return new GenericWorker("STORE compression");
    },
    uncompressWorker : function () {
        return new GenericWorker("STORE decompression");
    }
};
exports.DEFLATE = require('./flate');

},{"./flate":7,"./stream/GenericWorker":28}],4:[function(require,module,exports){
'use strict';

var utils = require('./utils');

/**
 * The following functions come from pako, from pako/lib/zlib/crc32.js
 * released under the MIT license, see pako https://github.com/nodeca/pako/
 */

// Use ordinary array, since untyped makes no boost here
function makeTable() {
    var c, table = [];

    for(var n =0; n < 256; n++){
        c = n;
        for(var k =0; k < 8; k++){
            c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
        }
        table[n] = c;
    }

    return table;
}

// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();


function crc32(crc, buf, len, pos) {
    var t = crcTable, end = pos + len;

    crc = crc ^ (-1);

    for (var i = pos; i < end; i++ ) {
        crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
    }

    return (crc ^ (-1)); // >>> 0;
}

// That's all for the pako functions.

/**
 * Compute the crc32 of a string.
 * This is almost the same as the function crc32, but for strings. Using the
 * same function for the two use cases leads to horrible performances.
 * @param {Number} crc the starting value of the crc.
 * @param {String} str the string to use.
 * @param {Number} len the length of the string.
 * @param {Number} pos the starting position for the crc32 computation.
 * @return {Number} the computed crc32.
 */
function crc32str(crc, str, len, pos) {
    var t = crcTable, end = pos + len;

    crc = crc ^ (-1);

    for (var i = pos; i < end; i++ ) {
        crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF];
    }

    return (crc ^ (-1)); // >>> 0;
}

module.exports = function crc32wrapper(input, crc) {
    if (typeof input === "undefined" || !input.length) {
        return 0;
    }

    var isArray = utils.getTypeOf(input) !== "string";

    if(isArray) {
        return crc32(crc|0, input, input.length, 0);
    } else {
        return crc32str(crc|0, input, input.length, 0);
    }
};

},{"./utils":32}],5:[function(require,module,exports){
'use strict';
exports.base64 = false;
exports.binary = false;
exports.dir = false;
exports.createFolders = true;
exports.date = null;
exports.compression = null;
exports.compressionOptions = null;
exports.comment = null;
exports.unixPermissions = null;
exports.dosPermissions = null;

},{}],6:[function(require,module,exports){
/* global Promise */
'use strict';

// load the global object first:
// - it should be better integrated in the system (unhandledRejection in node)
// - the environment may have a custom Promise implementation (see zone.js)
var ES6Promise = null;
if (typeof Promise !== "undefined") {
    ES6Promise = Promise;
} else {
    ES6Promise = require("lie");
}

/**
 * Let the user use/change some implementations.
 */
module.exports = {
    Promise: ES6Promise
};

},{"lie":58}],7:[function(require,module,exports){
'use strict';
var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');

var pako = require("pako");
var utils = require("./utils");
var GenericWorker = require("./stream/GenericWorker");

var ARRAY_TYPE = USE_TYPEDARRAY ? "uint8array" : "array";

exports.magic = "\x08\x00";

/**
 * Create a worker that uses pako to inflate/deflate.
 * @constructor
 * @param {String} action the name of the pako function to call : either "Deflate" or "Inflate".
 * @param {Object} options the options to use when (de)compressing.
 */
function FlateWorker(action, options) {
    GenericWorker.call(this, "FlateWorker/" + action);

    this._pako = null;
    this._pakoAction = action;
    this._pakoOptions = options;
    // the `meta` object from the last chunk received
    // this allow this worker to pass around metadata
    this.meta = {};
}

utils.inherits(FlateWorker, GenericWorker);

/**
 * @see GenericWorker.processChunk
 */
FlateWorker.prototype.processChunk = function (chunk) {
    this.meta = chunk.meta;
    if (this._pako === null) {
        this._createPako();
    }
    this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false);
};

/**
 * @see GenericWorker.flush
 */
FlateWorker.prototype.flush = function () {
    GenericWorker.prototype.flush.call(this);
    if (this._pako === null) {
        this._createPako();
    }
    this._pako.push([], true);
};
/**
 * @see GenericWorker.cleanUp
 */
FlateWorker.prototype.cleanUp = function () {
    GenericWorker.prototype.cleanUp.call(this);
    this._pako = null;
};

/**
 * Create the _pako object.
 * TODO: lazy-loading this object isn't the best solution but it's the
 * quickest. The best solution is to lazy-load the worker list. See also the
 * issue #446.
 */
FlateWorker.prototype._createPako = function () {
    this._pako = new pako[this._pakoAction]({
        raw: true,
        level: this._pakoOptions.level || -1 // default compression
    });
    var self = this;
    this._pako.onData = function(data) {
        self.push({
            data : data,
            meta : self.meta
        });
    };
};

exports.compressWorker = function (compressionOptions) {
    return new FlateWorker("Deflate", compressionOptions);
};
exports.uncompressWorker = function () {
    return new FlateWorker("Inflate", {});
};

},{"./stream/GenericWorker":28,"./utils":32,"pako":59}],8:[function(require,module,exports){
'use strict';

var utils = require('../utils');
var GenericWorker = require('../stream/GenericWorker');
var utf8 = require('../utf8');
var crc32 = require('../crc32');
var signature = require('../signature');

/**
 * Transform an integer into a string in hexadecimal.
 * @private
 * @param {number} dec the number to convert.
 * @param {number} bytes the number of bytes to generate.
 * @returns {string} the result.
 */
var decToHex = function(dec, bytes) {
    var hex = "", i;
    for (i = 0; i < bytes; i++) {
        hex += String.fromCharCode(dec & 0xff);
        dec = dec >>> 8;
    }
    return hex;
};

/**
 * Generate the UNIX part of the external file attributes.
 * @param {Object} unixPermissions the unix permissions or null.
 * @param {Boolean} isDir true if the entry is a directory, false otherwise.
 * @return {Number} a 32 bit integer.
 *
 * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute :
 *
 * TTTTsstrwxrwxrwx0000000000ADVSHR
 * ^^^^____________________________ file type, see zipinfo.c (UNX_*)
 *     ^^^_________________________ setuid, setgid, sticky
 *        ^^^^^^^^^________________ permissions
 *                 ^^^^^^^^^^______ not used ?
 *                           ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only
 */
var generateUnixExternalFileAttr = function (unixPermissions, isDir) {

    var result = unixPermissions;
    if (!unixPermissions) {
        // I can't use octal values in strict mode, hence the hexa.
        //  040775 => 0x41fd
        // 0100664 => 0x81b4
        result = isDir ? 0x41fd : 0x81b4;
    }
    return (result & 0xFFFF) << 16;
};

/**
 * Generate the DOS part of the external file attributes.
 * @param {Object} dosPermissions the dos permissions or null.
 * @param {Boolean} isDir true if the entry is a directory, false otherwise.
 * @return {Number} a 32 bit integer.
 *
 * Bit 0     Read-Only
 * Bit 1     Hidden
 * Bit 2     System
 * Bit 3     Volume Label
 * Bit 4     Directory
 * Bit 5     Archive
 */
var generateDosExternalFileAttr = function (dosPermissions, isDir) {

    // the dir flag is already set for compatibility
    return (dosPermissions || 0)  & 0x3F;
};

/**
 * Generate the various parts used in the construction of the final zip file.
 * @param {Object} streamInfo the hash with informations about the compressed file.
 * @param {Boolean} streamedContent is the content streamed ?
 * @param {Boolean} streamingEnded is the stream finished ?
 * @param {number} offset the current offset from the start of the zip file.
 * @param {String} platform let's pretend we are this platform (change platform dependents fields)
 * @param {Function} encodeFileName the function to encode the file name / comment.
 * @return {Object} the zip parts.
 */
var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) {
    var file = streamInfo['file'],
    compression = streamInfo['compression'],
    useCustomEncoding = encodeFileName !== utf8.utf8encode,
    encodedFileName = utils.transformTo("string", encodeFileName(file.name)),
    utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)),
    comment = file.comment,
    encodedComment = utils.transformTo("string", encodeFileName(comment)),
    utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)),
    useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,
    useUTF8ForComment = utfEncodedComment.length !== comment.length,
    dosTime,
    dosDate,
    extraFields = "",
    unicodePathExtraField = "",
    unicodeCommentExtraField = "",
    dir = file.dir,
    date = file.date;


    var dataInfo = {
        crc32 : 0,
        compressedSize : 0,
        uncompressedSize : 0
    };

    // if the content is streamed, the sizes/crc32 are only available AFTER
    // the end of the stream.
    if (!streamedContent || streamingEnded) {
        dataInfo.crc32 = streamInfo['crc32'];
        dataInfo.compressedSize = streamInfo['compressedSize'];
        dataInfo.uncompressedSize = streamInfo['uncompressedSize'];
    }

    var bitflag = 0;
    if (streamedContent) {
        // Bit 3: the sizes/crc32 are set to zero in the local header.
        // The correct values are put in the data descriptor immediately
        // following the compressed data.
        bitflag |= 0x0008;
    }
    if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) {
        // Bit 11: Language encoding flag (EFS).
        bitflag |= 0x0800;
    }


    var extFileAttr = 0;
    var versionMadeBy = 0;
    if (dir) {
        // dos or unix, we set the dos dir flag
        extFileAttr |= 0x00010;
    }
    if(platform === "UNIX") {
        versionMadeBy = 0x031E; // UNIX, version 3.0
        extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir);
    } else { // DOS or other, fallback to DOS
        versionMadeBy = 0x0014; // DOS, version 2.0
        extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir);
    }

    // date
    // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html
    // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html
    // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html

    dosTime = date.getUTCHours();
    dosTime = dosTime << 6;
    dosTime = dosTime | date.getUTCMinutes();
    dosTime = dosTime << 5;
    dosTime = dosTime | date.getUTCSeconds() / 2;

    dosDate = date.getUTCFullYear() - 1980;
    dosDate = dosDate << 4;
    dosDate = dosDate | (date.getUTCMonth() + 1);
    dosDate = dosDate << 5;
    dosDate = dosDate | date.getUTCDate();

    if (useUTF8ForFileName) {
        // set the unicode path extra field. unzip needs at least one extra
        // field to correctly handle unicode path, so using the path is as good
        // as any other information. This could improve the situation with
        // other archive managers too.
        // This field is usually used without the utf8 flag, with a non
        // unicode path in the header (winrar, winzip). This helps (a bit)
        // with the messy Windows' default compressed folders feature but
        // breaks on p7zip which doesn't seek the unicode path extra field.
        // So for now, UTF-8 everywhere !
        unicodePathExtraField =
            // Version
            decToHex(1, 1) +
            // NameCRC32
            decToHex(crc32(encodedFileName), 4) +
            // UnicodeName
            utfEncodedFileName;

        extraFields +=
            // Info-ZIP Unicode Path Extra Field
            "\x75\x70" +
            // size
            decToHex(unicodePathExtraField.length, 2) +
            // content
            unicodePathExtraField;
    }

    if(useUTF8ForComment) {

        unicodeCommentExtraField =
            // Version
            decToHex(1, 1) +
            // CommentCRC32
            decToHex(crc32(encodedComment), 4) +
            // UnicodeName
            utfEncodedComment;

        extraFields +=
            // Info-ZIP Unicode Path Extra Field
            "\x75\x63" +
            // size
            decToHex(unicodeCommentExtraField.length, 2) +
            // content
            unicodeCommentExtraField;
    }

    var header = "";

    // version needed to extract
    header += "\x0A\x00";
    // general purpose bit flag
    header += decToHex(bitflag, 2);
    // compression method
    header += compression.magic;
    // last mod file time
    header += decToHex(dosTime, 2);
    // last mod file date
    header += decToHex(dosDate, 2);
    // crc-32
    header += decToHex(dataInfo.crc32, 4);
    // compressed size
    header += decToHex(dataInfo.compressedSize, 4);
    // uncompressed size
    header += decToHex(dataInfo.uncompressedSize, 4);
    // file name length
    header += decToHex(encodedFileName.length, 2);
    // extra field length
    header += decToHex(extraFields.length, 2);


    var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields;

    var dirRecord = signature.CENTRAL_FILE_HEADER +
        // version made by (00: DOS)
        decToHex(versionMadeBy, 2) +
        // file header (common to file and central directory)
        header +
        // file comment length
        decToHex(encodedComment.length, 2) +
        // disk number start
        "\x00\x00" +
        // internal file attributes TODO
        "\x00\x00" +
        // external file attributes
        decToHex(extFileAttr, 4) +
        // relative offset of local header
        decToHex(offset, 4) +
        // file name
        encodedFileName +
        // extra field
        extraFields +
        // file comment
        encodedComment;

    return {
        fileRecord: fileRecord,
        dirRecord: dirRecord
    };
};

/**
 * Generate the EOCD record.
 * @param {Number} entriesCount the number of entries in the zip file.
 * @param {Number} centralDirLength the length (in bytes) of the central dir.
 * @param {Number} localDirLength the length (in bytes) of the local dir.
 * @param {String} comment the zip file comment as a binary string.
 * @param {Function} encodeFileName the function to encode the comment.
 * @return {String} the EOCD record.
 */
var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) {
    var dirEnd = "";
    var encodedComment = utils.transformTo("string", encodeFileName(comment));

    // end of central dir signature
    dirEnd = signature.CENTRAL_DIRECTORY_END +
        // number of this disk
        "\x00\x00" +
        // number of the disk with the start of the central directory
        "\x00\x00" +
        // total number of entries in the central directory on this disk
        decToHex(entriesCount, 2) +
        // total number of entries in the central directory
        decToHex(entriesCount, 2) +
        // size of the central directory   4 bytes
        decToHex(centralDirLength, 4) +
        // offset of start of central directory with respect to the starting disk number
        decToHex(localDirLength, 4) +
        // .ZIP file comment length
        decToHex(encodedComment.length, 2) +
        // .ZIP file comment
        encodedComment;

    return dirEnd;
};

/**
 * Generate data descriptors for a file entry.
 * @param {Object} streamInfo the hash generated by a worker, containing informations
 * on the file entry.
 * @return {String} the data descriptors.
 */
var generateDataDescriptors = function (streamInfo) {
    var descriptor = "";
    descriptor = signature.DATA_DESCRIPTOR +
        // crc-32                          4 bytes
        decToHex(streamInfo['crc32'], 4) +
        // compressed size                 4 bytes
        decToHex(streamInfo['compressedSize'], 4) +
        // uncompressed size               4 bytes
        decToHex(streamInfo['uncompressedSize'], 4);

    return descriptor;
};


/**
 * A worker to concatenate other workers to create a zip file.
 * @param {Boolean} streamFiles `true` to stream the content of the files,
 * `false` to accumulate it.
 * @param {String} comment the comment to use.
 * @param {String} platform the platform to use, "UNIX" or "DOS".
 * @param {Function} encodeFileName the function to encode file names and comments.
 */
function ZipFileWorker(streamFiles, comment, platform, encodeFileName) {
    GenericWorker.call(this, "ZipFileWorker");
    // The number of bytes written so far. This doesn't count accumulated chunks.
    this.bytesWritten = 0;
    // The comment of the zip file
    this.zipComment = comment;
    // The platform "generating" the zip file.
    this.zipPlatform = platform;
    // the function to encode file names and comments.
    this.encodeFileName = encodeFileName;
    // Should we stream the content of the files ?
    this.streamFiles = streamFiles;
    // If `streamFiles` is false, we will need to accumulate the content of the
    // files to calculate sizes / crc32 (and write them *before* the content).
    // This boolean indicates if we are accumulating chunks (it will change a lot
    // during the lifetime of this worker).
    this.accumulate = false;
    // The buffer receiving chunks when accumulating content.
    this.contentBuffer = [];
    // The list of generated directory records.
    this.dirRecords = [];
    // The offset (in bytes) from the beginning of the zip file for the current source.
    this.currentSourceOffset = 0;
    // The total number of entries in this zip file.
    this.entriesCount = 0;
    // the name of the file currently being added, null when handling the end of the zip file.
    // Used for the emited metadata.
    this.currentFile = null;



    this._sources = [];
}
utils.inherits(ZipFileWorker, GenericWorker);

/**
 * @see GenericWorker.push
 */
ZipFileWorker.prototype.push = function (chunk) {

    var currentFilePercent = chunk.meta.percent || 0;
    var entriesCount = this.entriesCount;
    var remainingFiles = this._sources.length;

    if(this.accumulate) {
        this.contentBuffer.push(chunk);
    } else {
        this.bytesWritten += chunk.data.length;

        GenericWorker.prototype.push.call(this, {
            data : chunk.data,
            meta : {
                currentFile : this.currentFile,
                percent : entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100
            }
        });
    }
};

/**
 * The worker started a new source (an other worker).
 * @param {Object} streamInfo the streamInfo object from the new source.
 */
ZipFileWorker.prototype.openedSource = function (streamInfo) {
    this.currentSourceOffset = this.bytesWritten;
    this.currentFile = streamInfo['file'].name;

    var streamedContent = this.streamFiles && !streamInfo['file'].dir;

    // don't stream folders (because they don't have any content)
    if(streamedContent) {
        var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
        this.push({
            data : record.fileRecord,
            meta : {percent:0}
        });
    } else {
        // we need to wait for the whole file before pushing anything
        this.accumulate = true;
    }
};

/**
 * The worker finished a source (an other worker).
 * @param {Object} streamInfo the streamInfo object from the finished source.
 */
ZipFileWorker.prototype.closedSource = function (streamInfo) {
    this.accumulate = false;
    var streamedContent = this.streamFiles && !streamInfo['file'].dir;
    var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);

    this.dirRecords.push(record.dirRecord);
    if(streamedContent) {
        // after the streamed file, we put data descriptors
        this.push({
            data : generateDataDescriptors(streamInfo),
            meta : {percent:100}
        });
    } else {
        // the content wasn't streamed, we need to push everything now
        // first the file record, then the content
        this.push({
            data : record.fileRecord,
            meta : {percent:0}
        });
        while(this.contentBuffer.length) {
            this.push(this.contentBuffer.shift());
        }
    }
    this.currentFile = null;
};

/**
 * @see GenericWorker.flush
 */
ZipFileWorker.prototype.flush = function () {

    var localDirLength = this.bytesWritten;
    for(var i = 0; i < this.dirRecords.length; i++) {
        this.push({
            data : this.dirRecords[i],
            meta : {percent:100}
        });
    }
    var centralDirLength = this.bytesWritten - localDirLength;

    var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName);

    this.push({
        data : dirEnd,
        meta : {percent:100}
    });
};

/**
 * Prepare the next source to be read.
 */
ZipFileWorker.prototype.prepareNextSource = function () {
    this.previous = this._sources.shift();
    this.openedSource(this.previous.streamInfo);
    if (this.isPaused) {
        this.previous.pause();
    } else {
        this.previous.resume();
    }
};

/**
 * @see GenericWorker.registerPrevious
 */
ZipFileWorker.prototype.registerPrevious = function (previous) {
    this._sources.push(previous);
    var self = this;

    previous.on('data', function (chunk) {
        self.processChunk(chunk);
    });
    previous.on('end', function () {
        self.closedSource(self.previous.streamInfo);
        if(self._sources.length) {
            self.prepareNextSource();
        } else {
            self.end();
        }
    });
    previous.on('error', function (e) {
        self.error(e);
    });
    return this;
};

/**
 * @see GenericWorker.resume
 */
ZipFileWorker.prototype.resume = function () {
    if(!GenericWorker.prototype.resume.call(this)) {
        return false;
    }

    if (!this.previous && this._sources.length) {
        this.prepareNextSource();
        return true;
    }
    if (!this.previous && !this._sources.length && !this.generatedError) {
        this.end();
        return true;
    }
};

/**
 * @see GenericWorker.error
 */
ZipFileWorker.prototype.error = function (e) {
    var sources = this._sources;
    if(!GenericWorker.prototype.error.call(this, e)) {
        return false;
    }
    for(var i = 0; i < sources.length; i++) {
        try {
            sources[i].error(e);
        } catch(e) {
            // the `error` exploded, nothing to do
        }
    }
    return true;
};

/**
 * @see GenericWorker.lock
 */
ZipFileWorker.prototype.lock = function () {
    GenericWorker.prototype.lock.call(this);
    var sources = this._sources;
    for(var i = 0; i < sources.length; i++) {
        sources[i].lock();
    }
};

module.exports = ZipFileWorker;

},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(require,module,exports){
'use strict';

var compressions = require('../compressions');
var ZipFileWorker = require('./ZipFileWorker');

/**
 * Find the compression to use.
 * @param {String} fileCompression the compression defined at the file level, if any.
 * @param {String} zipCompression the compression defined at the load() level.
 * @return {Object} the compression object to use.
 */
var getCompression = function (fileCompression, zipCompression) {

    var compressionName = fileCompression || zipCompression;
    var compression = compressions[compressionName];
    if (!compression) {
        throw new Error(compressionName + " is not a valid compression method !");
    }
    return compression;
};

/**
 * Create a worker to generate a zip file.
 * @param {JSZip} zip the JSZip instance at the right root level.
 * @param {Object} options to generate the zip file.
 * @param {String} comment the comment to use.
 */
exports.generateWorker = function (zip, options, comment) {

    var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName);
    var entriesCount = 0;
    try {

        zip.forEach(function (relativePath, file) {
            entriesCount++;
            var compression = getCompression(file.options.compression, options.compression);
            var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};
            var dir = file.dir, date = file.date;

            file._compressWorker(compression, compressionOptions)
            .withStreamInfo("file", {
                name : relativePath,
                dir : dir,
                date : date,
                comment : file.comment || "",
                unixPermissions : file.unixPermissions,
                dosPermissions : file.dosPermissions
            })
            .pipe(zipFileWorker);
        });
        zipFileWorker.entriesCount = entriesCount;
    } catch (e) {
        zipFileWorker.error(e);
    }

    return zipFileWorker;
};

},{"../compressions":3,"./ZipFileWorker":8}],10:[function(require,module,exports){
'use strict';

/**
 * Representation a of zip file in js
 * @constructor
 */
function JSZip() {
    // if this constructor is used without `new`, it adds `new` before itself:
    if(!(this instanceof JSZip)) {
        return new JSZip();
    }

    if(arguments.length) {
        throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
    }

    // object containing the files :
    // {
    //   "folder/" : {...},
    //   "folder/data.txt" : {...}
    // }
    this.files = {};

    this.comment = null;

    // Where we are in the hierarchy
    this.root = "";
    this.clone = function() {
        var newObj = new JSZip();
        for (var i in this) {
            if (typeof this[i] !== "function") {
                newObj[i] = this[i];
            }
        }
        return newObj;
    };
}
JSZip.prototype = require('./object');
JSZip.prototype.loadAsync = require('./load');
JSZip.support = require('./support');
JSZip.defaults = require('./defaults');

// TODO find a better way to handle this version,
// a require('package.json').version doesn't work with webpack, see #327
JSZip.version = "3.1.5";

JSZip.loadAsync = function (content, options) {
    return new JSZip().loadAsync(content, options);
};

JSZip.external = require("./external");
module.exports = JSZip;

},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var external = require("./external");
var utf8 = require('./utf8');
var utils = require('./utils');
var ZipEntries = require('./zipEntries');
var Crc32Probe = require('./stream/Crc32Probe');
var nodejsUtils = require("./nodejsUtils");

/**
 * Check the CRC32 of an entry.
 * @param {ZipEntry} zipEntry the zip entry to check.
 * @return {Promise} the result.
 */
function checkEntryCRC32(zipEntry) {
    return new external.Promise(function (resolve, reject) {
        var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe());
        worker.on("error", function (e) {
            reject(e);
        })
        .on("end", function () {
            if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
                reject(new Error("Corrupted zip : CRC32 mismatch"));
            } else {
                resolve();
            }
        })
        .resume();
    });
}

module.exports = function(data, options) {
    var zip = this;
    options = utils.extend(options || {}, {
        base64: false,
        checkCRC32: false,
        optimizedBinaryString: false,
        createFolders: false,
        decodeFileName: utf8.utf8decode
    });

    if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
        return external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file."));
    }

    return utils.prepareContent("the loaded zip file", data, true, options.optimizedBinaryString, options.base64)
    .then(function(data) {
        var zipEntries = new ZipEntries(options);
        zipEntries.load(data);
        return zipEntries;
    }).then(function checkCRC32(zipEntries) {
        var promises = [external.Promise.resolve(zipEntries)];
        var files = zipEntries.files;
        if (options.checkCRC32) {
            for (var i = 0; i < files.length; i++) {
                promises.push(checkEntryCRC32(files[i]));
            }
        }
        return external.Promise.all(promises);
    }).then(function addFiles(results) {
        var zipEntries = results.shift();
        var files = zipEntries.files;
        for (var i = 0; i < files.length; i++) {
            var input = files[i];
            zip.file(input.fileNameStr, input.decompressed, {
                binary: true,
                optimizedBinaryString: true,
                date: input.date,
                dir: input.dir,
                comment : input.fileCommentStr.length ? input.fileCommentStr : null,
                unixPermissions : input.unixPermissions,
                dosPermissions : input.dosPermissions,
                createFolders: options.createFolders
            });
        }
        if (zipEntries.zipComment.length) {
            zip.comment = zipEntries.zipComment;
        }

        return zip;
    });
};

},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(require,module,exports){
"use strict";

var utils = require('../utils');
var GenericWorker = require('../stream/GenericWorker');

/**
 * A worker that use a nodejs stream as source.
 * @constructor
 * @param {String} filename the name of the file entry for this stream.
 * @param {Readable} stream the nodejs stream.
 */
function NodejsStreamInputAdapter(filename, stream) {
    GenericWorker.call(this, "Nodejs stream input adapter for " + filename);
    this._upstreamEnded = false;
    this._bindStream(stream);
}

utils.inherits(NodejsStreamInputAdapter, GenericWorker);

/**
 * Prepare the stream and bind the callbacks on it.
 * Do this ASAP on node 0.10 ! A lazy binding doesn't always work.
 * @param {Stream} stream the nodejs stream to use.
 */
NodejsStreamInputAdapter.prototype._bindStream = function (stream) {
    var self = this;
    this._stream = stream;
    stream.pause();
    stream
    .on("data", function (chunk) {
        self.push({
            data: chunk,
            meta : {
                percent : 0
            }
        });
    })
    .on("error", function (e) {
        if(self.isPaused) {
            this.generatedError = e;
        } else {
            self.error(e);
        }
    })
    .on("end", function () {
        if(self.isPaused) {
            self._upstreamEnded = true;
        } else {
            self.end();
        }
    });
};
NodejsStreamInputAdapter.prototype.pause = function () {
    if(!GenericWorker.prototype.pause.call(this)) {
        return false;
    }
    this._stream.pause();
    return true;
};
NodejsStreamInputAdapter.prototype.resume = function () {
    if(!GenericWorker.prototype.resume.call(this)) {
        return false;
    }

    if(this._upstreamEnded) {
        this.end();
    } else {
        this._stream.resume();
    }

    return true;
};

module.exports = NodejsStreamInputAdapter;

},{"../stream/GenericWorker":28,"../utils":32}],13:[function(require,module,exports){
'use strict';

var Readable = require('readable-stream').Readable;

var utils = require('../utils');
utils.inherits(NodejsStreamOutputAdapter, Readable);

/**
* A nodejs stream using a worker as source.
* @see the SourceWrapper in http://nodejs.org/api/stream.html
* @constructor
* @param {StreamHelper} helper the helper wrapping the worker
* @param {Object} options the nodejs stream options
* @param {Function} updateCb the update callback.
*/
function NodejsStreamOutputAdapter(helper, options, updateCb) {
    Readable.call(this, options);
    this._helper = helper;

    var self = this;
    helper.on("data", function (data, meta) {
        if (!self.push(data)) {
            self._helper.pause();
        }
        if(updateCb) {
            updateCb(meta);
        }
    })
    .on("error", function(e) {
        self.emit('error', e);
    })
    .on("end", function () {
        self.push(null);
    });
}


NodejsStreamOutputAdapter.prototype._read = function() {
    this._helper.resume();
};

module.exports = NodejsStreamOutputAdapter;

},{"../utils":32,"readable-stream":16}],14:[function(require,module,exports){
'use strict';

module.exports = {
    /**
     * True if this is running in Nodejs, will be undefined in a browser.
     * In a browser, browserify won't include this file and the whole module
     * will be resolved an empty object.
     */
    isNode : typeof Buffer !== "undefined",
    /**
     * Create a new nodejs Buffer from an existing content.
     * @param {Object} data the data to pass to the constructor.
     * @param {String} encoding the encoding to use.
     * @return {Buffer} a new Buffer.
     */
    newBufferFrom: function(data, encoding) {
        // XXX We can't use `Buffer.from` which comes from `Uint8Array.from`
        // in nodejs v4 (< v.4.5). It's not the expected implementation (and
        // has a different signature).
        // see https://github.com/nodejs/node/issues/8053
        // A condition on nodejs' version won't solve the issue as we don't
        // control the Buffer polyfills that may or may not be used.
        return new Buffer(data, encoding);
    },
    /**
     * Create a new nodejs Buffer with the specified size.
     * @param {Integer} size the size of the buffer.
     * @return {Buffer} a new Buffer.
     */
    allocBuffer: function (size) {
        if (Buffer.alloc) {
            return Buffer.alloc(size);
        } else {
            return new Buffer(size);
        }
    },
    /**
     * Find out if an object is a Buffer.
     * @param {Object} b the object to test.
     * @return {Boolean} true if the object is a Buffer, false otherwise.
     */
    isBuffer : function(b){
        return Buffer.isBuffer(b);
    },

    isStream : function (obj) {
        return obj &&
            typeof obj.on === "function" &&
            typeof obj.pause === "function" &&
            typeof obj.resume === "function";
    }
};

},{}],15:[function(require,module,exports){
'use strict';
var utf8 = require('./utf8');
var utils = require('./utils');
var GenericWorker = require('./stream/GenericWorker');
var StreamHelper = require('./stream/StreamHelper');
var defaults = require('./defaults');
var CompressedObject = require('./compressedObject');
var ZipObject = require('./zipObject');
var generate = require("./generate");
var nodejsUtils = require("./nodejsUtils");
var NodejsStreamInputAdapter = require("./nodejs/NodejsStreamInputAdapter");


/**
 * Add a file in the current folder.
 * @private
 * @param {string} name the name of the file
 * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
 * @param {Object} originalOptions the options of the file
 * @return {Object} the new file.
 */
var fileAdd = function(name, data, originalOptions) {
    // be sure sub folders exist
    var dataType = utils.getTypeOf(data),
        parent;


    /*
     * Correct options.
     */

    var o = utils.extend(originalOptions || {}, defaults);
    o.date = o.date || new Date();
    if (o.compression !== null) {
        o.compression = o.compression.toUpperCase();
    }

    if (typeof o.unixPermissions === "string") {
        o.unixPermissions = parseInt(o.unixPermissions, 8);
    }

    // UNX_IFDIR  0040000 see zipinfo.c
    if (o.unixPermissions && (o.unixPermissions & 0x4000)) {
        o.dir = true;
    }
    // Bit 4    Directory
    if (o.dosPermissions && (o.dosPermissions & 0x0010)) {
        o.dir = true;
    }

    if (o.dir) {
        name = forceTrailingSlash(name);
    }
    if (o.createFolders && (parent = parentFolder(name))) {
        folderAdd.call(this, parent, true);
    }

    var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false;
    if (!originalOptions || typeof originalOptions.binary === "undefined") {
        o.binary = !isUnicodeString;
    }


    var isCompressedEmpty = (data instanceof CompressedObject) && data.uncompressedSize === 0;

    if (isCompressedEmpty || o.dir || !data || data.length === 0) {
        o.base64 = false;
        o.binary = true;
        data = "";
        o.compression = "STORE";
        dataType = "string";
    }

    /*
     * Convert content to fit.
     */

    var zipObjectContent = null;
    if (data instanceof CompressedObject || data instanceof GenericWorker) {
        zipObjectContent = data;
    } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
        zipObjectContent = new NodejsStreamInputAdapter(name, data);
    } else {
        zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64);
    }

    var object = new ZipObject(name, zipObjectContent, o);
    this.files[name] = object;
    /*
    TODO: we can't throw an exception because we have async promises
    (we can have a promise of a Date() for example) but returning a
    promise is useless because file(name, data) returns the JSZip
    object for chaining. Should we break that to allow the user
    to catch the error ?

    return external.Promise.resolve(zipObjectContent)
    .then(function () {
        return object;
    });
    */
};

/**
 * Find the parent folder of the path.
 * @private
 * @param {string} path the path to use
 * @return {string} the parent folder, or ""
 */
var parentFolder = function (path) {
    if (path.slice(-1) === '/') {
        path = path.substring(0, path.length - 1);
    }
    var lastSlash = path.lastIndexOf('/');
    return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
};

/**
 * Returns the path with a slash at the end.
 * @private
 * @param {String} path the path to check.
 * @return {String} the path with a trailing slash.
 */
var forceTrailingSlash = function(path) {
    // Check the name ends with a /
    if (path.slice(-1) !== "/") {
        path += "/"; // IE doesn't like substr(-1)
    }
    return path;
};

/**
 * Add a (sub) folder in the current folder.
 * @private
 * @param {string} name the folder's name
 * @param {boolean=} [createFolders] If true, automatically create sub
 *  folders. Defaults to false.
 * @return {Object} the new folder.
 */
var folderAdd = function(name, createFolders) {
    createFolders = (typeof createFolders !== 'undefined') ? createFolders : defaults.createFolders;

    name = forceTrailingSlash(name);

    // Does this folder already exist?
    if (!this.files[name]) {
        fileAdd.call(this, name, null, {
            dir: true,
            createFolders: createFolders
        });
    }
    return this.files[name];
};

/**
* Cross-window, cross-Node-context regular expression detection
* @param  {Object}  object Anything
* @return {Boolean}        true if the object is a regular expression,
* false otherwise
*/
function isRegExp(object) {
    return Object.prototype.toString.call(object) === "[object RegExp]";
}

// return the actual prototype of JSZip
var out = {
    /**
     * @see loadAsync
     */
    load: function() {
        throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
    },


    /**
     * Call a callback function for each entry at this folder level.
     * @param {Function} cb the callback function:
     * function (relativePath, file) {...}
     * It takes 2 arguments : the relative path and the file.
     */
    forEach: function(cb) {
        var filename, relativePath, file;
        for (filename in this.files) {
            if (!this.files.hasOwnProperty(filename)) {
                continue;
            }
            file = this.files[filename];
            relativePath = filename.slice(this.root.length, filename.length);
            if (relativePath && filename.slice(0, this.root.length) === this.root) { // the file is in the current root
                cb(relativePath, file); // TODO reverse the parameters ? need to be clean AND consistent with the filter search fn...
            }
        }
    },

    /**
     * Filter nested files/folders with the specified function.
     * @param {Function} search the predicate to use :
     * function (relativePath, file) {...}
     * It takes 2 arguments : the relative path and the file.
     * @return {Array} An array of matching elements.
     */
    filter: function(search) {
        var result = [];
        this.forEach(function (relativePath, entry) {
            if (search(relativePath, entry)) { // the file matches the function
                result.push(entry);
            }

        });
        return result;
    },

    /**
     * Add a file to the zip file, or search a file.
     * @param   {string|RegExp} name The name of the file to add (if data is defined),
     * the name of the file to find (if no data) or a regex to match files.
     * @param   {String|ArrayBuffer|Uint8Array|Buffer} data  The file data, either raw or base64 encoded
     * @param   {Object} o     File options
     * @return  {JSZip|Object|Array} this JSZip object (when adding a file),
     * a file (when searching by string) or an array of files (when searching by regex).
     */
    file: function(name, data, o) {
        if (arguments.length === 1) {
            if (isRegExp(name)) {
                var regexp = name;
                return this.filter(function(relativePath, file) {
                    return !file.dir && regexp.test(relativePath);
                });
            }
            else { // text
                var obj = this.files[this.root + name];
                if (obj && !obj.dir) {
                    return obj;
                } else {
                    return null;
                }
            }
        }
        else { // more than one argument : we have data !
            name = this.root + name;
            fileAdd.call(this, name, data, o);
        }
        return this;
    },

    /**
     * Add a directory to the zip file, or search.
     * @param   {String|RegExp} arg The name of the directory to add, or a regex to search folders.
     * @return  {JSZip} an object with the new directory as the root, or an array containing matching folders.
     */
    folder: function(arg) {
        if (!arg) {
            return this;
        }

        if (isRegExp(arg)) {
            return this.filter(function(relativePath, file) {
                return file.dir && arg.test(relativePath);
            });
        }

        // else, name is a new folder
        var name = this.root + arg;
        var newFolder = folderAdd.call(this, name);

        // Allow chaining by returning a new object with this folder as the root
        var ret = this.clone();
        ret.root = newFolder.name;
        return ret;
    },

    /**
     * Delete a file, or a directory and all sub-files, from the zip
     * @param {string} name the name of the file to delete
     * @return {JSZip} this JSZip object
     */
    remove: function(name) {
        name = this.root + name;
        var file = this.files[name];
        if (!file) {
            // Look for any folders
            if (name.slice(-1) !== "/") {
                name += "/";
            }
            file = this.files[name];
        }

        if (file && !file.dir) {
            // file
            delete this.files[name];
        } else {
            // maybe a folder, delete recursively
            var kids = this.filter(function(relativePath, file) {
                return file.name.slice(0, name.length) === name;
            });
            for (var i = 0; i < kids.length; i++) {
                delete this.files[kids[i].name];
            }
        }

        return this;
    },

    /**
     * Generate the complete zip file
     * @param {Object} options the options to generate the zip file :
     * - compression, "STORE" by default.
     * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
     * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file
     */
    generate: function(options) {
        throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
    },

    /**
     * Generate the complete zip file as an internal stream.
     * @param {Object} options the options to generate the zip file :
     * - compression, "STORE" by default.
     * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
     * @return {StreamHelper} the streamed zip file.
     */
    generateInternalStream: function(options) {
      var worker, opts = {};
      try {
          opts = utils.extend(options || {}, {
              streamFiles: false,
              compression: "STORE",
              compressionOptions : null,
              type: "",
              platform: "DOS",
              comment: null,
              mimeType: 'application/zip',
              encodeFileName: utf8.utf8encode
          });

          opts.type = opts.type.toLowerCase();
          opts.compression = opts.compression.toUpperCase();

          // "binarystring" is prefered but the internals use "string".
          if(opts.type === "binarystring") {
            opts.type = "string";
          }

          if (!opts.type) {
            throw new Error("No output type specified.");
          }

          utils.checkSupport(opts.type);

          // accept nodejs `process.platform`
          if(
              opts.platform === 'darwin' ||
              opts.platform === 'freebsd' ||
              opts.platform === 'linux' ||
              opts.platform === 'sunos'
          ) {
              opts.platform = "UNIX";
          }
          if (opts.platform === 'win32') {
              opts.platform = "DOS";
          }

          var comment = opts.comment || this.comment || "";
          worker = generate.generateWorker(this, opts, comment);
      } catch (e) {
        worker = new GenericWorker("error");
        worker.error(e);
      }
      return new StreamHelper(worker, opts.type || "string", opts.mimeType);
    },
    /**
     * Generate the complete zip file asynchronously.
     * @see generateInternalStream
     */
    generateAsync: function(options, onUpdate) {
        return this.generateInternalStream(options).accumulate(onUpdate);
    },
    /**
     * Generate the complete zip file asynchronously.
     * @see generateInternalStream
     */
    generateNodeStream: function(options, onUpdate) {
        options = options || {};
        if (!options.type) {
            options.type = "nodebuffer";
        }
        return this.generateInternalStream(options).toNodejsStream(onUpdate);
    }
};
module.exports = out;

},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(require,module,exports){
/*
 * This file is used by module bundlers (browserify/webpack/etc) when
 * including a stream implementation. We use "readable-stream" to get a
 * consistent behavior between nodejs versions but bundlers often have a shim
 * for "stream". Using this shim greatly improve the compatibility and greatly
 * reduce the final size of the bundle (only one stream implementation, not
 * two).
 */
module.exports = require("stream");

},{"stream":undefined}],17:[function(require,module,exports){
'use strict';
var DataReader = require('./DataReader');
var utils = require('../utils');

function ArrayReader(data) {
    DataReader.call(this, data);
	for(var i = 0; i < this.data.length; i++) {
		data[i] = data[i] & 0xFF;
	}
}
utils.inherits(ArrayReader, DataReader);
/**
 * @see DataReader.byteAt
 */
ArrayReader.prototype.byteAt = function(i) {
    return this.data[this.zero + i];
};
/**
 * @see DataReader.lastIndexOfSignature
 */
ArrayReader.prototype.lastIndexOfSignature = function(sig) {
    var sig0 = sig.charCodeAt(0),
        sig1 = sig.charCodeAt(1),
        sig2 = sig.charCodeAt(2),
        sig3 = sig.charCodeAt(3);
    for (var i = this.length - 4; i >= 0; --i) {
        if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
            return i - this.zero;
        }
    }

    return -1;
};
/**
 * @see DataReader.readAndCheckSignature
 */
ArrayReader.prototype.readAndCheckSignature = function (sig) {
    var sig0 = sig.charCodeAt(0),
        sig1 = sig.charCodeAt(1),
        sig2 = sig.charCodeAt(2),
        sig3 = sig.charCodeAt(3),
        data = this.readData(4);
    return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3];
};
/**
 * @see DataReader.readData
 */
ArrayReader.prototype.readData = function(size) {
    this.checkOffset(size);
    if(size === 0) {
        return [];
    }
    var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
    this.index += size;
    return result;
};
module.exports = ArrayReader;

},{"../utils":32,"./DataReader":18}],18:[function(require,module,exports){
'use strict';
var utils = require('../utils');

function DataReader(data) {
    this.data = data; // type : see implementation
    this.length = data.length;
    this.index = 0;
    this.zero = 0;
}
DataReader.prototype = {
    /**
     * Check that the offset will not go too far.
     * @param {string} offset the additional offset to check.
     * @throws {Error} an Error if the offset is out of bounds.
     */
    checkOffset: function(offset) {
        this.checkIndex(this.index + offset);
    },
    /**
     * Check that the specified index will not be too far.
     * @param {string} newIndex the index to check.
     * @throws {Error} an Error if the index is out of bounds.
     */
    checkIndex: function(newIndex) {
        if (this.length < this.zero + newIndex || newIndex < 0) {
            throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
        }
    },
    /**
     * Change the index.
     * @param {number} newIndex The new index.
     * @throws {Error} if the new index is out of the data.
     */
    setIndex: function(newIndex) {
        this.checkIndex(newIndex);
        this.index = newIndex;
    },
    /**
     * Skip the next n bytes.
     * @param {number} n the number of bytes to skip.
     * @throws {Error} if the new index is out of the data.
     */
    skip: function(n) {
        this.setIndex(this.index + n);
    },
    /**
     * Get the byte at the specified index.
     * @param {number} i the index to use.
     * @return {number} a byte.
     */
    byteAt: function(i) {
        // see implementations
    },
    /**
     * Get the next number with a given byte size.
     * @param {number} size the number of bytes to read.
     * @return {number} the corresponding number.
     */
    readInt: function(size) {
        var result = 0,
            i;
        this.checkOffset(size);
        for (i = this.index + size - 1; i >= this.index; i--) {
            result = (result << 8) + this.byteAt(i);
        }
        this.index += size;
        return result;
    },
    /**
     * Get the next string with a given byte size.
     * @param {number} size the number of bytes to read.
     * @return {string} the corresponding string.
     */
    readString: function(size) {
        return utils.transformTo("string", this.readData(size));
    },
    /**
     * Get raw data without conversion, <size> bytes.
     * @param {number} size the number of bytes to read.
     * @return {Object} the raw data, implementation specific.
     */
    readData: function(size) {
        // see implementations
    },
    /**
     * Find the last occurence of a zip signature (4 bytes).
     * @param {string} sig the signature to find.
     * @return {number} the index of the last occurence, -1 if not found.
     */
    lastIndexOfSignature: function(sig) {
        // see implementations
    },
    /**
     * Read the signature (4 bytes) at the current position and compare it with sig.
     * @param {string} sig the expected signature
     * @return {boolean} true if the signature matches, false otherwise.
     */
    readAndCheckSignature: function(sig) {
        // see implementations
    },
    /**
     * Get the next date.
     * @return {Date} the date.
     */
    readDate: function() {
        var dostime = this.readInt(4);
        return new Date(Date.UTC(
        ((dostime >> 25) & 0x7f) + 1980, // year
        ((dostime >> 21) & 0x0f) - 1, // month
        (dostime >> 16) & 0x1f, // day
        (dostime >> 11) & 0x1f, // hour
        (dostime >> 5) & 0x3f, // minute
        (dostime & 0x1f) << 1)); // second
    }
};
module.exports = DataReader;

},{"../utils":32}],19:[function(require,module,exports){
'use strict';
var Uint8ArrayReader = require('./Uint8ArrayReader');
var utils = require('../utils');

function NodeBufferReader(data) {
    Uint8ArrayReader.call(this, data);
}
utils.inherits(NodeBufferReader, Uint8ArrayReader);

/**
 * @see DataReader.readData
 */
NodeBufferReader.prototype.readData = function(size) {
    this.checkOffset(size);
    var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
    this.index += size;
    return result;
};
module.exports = NodeBufferReader;

},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(require,module,exports){
'use strict';
var DataReader = require('./DataReader');
var utils = require('../utils');

function StringReader(data) {
    DataReader.call(this, data);
}
utils.inherits(StringReader, DataReader);
/**
 * @see DataReader.byteAt
 */
StringReader.prototype.byteAt = function(i) {
    return this.data.charCodeAt(this.zero + i);
};
/**
 * @see DataReader.lastIndexOfSignature
 */
StringReader.prototype.lastIndexOfSignature = function(sig) {
    return this.data.lastIndexOf(sig) - this.zero;
};
/**
 * @see DataReader.readAndCheckSignature
 */
StringReader.prototype.readAndCheckSignature = function (sig) {
    var data = this.readData(4);
    return sig === data;
};
/**
 * @see DataReader.readData
 */
StringReader.prototype.readData = function(size) {
    this.checkOffset(size);
    // this will work because the constructor applied the "& 0xff" mask.
    var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);
    this.index += size;
    return result;
};
module.exports = StringReader;

},{"../utils":32,"./DataReader":18}],21:[function(require,module,exports){
'use strict';
var ArrayReader = require('./ArrayReader');
var utils = require('../utils');

function Uint8ArrayReader(data) {
    ArrayReader.call(this, data);
}
utils.inherits(Uint8ArrayReader, ArrayReader);
/**
 * @see DataReader.readData
 */
Uint8ArrayReader.prototype.readData = function(size) {
    this.checkOffset(size);
    if(size === 0) {
        // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].
        return new Uint8Array(0);
    }
    var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size);
    this.index += size;
    return result;
};
module.exports = Uint8ArrayReader;

},{"../utils":32,"./ArrayReader":17}],22:[function(require,module,exports){
'use strict';

var utils = require('../utils');
var support = require('../support');
var ArrayReader = require('./ArrayReader');
var StringReader = require('./StringReader');
var NodeBufferReader = require('./NodeBufferReader');
var Uint8ArrayReader = require('./Uint8ArrayReader');

/**
 * Create a reader adapted to the data.
 * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read.
 * @return {DataReader} the data reader.
 */
module.exports = function (data) {
    var type = utils.getTypeOf(data);
    utils.checkSupport(type);
    if (type === "string" && !support.uint8array) {
        return new StringReader(data);
    }
    if (type === "nodebuffer") {
        return new NodeBufferReader(data);
    }
    if (support.uint8array) {
        return new Uint8ArrayReader(utils.transformTo("uint8array", data));
    }
    return new ArrayReader(utils.transformTo("array", data));
};

},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(require,module,exports){
'use strict';
exports.LOCAL_FILE_HEADER = "PK\x03\x04";
exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
exports.DATA_DESCRIPTOR = "PK\x07\x08";

},{}],24:[function(require,module,exports){
'use strict';

var GenericWorker = require('./GenericWorker');
var utils = require('../utils');

/**
 * A worker which convert chunks to a specified type.
 * @constructor
 * @param {String} destType the destination type.
 */
function ConvertWorker(destType) {
    GenericWorker.call(this, "ConvertWorker to " + destType);
    this.destType = destType;
}
utils.inherits(ConvertWorker, GenericWorker);

/**
 * @see GenericWorker.processChunk
 */
ConvertWorker.prototype.processChunk = function (chunk) {
    this.push({
        data : utils.transformTo(this.destType, chunk.data),
        meta : chunk.meta
    });
};
module.exports = ConvertWorker;

},{"../utils":32,"./GenericWorker":28}],25:[function(require,module,exports){
'use strict';

var GenericWorker = require('./GenericWorker');
var crc32 = require('../crc32');
var utils = require('../utils');

/**
 * A worker which calculate the crc32 of the data flowing through.
 * @constructor
 */
function Crc32Probe() {
    GenericWorker.call(this, "Crc32Probe");
    this.withStreamInfo("crc32", 0);
}
utils.inherits(Crc32Probe, GenericWorker);

/**
 * @see GenericWorker.processChunk
 */
Crc32Probe.prototype.processChunk = function (chunk) {
    this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0);
    this.push(chunk);
};
module.exports = Crc32Probe;

},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(require,module,exports){
'use strict';

var utils = require('../utils');
var GenericWorker = require('./GenericWorker');

/**
 * A worker which calculate the total length of the data flowing through.
 * @constructor
 * @param {String} propName the name used to expose the length
 */
function DataLengthProbe(propName) {
    GenericWorker.call(this, "DataLengthProbe for " + propName);
    this.propName = propName;
    this.withStreamInfo(propName, 0);
}
utils.inherits(DataLengthProbe, GenericWorker);

/**
 * @see GenericWorker.processChunk
 */
DataLengthProbe.prototype.processChunk = function (chunk) {
    if(chunk) {
        var length = this.streamInfo[this.propName] || 0;
        this.streamInfo[this.propName] = length + chunk.data.length;
    }
    GenericWorker.prototype.processChunk.call(this, chunk);
};
module.exports = DataLengthProbe;


},{"../utils":32,"./GenericWorker":28}],27:[function(require,module,exports){
'use strict';

var utils = require('../utils');
var GenericWorker = require('./GenericWorker');

// the size of the generated chunks
// TODO expose this as a public variable
var DEFAULT_BLOCK_SIZE = 16 * 1024;

/**
 * A worker that reads a content and emits chunks.
 * @constructor
 * @param {Promise} dataP the promise of the data to split
 */
function DataWorker(dataP) {
    GenericWorker.call(this, "DataWorker");
    var self = this;
    this.dataIsReady = false;
    this.index = 0;
    this.max = 0;
    this.data = null;
    this.type = "";

    this._tickScheduled = false;

    dataP.then(function (data) {
        self.dataIsReady = true;
        self.data = data;
        self.max = data && data.length || 0;
        self.type = utils.getTypeOf(data);
        if(!self.isPaused) {
            self._tickAndRepeat();
        }
    }, function (e) {
        self.error(e);
    });
}

utils.inherits(DataWorker, GenericWorker);

/**
 * @see GenericWorker.cleanUp
 */
DataWorker.prototype.cleanUp = function () {
    GenericWorker.prototype.cleanUp.call(this);
    this.data = null;
};

/**
 * @see GenericWorker.resume
 */
DataWorker.prototype.resume = function () {
    if(!GenericWorker.prototype.resume.call(this)) {
        return false;
    }

    if (!this._tickScheduled && this.dataIsReady) {
        this._tickScheduled = true;
        utils.delay(this._tickAndRepeat, [], this);
    }
    return true;
};

/**
 * Trigger a tick a schedule an other call to this function.
 */
DataWorker.prototype._tickAndRepeat = function() {
    this._tickScheduled = false;
    if(this.isPaused || this.isFinished) {
        return;
    }
    this._tick();
    if(!this.isFinished) {
        utils.delay(this._tickAndRepeat, [], this);
        this._tickScheduled = true;
    }
};

/**
 * Read and push a chunk.
 */
DataWorker.prototype._tick = function() {

    if(this.isPaused || this.isFinished) {
        return false;
    }

    var size = DEFAULT_BLOCK_SIZE;
    var data = null, nextIndex = Math.min(this.max, this.index + size);
    if (this.index >= this.max) {
        // EOF
        return this.end();
    } else {
        switch(this.type) {
            case "string":
                data = this.data.substring(this.index, nextIndex);
            break;
            case "uint8array":
                data = this.data.subarray(this.index, nextIndex);
            break;
            case "array":
            case "nodebuffer":
                data = this.data.slice(this.index, nextIndex);
            break;
        }
        this.index = nextIndex;
        return this.push({
            data : data,
            meta : {
                percent : this.max ? this.index / this.max * 100 : 0
            }
        });
    }
};

module.exports = DataWorker;

},{"../utils":32,"./GenericWorker":28}],28:[function(require,module,exports){
'use strict';

/**
 * A worker that does nothing but passing chunks to the next one. This is like
 * a nodejs stream but with some differences. On the good side :
 * - it works on IE 6-9 without any issue / polyfill
 * - it weights less than the full dependencies bundled with browserify
 * - it forwards errors (no need to declare an error handler EVERYWHERE)
 *
 * A chunk is an object with 2 attributes : `meta` and `data`. The former is an
 * object containing anything (`percent` for example), see each worker for more
 * details. The latter is the real data (String, Uint8Array, etc).
 *
 * @constructor
 * @param {String} name the name of the stream (mainly used for debugging purposes)
 */
function GenericWorker(name) {
    // the name of the worker
    this.name = name || "default";
    // an object containing metadata about the workers chain
    this.streamInfo = {};
    // an error which happened when the worker was paused
    this.generatedError = null;
    // an object containing metadata to be merged by this worker into the general metadata
    this.extraStreamInfo = {};
    // true if the stream is paused (and should not do anything), false otherwise
    this.isPaused = true;
    // true if the stream is finished (and should not do anything), false otherwise
    this.isFinished = false;
    // true if the stream is locked to prevent further structure updates (pipe), false otherwise
    this.isLocked = false;
    // the event listeners
    this._listeners = {
        'data':[],
        'end':[],
        'error':[]
    };
    // the previous worker, if any
    this.previous = null;
}

GenericWorker.prototype = {
    /**
     * Push a chunk to the next workers.
     * @param {Object} chunk the chunk to push
     */
    push : function (chunk) {
        this.emit("data", chunk);
    },
    /**
     * End the stream.
     * @return {Boolean} true if this call ended the worker, false otherwise.
     */
    end : function () {
        if (this.isFinished) {
            return false;
        }

        this.flush();
        try {
            this.emit("end");
            this.cleanUp();
            this.isFinished = true;
        } catch (e) {
            this.emit("error", e);
        }
        return true;
    },
    /**
     * End the stream with an error.
     * @param {Error} e the error which caused the premature end.
     * @return {Boolean} true if this call ended the worker with an error, false otherwise.
     */
    error : function (e) {
        if (this.isFinished) {
            return false;
        }

        if(this.isPaused) {
            this.generatedError = e;
        } else {
            this.isFinished = true;

            this.emit("error", e);

            // in the workers chain exploded in the middle of the chain,
            // the error event will go downward but we also need to notify
            // workers upward that there has been an error.
            if(this.previous) {
                this.previous.error(e);
            }

            this.cleanUp();
        }
        return true;
    },
    /**
     * Add a callback on an event.
     * @param {String} name the name of the event (data, end, error)
     * @param {Function} listener the function to call when the event is triggered
     * @return {GenericWorker} the current object for chainability
     */
    on : function (name, listener) {
        this._listeners[name].push(listener);
        return this;
    },
    /**
     * Clean any references when a worker is ending.
     */
    cleanUp : function () {
        this.streamInfo = this.generatedError = this.extraStreamInfo = null;
        this._listeners = [];
    },
    /**
     * Trigger an event. This will call registered callback with the provided arg.
     * @param {String} name the name of the event (data, end, error)
     * @param {Object} arg the argument to call the callback with.
     */
    emit : function (name, arg) {
        if (this._listeners[name]) {
            for(var i = 0; i < this._listeners[name].length; i++) {
                this._listeners[name][i].call(this, arg);
            }
        }
    },
    /**
     * Chain a worker with an other.
     * @param {Worker} next the worker receiving events from the current one.
     * @return {worker} the next worker for chainability
     */
    pipe : function (next) {
        return next.registerPrevious(this);
    },
    /**
     * Same as `pipe` in the other direction.
     * Using an API with `pipe(next)` is very easy.
     * Implementing the API with the point of view of the next one registering
     * a source is easier, see the ZipFileWorker.
     * @param {Worker} previous the previous worker, sending events to this one
     * @return {Worker} the current worker for chainability
     */
    registerPrevious : function (previous) {
        if (this.isLocked) {
            throw new Error("The stream '" + this + "' has already been used.");
        }

        // sharing the streamInfo...
        this.streamInfo = previous.streamInfo;
        // ... and adding our own bits
        this.mergeStreamInfo();
        this.previous =  previous;
        var self = this;
        previous.on('data', function (chunk) {
            self.processChunk(chunk);
        });
        previous.on('end', function () {
            self.end();
        });
        previous.on('error', function (e) {
            self.error(e);
        });
        return this;
    },
    /**
     * Pause the stream so it doesn't send events anymore.
     * @return {Boolean} true if this call paused the worker, false otherwise.
     */
    pause : function () {
        if(this.isPaused || this.isFinished) {
            return false;
        }
        this.isPaused = true;

        if(this.previous) {
            this.previous.pause();
        }
        return true;
    },
    /**
     * Resume a paused stream.
     * @return {Boolean} true if this call resumed the worker, false otherwise.
     */
    resume : function () {
        if(!this.isPaused || this.isFinished) {
            return false;
        }
        this.isPaused = false;

        // if true, the worker tried to resume but failed
        var withError = false;
        if(this.generatedError) {
            this.error(this.generatedError);
            withError = true;
        }
        if(this.previous) {
            this.previous.resume();
        }

        return !withError;
    },
    /**
     * Flush any remaining bytes as the stream is ending.
     */
    flush : function () {},
    /**
     * Process a chunk. This is usually the method overridden.
     * @param {Object} chunk the chunk to process.
     */
    processChunk : function(chunk) {
        this.push(chunk);
    },
    /**
     * Add a key/value to be added in the workers chain streamInfo once activated.
     * @param {String} key the key to use
     * @param {Object} value the associated value
     * @return {Worker} the current worker for chainability
     */
    withStreamInfo : function (key, value) {
        this.extraStreamInfo[key] = value;
        this.mergeStreamInfo();
        return this;
    },
    /**
     * Merge this worker's streamInfo into the chain's streamInfo.
     */
    mergeStreamInfo : function () {
        for(var key in this.extraStreamInfo) {
            if (!this.extraStreamInfo.hasOwnProperty(key)) {
                continue;
            }
            this.streamInfo[key] = this.extraStreamInfo[key];
        }
    },

    /**
     * Lock the stream to prevent further updates on the workers chain.
     * After calling this method, all calls to pipe will fail.
     */
    lock: function () {
        if (this.isLocked) {
            throw new Error("The stream '" + this + "' has already been used.");
        }
        this.isLocked = true;
        if (this.previous) {
            this.previous.lock();
        }
    },

    /**
     *
     * Pretty print the workers chain.
     */
    toString : function () {
        var me = "Worker " + this.name;
        if (this.previous) {
            return this.previous + " -> " + me;
        } else {
            return me;
        }
    }
};

module.exports = GenericWorker;

},{}],29:[function(require,module,exports){
'use strict';

var utils = require('../utils');
var ConvertWorker = require('./ConvertWorker');
var GenericWorker = require('./GenericWorker');
var base64 = require('../base64');
var support = require("../support");
var external = require("../external");

var NodejsStreamOutputAdapter = null;
if (support.nodestream) {
    try {
        NodejsStreamOutputAdapter = require('../nodejs/NodejsStreamOutputAdapter');
    } catch(e) {}
}

/**
 * Apply the final transformation of the data. If the user wants a Blob for
 * example, it's easier to work with an U8intArray and finally do the
 * ArrayBuffer/Blob conversion.
 * @param {String} type the name of the final type
 * @param {String|Uint8Array|Buffer} content the content to transform
 * @param {String} mimeType the mime type of the content, if applicable.
 * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format.
 */
function transformZipOutput(type, content, mimeType) {
    switch(type) {
        case "blob" :
            return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType);
        case "base64" :
            return base64.encode(content);
        default :
            return utils.transformTo(type, content);
    }
}

/**
 * Concatenate an array of data of the given type.
 * @param {String} type the type of the data in the given array.
 * @param {Array} dataArray the array containing the data chunks to concatenate
 * @return {String|Uint8Array|Buffer} the concatenated data
 * @throws Error if the asked type is unsupported
 */
function concat (type, dataArray) {
    var i, index = 0, res = null, totalLength = 0;
    for(i = 0; i < dataArray.length; i++) {
        totalLength += dataArray[i].length;
    }
    switch(type) {
        case "string":
            return dataArray.join("");
          case "array":
            return Array.prototype.concat.apply([], dataArray);
        case "uint8array":
            res = new Uint8Array(totalLength);
            for(i = 0; i < dataArray.length; i++) {
                res.set(dataArray[i], index);
                index += dataArray[i].length;
            }
            return res;
        case "nodebuffer":
            return Buffer.concat(dataArray);
        default:
            throw new Error("concat : unsupported type '"  + type + "'");
    }
}

/**
 * Listen a StreamHelper, accumulate its content and concatenate it into a
 * complete block.
 * @param {StreamHelper} helper the helper to use.
 * @param {Function} updateCallback a callback called on each update. Called
 * with one arg :
 * - the metadata linked to the update received.
 * @return Promise the promise for the accumulation.
 */
function accumulate(helper, updateCallback) {
    return new external.Promise(function (resolve, reject){
        var dataArray = [];
        var chunkType = helper._internalType,
            resultType = helper._outputType,
            mimeType = helper._mimeType;
        helper
        .on('data', function (data, meta) {
            dataArray.push(data);
            if(updateCallback) {
                updateCallback(meta);
            }
        })
        .on('error', function(err) {
            dataArray = [];
            reject(err);
        })
        .on('end', function (){
            try {
                var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
                resolve(result);
            } catch (e) {
                reject(e);
            }
            dataArray = [];
        })
        .resume();
    });
}

/**
 * An helper to easily use workers outside of JSZip.
 * @constructor
 * @param {Worker} worker the worker to wrap
 * @param {String} outputType the type of data expected by the use
 * @param {String} mimeType the mime type of the content, if applicable.
 */
function StreamHelper(worker, outputType, mimeType) {
    var internalType = outputType;
    switch(outputType) {
        case "blob":
        case "arraybuffer":
            internalType = "uint8array";
        break;
        case "base64":
            internalType = "string";
        break;
    }

    try {
        // the type used internally
        this._internalType = internalType;
        // the type used to output results
        this._outputType = outputType;
        // the mime type
        this._mimeType = mimeType;
        utils.checkSupport(internalType);
        this._worker = worker.pipe(new ConvertWorker(internalType));
        // the last workers can be rewired without issues but we need to
        // prevent any updates on previous workers.
        worker.lock();
    } catch(e) {
        this._worker = new GenericWorker("error");
        this._worker.error(e);
    }
}

StreamHelper.prototype = {
    /**
     * Listen a StreamHelper, accumulate its content and concatenate it into a
     * complete block.
     * @param {Function} updateCb the update callback.
     * @return Promise the promise for the accumulation.
     */
    accumulate : function (updateCb) {
        return accumulate(this, updateCb);
    },
    /**
     * Add a listener on an event triggered on a stream.
     * @param {String} evt the name of the event
     * @param {Function} fn the listener
     * @return {StreamHelper} the current helper.
     */
    on : function (evt, fn) {
        var self = this;

        if(evt === "data") {
            this._worker.on(evt, function (chunk) {
                fn.call(self, chunk.data, chunk.meta);
            });
        } else {
            this._worker.on(evt, function () {
                utils.delay(fn, arguments, self);
            });
        }
        return this;
    },
    /**
     * Resume the flow of chunks.
     * @return {StreamHelper} the current helper.
     */
    resume : function () {
        utils.delay(this._worker.resume, [], this._worker);
        return this;
    },
    /**
     * Pause the flow of chunks.
     * @return {StreamHelper} the current helper.
     */
    pause : function () {
        this._worker.pause();
        return this;
    },
    /**
     * Return a nodejs stream for this helper.
     * @param {Function} updateCb the update callback.
     * @return {NodejsStreamOutputAdapter} the nodejs stream.
     */
    toNodejsStream : function (updateCb) {
        utils.checkSupport("nodestream");
        if (this._outputType !== "nodebuffer") {
            // an object stream containing blob/arraybuffer/uint8array/string
            // is strange and I don't know if it would be useful.
            // I you find this comment and have a good usecase, please open a
            // bug report !
            throw new Error(this._outputType + " is not supported by this method");
        }

        return new NodejsStreamOutputAdapter(this, {
            objectMode : this._outputType !== "nodebuffer"
        }, updateCb);
    }
};


module.exports = StreamHelper;

},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(require,module,exports){
'use strict';

exports.base64 = true;
exports.array = true;
exports.string = true;
exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
exports.nodebuffer = typeof Buffer !== "undefined";
// contains true if JSZip can read/generate Uint8Array, false otherwise.
exports.uint8array = typeof Uint8Array !== "undefined";

if (typeof ArrayBuffer === "undefined") {
    exports.blob = false;
}
else {
    var buffer = new ArrayBuffer(0);
    try {
        exports.blob = new Blob([buffer], {
            type: "application/zip"
        }).size === 0;
    }
    catch (e) {
        try {
            var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;
            var builder = new Builder();
            builder.append(buffer);
            exports.blob = builder.getBlob('application/zip').size === 0;
        }
        catch (e) {
            exports.blob = false;
        }
    }
}

try {
    exports.nodestream = !!require('readable-stream').Readable;
} catch(e) {
    exports.nodestream = false;
}

},{"readable-stream":16}],31:[function(require,module,exports){
'use strict';

var utils = require('./utils');
var support = require('./support');
var nodejsUtils = require('./nodejsUtils');
var GenericWorker = require('./stream/GenericWorker');

/**
 * The following functions come from pako, from pako/lib/utils/strings
 * released under the MIT license, see pako https://github.com/nodeca/pako/
 */

// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new Array(256);
for (var i=0; i<256; i++) {
  _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
}
_utf8len[254]=_utf8len[254]=1; // Invalid sequence start

// convert string to array (typed, when possible)
var string2buf = function (str) {
    var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;

    // count binary size
    for (m_pos = 0; m_pos < str_len; m_pos++) {
        c = str.charCodeAt(m_pos);
        if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
            c2 = str.charCodeAt(m_pos+1);
            if ((c2 & 0xfc00) === 0xdc00) {
                c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
                m_pos++;
            }
        }
        buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
    }

    // allocate buffer
    if (support.uint8array) {
        buf = new Uint8Array(buf_len);
    } else {
        buf = new Array(buf_len);
    }

    // convert
    for (i=0, m_pos = 0; i < buf_len; m_pos++) {
        c = str.charCodeAt(m_pos);
        if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
            c2 = str.charCodeAt(m_pos+1);
            if ((c2 & 0xfc00) === 0xdc00) {
                c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
                m_pos++;
            }
        }
        if (c < 0x80) {
            /* one byte */
            buf[i++] = c;
        } else if (c < 0x800) {
            /* two bytes */
            buf[i++] = 0xC0 | (c >>> 6);
            buf[i++] = 0x80 | (c & 0x3f);
        } else if (c < 0x10000) {
            /* three bytes */
            buf[i++] = 0xE0 | (c >>> 12);
            buf[i++] = 0x80 | (c >>> 6 & 0x3f);
            buf[i++] = 0x80 | (c & 0x3f);
        } else {
            /* four bytes */
            buf[i++] = 0xf0 | (c >>> 18);
            buf[i++] = 0x80 | (c >>> 12 & 0x3f);
            buf[i++] = 0x80 | (c >>> 6 & 0x3f);
            buf[i++] = 0x80 | (c & 0x3f);
        }
    }

    return buf;
};

// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max   - length limit (mandatory);
var utf8border = function(buf, max) {
    var pos;

    max = max || buf.length;
    if (max > buf.length) { max = buf.length; }

    // go back from last position, until start of sequence found
    pos = max-1;
    while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }

    // Fuckup - very small and broken sequence,
    // return max, because we should return something anyway.
    if (pos < 0) { return max; }

    // If we came to start of buffer - that means vuffer is too small,
    // return max too.
    if (pos === 0) { return max; }

    return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};

// convert array to string
var buf2string = function (buf) {
    var str, i, out, c, c_len;
    var len = buf.length;

    // Reserve max possible length (2 words per char)
    // NB: by unknown reasons, Array is significantly faster for
    //     String.fromCharCode.apply than Uint16Array.
    var utf16buf = new Array(len*2);

    for (out=0, i=0; i<len;) {
        c = buf[i++];
        // quick process ascii
        if (c < 0x80) { utf16buf[out++] = c; continue; }

        c_len = _utf8len[c];
        // skip 5 & 6 byte codes
        if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }

        // apply mask on first byte
        c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
        // join the rest
        while (c_len > 1 && i < len) {
            c = (c << 6) | (buf[i++] & 0x3f);
            c_len--;
        }

        // terminated by end of string?
        if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }

        if (c < 0x10000) {
            utf16buf[out++] = c;
        } else {
            c -= 0x10000;
            utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
            utf16buf[out++] = 0xdc00 | (c & 0x3ff);
        }
    }

    // shrinkBuf(utf16buf, out)
    if (utf16buf.length !== out) {
        if(utf16buf.subarray) {
            utf16buf = utf16buf.subarray(0, out);
        } else {
            utf16buf.length = out;
        }
    }

    // return String.fromCharCode.apply(null, utf16buf);
    return utils.applyFromCharCode(utf16buf);
};


// That's all for the pako functions.


/**
 * Transform a javascript string into an array (typed if possible) of bytes,
 * UTF-8 encoded.
 * @param {String} str the string to encode
 * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.
 */
exports.utf8encode = function utf8encode(str) {
    if (support.nodebuffer) {
        return nodejsUtils.newBufferFrom(str, "utf-8");
    }

    return string2buf(str);
};


/**
 * Transform a bytes array (or a representation) representing an UTF-8 encoded
 * string into a javascript string.
 * @param {Array|Uint8Array|Buffer} buf the data de decode
 * @return {String} the decoded string.
 */
exports.utf8decode = function utf8decode(buf) {
    if (support.nodebuffer) {
        return utils.transformTo("nodebuffer", buf).toString("utf-8");
    }

    buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf);

    return buf2string(buf);
};

/**
 * A worker to decode utf8 encoded binary chunks into string chunks.
 * @constructor
 */
function Utf8DecodeWorker() {
    GenericWorker.call(this, "utf-8 decode");
    // the last bytes if a chunk didn't end with a complete codepoint.
    this.leftOver = null;
}
utils.inherits(Utf8DecodeWorker, GenericWorker);

/**
 * @see GenericWorker.processChunk
 */
Utf8DecodeWorker.prototype.processChunk = function (chunk) {

    var data = utils.transformTo(support.uint8array ? "uint8array" : "array", chunk.data);

    // 1st step, re-use what's left of the previous chunk
    if (this.leftOver && this.leftOver.length) {
        if(support.uint8array) {
            var previousData = data;
            data = new Uint8Array(previousData.length + this.leftOver.length);
            data.set(this.leftOver, 0);
            data.set(previousData, this.leftOver.length);
        } else {
            data = this.leftOver.concat(data);
        }
        this.leftOver = null;
    }

    var nextBoundary = utf8border(data);
    var usableData = data;
    if (nextBoundary !== data.length) {
        if (support.uint8array) {
            usableData = data.subarray(0, nextBoundary);
            this.leftOver = data.subarray(nextBoundary, data.length);
        } else {
            usableData = data.slice(0, nextBoundary);
            this.leftOver = data.slice(nextBoundary, data.length);
        }
    }

    this.push({
        data : exports.utf8decode(usableData),
        meta : chunk.meta
    });
};

/**
 * @see GenericWorker.flush
 */
Utf8DecodeWorker.prototype.flush = function () {
    if(this.leftOver && this.leftOver.length) {
        this.push({
            data : exports.utf8decode(this.leftOver),
            meta : {}
        });
        this.leftOver = null;
    }
};
exports.Utf8DecodeWorker = Utf8DecodeWorker;

/**
 * A worker to endcode string chunks into utf8 encoded binary chunks.
 * @constructor
 */
function Utf8EncodeWorker() {
    GenericWorker.call(this, "utf-8 encode");
}
utils.inherits(Utf8EncodeWorker, GenericWorker);

/**
 * @see GenericWorker.processChunk
 */
Utf8EncodeWorker.prototype.processChunk = function (chunk) {
    this.push({
        data : exports.utf8encode(chunk.data),
        meta : chunk.meta
    });
};
exports.Utf8EncodeWorker = Utf8EncodeWorker;

},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(require,module,exports){
'use strict';

var support = require('./support');
var base64 = require('./base64');
var nodejsUtils = require('./nodejsUtils');
var setImmediate = require('core-js/library/fn/set-immediate');
var external = require("./external");


/**
 * Convert a string that pass as a "binary string": it should represent a byte
 * array but may have > 255 char codes. Be sure to take only the first byte
 * and returns the byte array.
 * @param {String} str the string to transform.
 * @return {Array|Uint8Array} the string in a binary format.
 */
function string2binary(str) {
    var result = null;
    if (support.uint8array) {
      result = new Uint8Array(str.length);
    } else {
      result = new Array(str.length);
    }
    return stringToArrayLike(str, result);
}

/**
 * Create a new blob with the given content and the given type.
 * @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use
 * an Uint8Array because the stock browser of android 4 won't accept it (it
 * will be silently converted to a string, "[object Uint8Array]").
 *
 * Use only ONE part to build the blob to avoid a memory leak in IE11 / Edge:
 * when a large amount of Array is used to create the Blob, the amount of
 * memory consumed is nearly 100 times the original data amount.
 *
 * @param {String} type the mime type of the blob.
 * @return {Blob} the created blob.
 */
exports.newBlob = function(part, type) {
    exports.checkSupport("blob");

    try {
        // Blob constructor
        return new Blob([part], {
            type: type
        });
    }
    catch (e) {

        try {
            // deprecated, browser only, old way
            var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder;
            var builder = new Builder();
            builder.append(part);
            return builder.getBlob(type);
        }
        catch (e) {

            // well, fuck ?!
            throw new Error("Bug : can't construct the Blob.");
        }
    }


};
/**
 * The identity function.
 * @param {Object} input the input.
 * @return {Object} the same input.
 */
function identity(input) {
    return input;
}

/**
 * Fill in an array with a string.
 * @param {String} str the string to use.
 * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).
 * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.
 */
function stringToArrayLike(str, array) {
    for (var i = 0; i < str.length; ++i) {
        array[i] = str.charCodeAt(i) & 0xFF;
    }
    return array;
}

/**
 * An helper for the function arrayLikeToString.
 * This contains static informations and functions that
 * can be optimized by the browser JIT compiler.
 */
var arrayToStringHelper = {
    /**
     * Transform an array of int into a string, chunk by chunk.
     * See the performances notes on arrayLikeToString.
     * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
     * @param {String} type the type of the array.
     * @param {Integer} chunk the chunk size.
     * @return {String} the resulting string.
     * @throws Error if the chunk is too big for the stack.
     */
    stringifyByChunk: function(array, type, chunk) {
        var result = [], k = 0, len = array.length;
        // shortcut
        if (len <= chunk) {
            return String.fromCharCode.apply(null, array);
        }
        while (k < len) {
            if (type === "array" || type === "nodebuffer") {
                result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));
            }
            else {
                result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));
            }
            k += chunk;
        }
        return result.join("");
    },
    /**
     * Call String.fromCharCode on every item in the array.
     * This is the naive implementation, which generate A LOT of intermediate string.
     * This should be used when everything else fail.
     * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
     * @return {String} the result.
     */
    stringifyByChar: function(array){
        var resultStr = "";
        for(var i = 0; i < array.length; i++) {
            resultStr += String.fromCharCode(array[i]);
        }
        return resultStr;
    },
    applyCanBeUsed : {
        /**
         * true if the browser accepts to use String.fromCharCode on Uint8Array
         */
        uint8array : (function () {
            try {
                return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
            } catch (e) {
                return false;
            }
        })(),
        /**
         * true if the browser accepts to use String.fromCharCode on nodejs Buffer.
         */
        nodebuffer : (function () {
            try {
                return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1;
            } catch (e) {
                return false;
            }
        })()
    }
};

/**
 * Transform an array-like object to a string.
 * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
 * @return {String} the result.
 */
function arrayLikeToString(array) {
    // Performances notes :
    // --------------------
    // String.fromCharCode.apply(null, array) is the fastest, see
    // see http://jsperf.com/converting-a-uint8array-to-a-string/2
    // but the stack is limited (and we can get huge arrays !).
    //
    // result += String.fromCharCode(array[i]); generate too many strings !
    //
    // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
    // TODO : we now have workers that split the work. Do we still need that ?
    var chunk = 65536,
        type = exports.getTypeOf(array),
        canUseApply = true;
    if (type === "uint8array") {
        canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array;
    } else if (type === "nodebuffer") {
        canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer;
    }

    if (canUseApply) {
        while (chunk > 1) {
            try {
                return arrayToStringHelper.stringifyByChunk(array, type, chunk);
            } catch (e) {
                chunk = Math.floor(chunk / 2);
            }
        }
    }

    // no apply or chunk error : slow and painful algorithm
    // default browser on android 4.*
    return arrayToStringHelper.stringifyByChar(array);
}

exports.applyFromCharCode = arrayLikeToString;


/**
 * Copy the data from an array-like to an other array-like.
 * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.
 * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.
 * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.
 */
function arrayLikeToArrayLike(arrayFrom, arrayTo) {
    for (var i = 0; i < arrayFrom.length; i++) {
        arrayTo[i] = arrayFrom[i];
    }
    return arrayTo;
}

// a matrix containing functions to transform everything into everything.
var transform = {};

// string to ?
transform["string"] = {
    "string": identity,
    "array": function(input) {
        return stringToArrayLike(input, new Array(input.length));
    },
    "arraybuffer": function(input) {
        return transform["string"]["uint8array"](input).buffer;
    },
    "uint8array": function(input) {
        return stringToArrayLike(input, new Uint8Array(input.length));
    },
    "nodebuffer": function(input) {
        return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length));
    }
};

// array to ?
transform["array"] = {
    "string": arrayLikeToString,
    "array": identity,
    "arraybuffer": function(input) {
        return (new Uint8Array(input)).buffer;
    },
    "uint8array": function(input) {
        return new Uint8Array(input);
    },
    "nodebuffer": function(input) {
        return nodejsUtils.newBufferFrom(input);
    }
};

// arraybuffer to ?
transform["arraybuffer"] = {
    "string": function(input) {
        return arrayLikeToString(new Uint8Array(input));
    },
    "array": function(input) {
        return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));
    },
    "arraybuffer": identity,
    "uint8array": function(input) {
        return new Uint8Array(input);
    },
    "nodebuffer": function(input) {
        return nodejsUtils.newBufferFrom(new Uint8Array(input));
    }
};

// uint8array to ?
transform["uint8array"] = {
    "string": arrayLikeToString,
    "array": function(input) {
        return arrayLikeToArrayLike(input, new Array(input.length));
    },
    "arraybuffer": function(input) {
        return input.buffer;
    },
    "uint8array": identity,
    "nodebuffer": function(input) {
        return nodejsUtils.newBufferFrom(input);
    }
};

// nodebuffer to ?
transform["nodebuffer"] = {
    "string": arrayLikeToString,
    "array": function(input) {
        return arrayLikeToArrayLike(input, new Array(input.length));
    },
    "arraybuffer": function(input) {
        return transform["nodebuffer"]["uint8array"](input).buffer;
    },
    "uint8array": function(input) {
        return arrayLikeToArrayLike(input, new Uint8Array(input.length));
    },
    "nodebuffer": identity
};

/**
 * Transform an input into any type.
 * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.
 * If no output type is specified, the unmodified input will be returned.
 * @param {String} outputType the output type.
 * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.
 * @throws {Error} an Error if the browser doesn't support the requested output type.
 */
exports.transformTo = function(outputType, input) {
    if (!input) {
        // undefined, null, etc
        // an empty string won't harm.
        input = "";
    }
    if (!outputType) {
        return input;
    }
    exports.checkSupport(outputType);
    var inputType = exports.getTypeOf(input);
    var result = transform[inputType][outputType](input);
    return result;
};

/**
 * Return the type of the input.
 * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.
 * @param {Object} input the input to identify.
 * @return {String} the (lowercase) type of the input.
 */
exports.getTypeOf = function(input) {
    if (typeof input === "string") {
        return "string";
    }
    if (Object.prototype.toString.call(input) === "[object Array]") {
        return "array";
    }
    if (support.nodebuffer && nodejsUtils.isBuffer(input)) {
        return "nodebuffer";
    }
    if (support.uint8array && input instanceof Uint8Array) {
        return "uint8array";
    }
    if (support.arraybuffer && input instanceof ArrayBuffer) {
        return "arraybuffer";
    }
};

/**
 * Throw an exception if the type is not supported.
 * @param {String} type the type to check.
 * @throws {Error} an Error if the browser doesn't support the requested type.
 */
exports.checkSupport = function(type) {
    var supported = support[type.toLowerCase()];
    if (!supported) {
        throw new Error(type + " is not supported by this platform");
    }
};

exports.MAX_VALUE_16BITS = 65535;
exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1

/**
 * Prettify a string read as binary.
 * @param {string} str the string to prettify.
 * @return {string} a pretty string.
 */
exports.pretty = function(str) {
    var res = '',
        code, i;
    for (i = 0; i < (str || "").length; i++) {
        code = str.charCodeAt(i);
        res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase();
    }
    return res;
};

/**
 * Defer the call of a function.
 * @param {Function} callback the function to call asynchronously.
 * @param {Array} args the arguments to give to the callback.
 */
exports.delay = function(callback, args, self) {
    setImmediate(function () {
        callback.apply(self || null, args || []);
    });
};

/**
 * Extends a prototype with an other, without calling a constructor with
 * side effects. Inspired by nodejs' `utils.inherits`
 * @param {Function} ctor the constructor to augment
 * @param {Function} superCtor the parent constructor to use
 */
exports.inherits = function (ctor, superCtor) {
    var Obj = function() {};
    Obj.prototype = superCtor.prototype;
    ctor.prototype = new Obj();
};

/**
 * Merge the objects passed as parameters into a new one.
 * @private
 * @param {...Object} var_args All objects to merge.
 * @return {Object} a new object with the data of the others.
 */
exports.extend = function() {
    var result = {}, i, attr;
    for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers
        for (attr in arguments[i]) {
            if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") {
                result[attr] = arguments[i][attr];
            }
        }
    }
    return result;
};

/**
 * Transform arbitrary content into a Promise.
 * @param {String} name a name for the content being processed.
 * @param {Object} inputData the content to process.
 * @param {Boolean} isBinary true if the content is not an unicode string
 * @param {Boolean} isOptimizedBinaryString true if the string content only has one byte per character.
 * @param {Boolean} isBase64 true if the string content is encoded with base64.
 * @return {Promise} a promise in a format usable by JSZip.
 */
exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {

    // if inputData is already a promise, this flatten it.
    var promise = external.Promise.resolve(inputData).then(function(data) {
        
        
        var isBlob = support.blob && (data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1);

        if (isBlob && typeof FileReader !== "undefined") {
            return new external.Promise(function (resolve, reject) {
                var reader = new FileReader();

                reader.onload = function(e) {
                    resolve(e.target.result);
                };
                reader.onerror = function(e) {
                    reject(e.target.error);
                };
                reader.readAsArrayBuffer(data);
            });
        } else {
            return data;
        }
    });

    return promise.then(function(data) {
        var dataType = exports.getTypeOf(data);

        if (!dataType) {
            return external.Promise.reject(
                new Error("Can't read the data of '" + name + "'. Is it " +
                          "in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")
            );
        }
        // special case : it's way easier to work with Uint8Array than with ArrayBuffer
        if (dataType === "arraybuffer") {
            data = exports.transformTo("uint8array", data);
        } else if (dataType === "string") {
            if (isBase64) {
                data = base64.decode(data);
            }
            else if (isBinary) {
                // optimizedBinaryString === true means that the file has already been filtered with a 0xFF mask
                if (isOptimizedBinaryString !== true) {
                    // this is a string, not in a base64 format.
                    // Be sure that this is a correct "binary string"
                    data = string2binary(data);
                }
            }
        }
        return data;
    });
};

},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"core-js/library/fn/set-immediate":36}],33:[function(require,module,exports){
'use strict';
var readerFor = require('./reader/readerFor');
var utils = require('./utils');
var sig = require('./signature');
var ZipEntry = require('./zipEntry');
var utf8 = require('./utf8');
var support = require('./support');
//  class ZipEntries {{{
/**
 * All the entries in the zip file.
 * @constructor
 * @param {Object} loadOptions Options for loading the stream.
 */
function ZipEntries(loadOptions) {
    this.files = [];
    this.loadOptions = loadOptions;
}
ZipEntries.prototype = {
    /**
     * Check that the reader is on the specified signature.
     * @param {string} expectedSignature the expected signature.
     * @throws {Error} if it is an other signature.
     */
    checkSignature: function(expectedSignature) {
        if (!this.reader.readAndCheckSignature(expectedSignature)) {
            this.reader.index -= 4;
            var signature = this.reader.readString(4);
            throw new Error("Corrupted zip or bug: unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")");
        }
    },
    /**
     * Check if the given signature is at the given index.
     * @param {number} askedIndex the index to check.
     * @param {string} expectedSignature the signature to expect.
     * @return {boolean} true if the signature is here, false otherwise.
     */
    isSignature: function(askedIndex, expectedSignature) {
        var currentIndex = this.reader.index;
        this.reader.setIndex(askedIndex);
        var signature = this.reader.readString(4);
        var result = signature === expectedSignature;
        this.reader.setIndex(currentIndex);
        return result;
    },
    /**
     * Read the end of the central directory.
     */
    readBlockEndOfCentral: function() {
        this.diskNumber = this.reader.readInt(2);
        this.diskWithCentralDirStart = this.reader.readInt(2);
        this.centralDirRecordsOnThisDisk = this.reader.readInt(2);
        this.centralDirRecords = this.reader.readInt(2);
        this.centralDirSize = this.reader.readInt(4);
        this.centralDirOffset = this.reader.readInt(4);

        this.zipCommentLength = this.reader.readInt(2);
        // warning : the encoding depends of the system locale
        // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.
        // On a windows machine, this field is encoded with the localized windows code page.
        var zipComment = this.reader.readData(this.zipCommentLength);
        var decodeParamType = support.uint8array ? "uint8array" : "array";
        // To get consistent behavior with the generation part, we will assume that
        // this is utf8 encoded unless specified otherwise.
        var decodeContent = utils.transformTo(decodeParamType, zipComment);
        this.zipComment = this.loadOptions.decodeFileName(decodeContent);
    },
    /**
     * Read the end of the Zip 64 central directory.
     * Not merged with the method readEndOfCentral :
     * The end of central can coexist with its Zip64 brother,
     * I don't want to read the wrong number of bytes !
     */
    readBlockZip64EndOfCentral: function() {
        this.zip64EndOfCentralSize = this.reader.readInt(8);
        this.reader.skip(4);
        // this.versionMadeBy = this.reader.readString(2);
        // this.versionNeeded = this.reader.readInt(2);
        this.diskNumber = this.reader.readInt(4);
        this.diskWithCentralDirStart = this.reader.readInt(4);
        this.centralDirRecordsOnThisDisk = this.reader.readInt(8);
        this.centralDirRecords = this.reader.readInt(8);
        this.centralDirSize = this.reader.readInt(8);
        this.centralDirOffset = this.reader.readInt(8);

        this.zip64ExtensibleData = {};
        var extraDataSize = this.zip64EndOfCentralSize - 44,
            index = 0,
            extraFieldId,
            extraFieldLength,
            extraFieldValue;
        while (index < extraDataSize) {
            extraFieldId = this.reader.readInt(2);
            extraFieldLength = this.reader.readInt(4);
            extraFieldValue = this.reader.readData(extraFieldLength);
            this.zip64ExtensibleData[extraFieldId] = {
                id: extraFieldId,
                length: extraFieldLength,
                value: extraFieldValue
            };
        }
    },
    /**
     * Read the end of the Zip 64 central directory locator.
     */
    readBlockZip64EndOfCentralLocator: function() {
        this.diskWithZip64CentralDirStart = this.reader.readInt(4);
        this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);
        this.disksCount = this.reader.readInt(4);
        if (this.disksCount > 1) {
            throw new Error("Multi-volumes zip are not supported");
        }
    },
    /**
     * Read the local files, based on the offset read in the central part.
     */
    readLocalFiles: function() {
        var i, file;
        for (i = 0; i < this.files.length; i++) {
            file = this.files[i];
            this.reader.setIndex(file.localHeaderOffset);
            this.checkSignature(sig.LOCAL_FILE_HEADER);
            file.readLocalPart(this.reader);
            file.handleUTF8();
            file.processAttributes();
        }
    },
    /**
     * Read the central directory.
     */
    readCentralDir: function() {
        var file;

        this.reader.setIndex(this.centralDirOffset);
        while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) {
            file = new ZipEntry({
                zip64: this.zip64
            }, this.loadOptions);
            file.readCentralPart(this.reader);
            this.files.push(file);
        }

        if (this.centralDirRecords !== this.files.length) {
            if (this.centralDirRecords !== 0 && this.files.length === 0) {
                // We expected some records but couldn't find ANY.
                // This is really suspicious, as if something went wrong.
                throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
            } else {
                // We found some records but not all.
                // Something is wrong but we got something for the user: no error here.
                // console.warn("expected", this.centralDirRecords, "records in central dir, got", this.files.length);
            }
        }
    },
    /**
     * Read the end of central directory.
     */
    readEndOfCentral: function() {
        var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
        if (offset < 0) {
            // Check if the content is a truncated zip or complete garbage.
            // A "LOCAL_FILE_HEADER" is not required at the beginning (auto
            // extractible zip for example) but it can give a good hint.
            // If an ajax request was used without responseType, we will also
            // get unreadable data.
            var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER);

            if (isGarbage) {
                throw new Error("Can't find end of central directory : is this a zip file ? " +
                                "If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");
            } else {
                throw new Error("Corrupted zip: can't find end of central directory");
            }

        }
        this.reader.setIndex(offset);
        var endOfCentralDirOffset = offset;
        this.checkSignature(sig.CENTRAL_DIRECTORY_END);
        this.readBlockEndOfCentral();


        /* extract from the zip spec :
            4)  If one of the fields in the end of central directory
                record is too small to hold required data, the field
                should be set to -1 (0xFFFF or 0xFFFFFFFF) and the
                ZIP64 format record should be created.
            5)  The end of central directory record and the
                Zip64 end of central directory locator record must
                reside on the same disk when splitting or spanning
                an archive.
         */
        if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {
            this.zip64 = true;

            /*
            Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from
            the zip file can fit into a 32bits integer. This cannot be solved : JavaScript represents
            all numbers as 64-bit double precision IEEE 754 floating point numbers.
            So, we have 53bits for integers and bitwise operations treat everything as 32bits.
            see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators
            and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5
            */

            // should look for a zip64 EOCD locator
            offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
            if (offset < 0) {
                throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
            }
            this.reader.setIndex(offset);
            this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
            this.readBlockZip64EndOfCentralLocator();

            // now the zip64 EOCD record
            if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) {
                // console.warn("ZIP64 end of central directory not where expected.");
                this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
                if (this.relativeOffsetEndOfZip64CentralDir < 0) {
                    throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
                }
            }
            this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);
            this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
            this.readBlockZip64EndOfCentral();
        }

        var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize;
        if (this.zip64) {
            expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator
            expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize;
        }

        var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset;

        if (extraBytes > 0) {
            // console.warn(extraBytes, "extra bytes at beginning or within zipfile");
            if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) {
                // The offsets seem wrong, but we have something at the specified offset.
                // So… we keep it.
            } else {
                // the offset is wrong, update the "zero" of the reader
                // this happens if data has been prepended (crx files for example)
                this.reader.zero = extraBytes;
            }
        } else if (extraBytes < 0) {
            throw new Error("Corrupted zip: missing " + Math.abs(extraBytes) + " bytes.");
        }
    },
    prepareReader: function(data) {
        this.reader = readerFor(data);
    },
    /**
     * Read a zip file and create ZipEntries.
     * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.
     */
    load: function(data) {
        this.prepareReader(data);
        this.readEndOfCentral();
        this.readCentralDir();
        this.readLocalFiles();
    }
};
// }}} end of ZipEntries
module.exports = ZipEntries;

},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(require,module,exports){
'use strict';
var readerFor = require('./reader/readerFor');
var utils = require('./utils');
var CompressedObject = require('./compressedObject');
var crc32fn = require('./crc32');
var utf8 = require('./utf8');
var compressions = require('./compressions');
var support = require('./support');

var MADE_BY_DOS = 0x00;
var MADE_BY_UNIX = 0x03;

/**
 * Find a compression registered in JSZip.
 * @param {string} compressionMethod the method magic to find.
 * @return {Object|null} the JSZip compression object, null if none found.
 */
var findCompression = function(compressionMethod) {
    for (var method in compressions) {
        if (!compressions.hasOwnProperty(method)) {
            continue;
        }
        if (compressions[method].magic === compressionMethod) {
            return compressions[method];
        }
    }
    return null;
};

// class ZipEntry {{{
/**
 * An entry in the zip file.
 * @constructor
 * @param {Object} options Options of the current file.
 * @param {Object} loadOptions Options for loading the stream.
 */
function ZipEntry(options, loadOptions) {
    this.options = options;
    this.loadOptions = loadOptions;
}
ZipEntry.prototype = {
    /**
     * say if the file is encrypted.
     * @return {boolean} true if the file is encrypted, false otherwise.
     */
    isEncrypted: function() {
        // bit 1 is set
        return (this.bitFlag & 0x0001) === 0x0001;
    },
    /**
     * say if the file has utf-8 filename/comment.
     * @return {boolean} true if the filename/comment is in utf-8, false otherwise.
     */
    useUTF8: function() {
        // bit 11 is set
        return (this.bitFlag & 0x0800) === 0x0800;
    },
    /**
     * Read the local part of a zip file and add the info in this object.
     * @param {DataReader} reader the reader to use.
     */
    readLocalPart: function(reader) {
        var compression, localExtraFieldsLength;

        // we already know everything from the central dir !
        // If the central dir data are false, we are doomed.
        // On the bright side, the local part is scary  : zip64, data descriptors, both, etc.
        // The less data we get here, the more reliable this should be.
        // Let's skip the whole header and dash to the data !
        reader.skip(22);
        // in some zip created on windows, the filename stored in the central dir contains \ instead of /.
        // Strangely, the filename here is OK.
        // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes
        // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators...
        // Search "unzip mismatching "local" filename continuing with "central" filename version" on
        // the internet.
        //
        // I think I see the logic here : the central directory is used to display
        // content and the local directory is used to extract the files. Mixing / and \
        // may be used to display \ to windows users and use / when extracting the files.
        // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394
        this.fileNameLength = reader.readInt(2);
        localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir
        // the fileName is stored as binary data, the handleUTF8 method will take care of the encoding.
        this.fileName = reader.readData(this.fileNameLength);
        reader.skip(localExtraFieldsLength);

        if (this.compressedSize === -1 || this.uncompressedSize === -1) {
            throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)");
        }

        compression = findCompression(this.compressionMethod);
        if (compression === null) { // no compression found
            throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")");
        }
        this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize));
    },

    /**
     * Read the central part of a zip file and add the info in this object.
     * @param {DataReader} reader the reader to use.
     */
    readCentralPart: function(reader) {
        this.versionMadeBy = reader.readInt(2);
        reader.skip(2);
        // this.versionNeeded = reader.readInt(2);
        this.bitFlag = reader.readInt(2);
        this.compressionMethod = reader.readString(2);
        this.date = reader.readDate();
        this.crc32 = reader.readInt(4);
        this.compressedSize = reader.readInt(4);
        this.uncompressedSize = reader.readInt(4);
        var fileNameLength = reader.readInt(2);
        this.extraFieldsLength = reader.readInt(2);
        this.fileCommentLength = reader.readInt(2);
        this.diskNumberStart = reader.readInt(2);
        this.internalFileAttributes = reader.readInt(2);
        this.externalFileAttributes = reader.readInt(4);
        this.localHeaderOffset = reader.readInt(4);

        if (this.isEncrypted()) {
            throw new Error("Encrypted zip are not supported");
        }

        // will be read in the local part, see the comments there
        reader.skip(fileNameLength);
        this.readExtraFields(reader);
        this.parseZIP64ExtraField(reader);
        this.fileComment = reader.readData(this.fileCommentLength);
    },

    /**
     * Parse the external file attributes and get the unix/dos permissions.
     */
    processAttributes: function () {
        this.unixPermissions = null;
        this.dosPermissions = null;
        var madeBy = this.versionMadeBy >> 8;

        // Check if we have the DOS directory flag set.
        // We look for it in the DOS and UNIX permissions
        // but some unknown platform could set it as a compatibility flag.
        this.dir = this.externalFileAttributes & 0x0010 ? true : false;

        if(madeBy === MADE_BY_DOS) {
            // first 6 bits (0 to 5)
            this.dosPermissions = this.externalFileAttributes & 0x3F;
        }

        if(madeBy === MADE_BY_UNIX) {
            this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF;
            // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8);
        }

        // fail safe : if the name ends with a / it probably means a folder
        if (!this.dir && this.fileNameStr.slice(-1) === '/') {
            this.dir = true;
        }
    },

    /**
     * Parse the ZIP64 extra field and merge the info in the current ZipEntry.
     * @param {DataReader} reader the reader to use.
     */
    parseZIP64ExtraField: function(reader) {

        if (!this.extraFields[0x0001]) {
            return;
        }

        // should be something, preparing the extra reader
        var extraReader = readerFor(this.extraFields[0x0001].value);

        // I really hope that these 64bits integer can fit in 32 bits integer, because js
        // won't let us have more.
        if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {
            this.uncompressedSize = extraReader.readInt(8);
        }
        if (this.compressedSize === utils.MAX_VALUE_32BITS) {
            this.compressedSize = extraReader.readInt(8);
        }
        if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {
            this.localHeaderOffset = extraReader.readInt(8);
        }
        if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {
            this.diskNumberStart = extraReader.readInt(4);
        }
    },
    /**
     * Read the central part of a zip file and add the info in this object.
     * @param {DataReader} reader the reader to use.
     */
    readExtraFields: function(reader) {
        var end = reader.index + this.extraFieldsLength,
            extraFieldId,
            extraFieldLength,
            extraFieldValue;

        if (!this.extraFields) {
            this.extraFields = {};
        }

        while (reader.index < end) {
            extraFieldId = reader.readInt(2);
            extraFieldLength = reader.readInt(2);
            extraFieldValue = reader.readData(extraFieldLength);

            this.extraFields[extraFieldId] = {
                id: extraFieldId,
                length: extraFieldLength,
                value: extraFieldValue
            };
        }
    },
    /**
     * Apply an UTF8 transformation if needed.
     */
    handleUTF8: function() {
        var decodeParamType = support.uint8array ? "uint8array" : "array";
        if (this.useUTF8()) {
            this.fileNameStr = utf8.utf8decode(this.fileName);
            this.fileCommentStr = utf8.utf8decode(this.fileComment);
        } else {
            var upath = this.findExtraFieldUnicodePath();
            if (upath !== null) {
                this.fileNameStr = upath;
            } else {
                // ASCII text or unsupported code page
                var fileNameByteArray =  utils.transformTo(decodeParamType, this.fileName);
                this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);
            }

            var ucomment = this.findExtraFieldUnicodeComment();
            if (ucomment !== null) {
                this.fileCommentStr = ucomment;
            } else {
                // ASCII text or unsupported code page
                var commentByteArray =  utils.transformTo(decodeParamType, this.fileComment);
                this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);
            }
        }
    },

    /**
     * Find the unicode path declared in the extra field, if any.
     * @return {String} the unicode path, null otherwise.
     */
    findExtraFieldUnicodePath: function() {
        var upathField = this.extraFields[0x7075];
        if (upathField) {
            var extraReader = readerFor(upathField.value);

            // wrong version
            if (extraReader.readInt(1) !== 1) {
                return null;
            }

            // the crc of the filename changed, this field is out of date.
            if (crc32fn(this.fileName) !== extraReader.readInt(4)) {
                return null;
            }

            return utf8.utf8decode(extraReader.readData(upathField.length - 5));
        }
        return null;
    },

    /**
     * Find the unicode comment declared in the extra field, if any.
     * @return {String} the unicode comment, null otherwise.
     */
    findExtraFieldUnicodeComment: function() {
        var ucommentField = this.extraFields[0x6375];
        if (ucommentField) {
            var extraReader = readerFor(ucommentField.value);

            // wrong version
            if (extraReader.readInt(1) !== 1) {
                return null;
            }

            // the crc of the comment changed, this field is out of date.
            if (crc32fn(this.fileComment) !== extraReader.readInt(4)) {
                return null;
            }

            return utf8.utf8decode(extraReader.readData(ucommentField.length - 5));
        }
        return null;
    }
};
module.exports = ZipEntry;

},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(require,module,exports){
'use strict';

var StreamHelper = require('./stream/StreamHelper');
var DataWorker = require('./stream/DataWorker');
var utf8 = require('./utf8');
var CompressedObject = require('./compressedObject');
var GenericWorker = require('./stream/GenericWorker');

/**
 * A simple object representing a file in the zip file.
 * @constructor
 * @param {string} name the name of the file
 * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
 * @param {Object} options the options of the file
 */
var ZipObject = function(name, data, options) {
    this.name = name;
    this.dir = options.dir;
    this.date = options.date;
    this.comment = options.comment;
    this.unixPermissions = options.unixPermissions;
    this.dosPermissions = options.dosPermissions;

    this._data = data;
    this._dataBinary = options.binary;
    // keep only the compression
    this.options = {
        compression : options.compression,
        compressionOptions : options.compressionOptions
    };
};

ZipObject.prototype = {
    /**
     * Create an internal stream for the content of this object.
     * @param {String} type the type of each chunk.
     * @return StreamHelper the stream.
     */
    internalStream: function (type) {
        var result = null, outputType = "string";
        try {
            if (!type) {
                throw new Error("No output type specified.");
            }
            outputType = type.toLowerCase();
            var askUnicodeString = outputType === "string" || outputType === "text";
            if (outputType === "binarystring" || outputType === "text") {
                outputType = "string";
            }
            result = this._decompressWorker();

            var isUnicodeString = !this._dataBinary;

            if (isUnicodeString && !askUnicodeString) {
                result = result.pipe(new utf8.Utf8EncodeWorker());
            }
            if (!isUnicodeString && askUnicodeString) {
                result = result.pipe(new utf8.Utf8DecodeWorker());
            }
        } catch (e) {
            result = new GenericWorker("error");
            result.error(e);
        }

        return new StreamHelper(result, outputType, "");
    },

    /**
     * Prepare the content in the asked type.
     * @param {String} type the type of the result.
     * @param {Function} onUpdate a function to call on each internal update.
     * @return Promise the promise of the result.
     */
    async: function (type, onUpdate) {
        return this.internalStream(type).accumulate(onUpdate);
    },

    /**
     * Prepare the content as a nodejs stream.
     * @param {String} type the type of each chunk.
     * @param {Function} onUpdate a function to call on each internal update.
     * @return Stream the stream.
     */
    nodeStream: function (type, onUpdate) {
        return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate);
    },

    /**
     * Return a worker for the compressed content.
     * @private
     * @param {Object} compression the compression object to use.
     * @param {Object} compressionOptions the options to use when compressing.
     * @return Worker the worker.
     */
    _compressWorker: function (compression, compressionOptions) {
        if (
            this._data instanceof CompressedObject &&
            this._data.compression.magic === compression.magic
        ) {
            return this._data.getCompressedWorker();
        } else {
            var result = this._decompressWorker();
            if(!this._dataBinary) {
                result = result.pipe(new utf8.Utf8EncodeWorker());
            }
            return CompressedObject.createWorkerFrom(result, compression, compressionOptions);
        }
    },
    /**
     * Return a worker for the decompressed content.
     * @private
     * @return Worker the worker.
     */
    _decompressWorker : function () {
        if (this._data instanceof CompressedObject) {
            return this._data.getContentWorker();
        } else if (this._data instanceof GenericWorker) {
            return this._data;
        } else {
            return new DataWorker(this._data);
        }
    }
};

var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"];
var removedFn = function () {
    throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
};

for(var i = 0; i < removedMethods.length; i++) {
    ZipObject.prototype[removedMethods[i]] = removedFn;
}
module.exports = ZipObject;

},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(require,module,exports){
require('../modules/web.immediate');
module.exports = require('../modules/_core').setImmediate;
},{"../modules/_core":40,"../modules/web.immediate":56}],37:[function(require,module,exports){
module.exports = function(it){
  if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  return it;
};
},{}],38:[function(require,module,exports){
var isObject = require('./_is-object');
module.exports = function(it){
  if(!isObject(it))throw TypeError(it + ' is not an object!');
  return it;
};
},{"./_is-object":51}],39:[function(require,module,exports){
var toString = {}.toString;

module.exports = function(it){
  return toString.call(it).slice(8, -1);
};
},{}],40:[function(require,module,exports){
var core = module.exports = {version: '2.3.0'};
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
},{}],41:[function(require,module,exports){
// optional / simple context binding
var aFunction = require('./_a-function');
module.exports = function(fn, that, length){
  aFunction(fn);
  if(that === undefined)return fn;
  switch(length){
    case 1: return function(a){
      return fn.call(that, a);
    };
    case 2: return function(a, b){
      return fn.call(that, a, b);
    };
    case 3: return function(a, b, c){
      return fn.call(that, a, b, c);
    };
  }
  return function(/* ...args */){
    return fn.apply(that, arguments);
  };
};
},{"./_a-function":37}],42:[function(require,module,exports){
// Thank's IE8 for his funny defineProperty
module.exports = !require('./_fails')(function(){
  return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
});
},{"./_fails":45}],43:[function(require,module,exports){
var isObject = require('./_is-object')
  , document = require('./_global').document
  // in old IE typeof document.createElement is 'object'
  , is = isObject(document) && isObject(document.createElement);
module.exports = function(it){
  return is ? document.createElement(it) : {};
};
},{"./_global":46,"./_is-object":51}],44:[function(require,module,exports){
var global    = require('./_global')
  , core      = require('./_core')
  , ctx       = require('./_ctx')
  , hide      = require('./_hide')
  , PROTOTYPE = 'prototype';

var $export = function(type, name, source){
  var IS_FORCED = type & $export.F
    , IS_GLOBAL = type & $export.G
    , IS_STATIC = type & $export.S
    , IS_PROTO  = type & $export.P
    , IS_BIND   = type & $export.B
    , IS_WRAP   = type & $export.W
    , exports   = IS_GLOBAL ? core : core[name] || (core[name] = {})
    , expProto  = exports[PROTOTYPE]
    , target    = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
    , key, own, out;
  if(IS_GLOBAL)source = name;
  for(key in source){
    // contains in native
    own = !IS_FORCED && target && target[key] !== undefined;
    if(own && key in exports)continue;
    // export native or passed
    out = own ? target[key] : source[key];
    // prevent global pollution for namespaces
    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
    // bind timers to global for call from export context
    : IS_BIND && own ? ctx(out, global)
    // wrap global constructors for prevent change them in library
    : IS_WRAP && target[key] == out ? (function(C){
      var F = function(a, b, c){
        if(this instanceof C){
          switch(arguments.length){
            case 0: return new C;
            case 1: return new C(a);
            case 2: return new C(a, b);
          } return new C(a, b, c);
        } return C.apply(this, arguments);
      };
      F[PROTOTYPE] = C[PROTOTYPE];
      return F;
    // make static versions for prototype methods
    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
    if(IS_PROTO){
      (exports.virtual || (exports.virtual = {}))[key] = out;
      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
      if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
    }
  }
};
// type bitmap
$export.F = 1;   // forced
$export.G = 2;   // global
$export.S = 4;   // static
$export.P = 8;   // proto
$export.B = 16;  // bind
$export.W = 32;  // wrap
$export.U = 64;  // safe
$export.R = 128; // real proto method for `library` 
module.exports = $export;
},{"./_core":40,"./_ctx":41,"./_global":46,"./_hide":47}],45:[function(require,module,exports){
module.exports = function(exec){
  try {
    return !!exec();
  } catch(e){
    return true;
  }
};
},{}],46:[function(require,module,exports){
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
  ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
},{}],47:[function(require,module,exports){
var dP         = require('./_object-dp')
  , createDesc = require('./_property-desc');
module.exports = require('./_descriptors') ? function(object, key, value){
  return dP.f(object, key, createDesc(1, value));
} : function(object, key, value){
  object[key] = value;
  return object;
};
},{"./_descriptors":42,"./_object-dp":52,"./_property-desc":53}],48:[function(require,module,exports){
module.exports = require('./_global').document && document.documentElement;
},{"./_global":46}],49:[function(require,module,exports){
module.exports = !require('./_descriptors') && !require('./_fails')(function(){
  return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;
});
},{"./_descriptors":42,"./_dom-create":43,"./_fails":45}],50:[function(require,module,exports){
// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function(fn, args, that){
  var un = that === undefined;
  switch(args.length){
    case 0: return un ? fn()
                      : fn.call(that);
    case 1: return un ? fn(args[0])
                      : fn.call(that, args[0]);
    case 2: return un ? fn(args[0], args[1])
                      : fn.call(that, args[0], args[1]);
    case 3: return un ? fn(args[0], args[1], args[2])
                      : fn.call(that, args[0], args[1], args[2]);
    case 4: return un ? fn(args[0], args[1], args[2], args[3])
                      : fn.call(that, args[0], args[1], args[2], args[3]);
  } return              fn.apply(that, args);
};
},{}],51:[function(require,module,exports){
module.exports = function(it){
  return typeof it === 'object' ? it !== null : typeof it === 'function';
};
},{}],52:[function(require,module,exports){
var anObject       = require('./_an-object')
  , IE8_DOM_DEFINE = require('./_ie8-dom-define')
  , toPrimitive    = require('./_to-primitive')
  , dP             = Object.defineProperty;

exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){
  anObject(O);
  P = toPrimitive(P, true);
  anObject(Attributes);
  if(IE8_DOM_DEFINE)try {
    return dP(O, P, Attributes);
  } catch(e){ /* empty */ }
  if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
  if('value' in Attributes)O[P] = Attributes.value;
  return O;
};
},{"./_an-object":38,"./_descriptors":42,"./_ie8-dom-define":49,"./_to-primitive":55}],53:[function(require,module,exports){
module.exports = function(bitmap, value){
  return {
    enumerable  : !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable    : !(bitmap & 4),
    value       : value
  };
};
},{}],54:[function(require,module,exports){
var ctx                = require('./_ctx')
  , invoke             = require('./_invoke')
  , html               = require('./_html')
  , cel                = require('./_dom-create')
  , global             = require('./_global')
  , process            = global.process
  , setTask            = global.setImmediate
  , clearTask          = global.clearImmediate
  , MessageChannel     = global.MessageChannel
  , counter            = 0
  , queue              = {}
  , ONREADYSTATECHANGE = 'onreadystatechange'
  , defer, channel, port;
var run = function(){
  var id = +this;
  if(queue.hasOwnProperty(id)){
    var fn = queue[id];
    delete queue[id];
    fn();
  }
};
var listener = function(event){
  run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if(!setTask || !clearTask){
  setTask = function setImmediate(fn){
    var args = [], i = 1;
    while(arguments.length > i)args.push(arguments[i++]);
    queue[++counter] = function(){
      invoke(typeof fn == 'function' ? fn : Function(fn), args);
    };
    defer(counter);
    return counter;
  };
  clearTask = function clearImmediate(id){
    delete queue[id];
  };
  // Node.js 0.8-
  if(require('./_cof')(process) == 'process'){
    defer = function(id){
      process.nextTick(ctx(run, id, 1));
    };
  // Browsers with MessageChannel, includes WebWorkers
  } else if(MessageChannel){
    channel = new MessageChannel;
    port    = channel.port2;
    channel.port1.onmessage = listener;
    defer = ctx(port.postMessage, port, 1);
  // Browsers with postMessage, skip WebWorkers
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
    defer = function(id){
      global.postMessage(id + '', '*');
    };
    global.addEventListener('message', listener, false);
  // IE8-
  } else if(ONREADYSTATECHANGE in cel('script')){
    defer = function(id){
      html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
        html.removeChild(this);
        run.call(id);
      };
    };
  // Rest old browsers
  } else {
    defer = function(id){
      setTimeout(ctx(run, id, 1), 0);
    };
  }
}
module.exports = {
  set:   setTask,
  clear: clearTask
};
},{"./_cof":39,"./_ctx":41,"./_dom-create":43,"./_global":46,"./_html":48,"./_invoke":50}],55:[function(require,module,exports){
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = require('./_is-object');
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function(it, S){
  if(!isObject(it))return it;
  var fn, val;
  if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
  if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  throw TypeError("Can't convert object to primitive value");
};
},{"./_is-object":51}],56:[function(require,module,exports){
var $export = require('./_export')
  , $task   = require('./_task');
$export($export.G + $export.B, {
  setImmediate:   $task.set,
  clearImmediate: $task.clear
});
},{"./_export":44,"./_task":54}],57:[function(require,module,exports){
(function (global){
'use strict';
var Mutation = global.MutationObserver || global.WebKitMutationObserver;

var scheduleDrain;

{
  if (Mutation) {
    var called = 0;
    var observer = new Mutation(nextTick);
    var element = global.document.createTextNode('');
    observer.observe(element, {
      characterData: true
    });
    scheduleDrain = function () {
      element.data = (called = ++called % 2);
    };
  } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {
    var channel = new global.MessageChannel();
    channel.port1.onmessage = nextTick;
    scheduleDrain = function () {
      channel.port2.postMessage(0);
    };
  } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {
    scheduleDrain = function () {

      // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
      // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
      var scriptEl = global.document.createElement('script');
      scriptEl.onreadystatechange = function () {
        nextTick();

        scriptEl.onreadystatechange = null;
        scriptEl.parentNode.removeChild(scriptEl);
        scriptEl = null;
      };
      global.document.documentElement.appendChild(scriptEl);
    };
  } else {
    scheduleDrain = function () {
      setTimeout(nextTick, 0);
    };
  }
}

var draining;
var queue = [];
//named nextTick for less confusing stack traces
function nextTick() {
  draining = true;
  var i, oldQueue;
  var len = queue.length;
  while (len) {
    oldQueue = queue;
    queue = [];
    i = -1;
    while (++i < len) {
      oldQueue[i]();
    }
    len = queue.length;
  }
  draining = false;
}

module.exports = immediate;
function immediate(task) {
  if (queue.push(task) === 1 && !draining) {
    scheduleDrain();
  }
}

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],58:[function(require,module,exports){
'use strict';
var immediate = require('immediate');

/* istanbul ignore next */
function INTERNAL() {}

var handlers = {};

var REJECTED = ['REJECTED'];
var FULFILLED = ['FULFILLED'];
var PENDING = ['PENDING'];

module.exports = Promise;

function Promise(resolver) {
  if (typeof resolver !== 'function') {
    throw new TypeError('resolver must be a function');
  }
  this.state = PENDING;
  this.queue = [];
  this.outcome = void 0;
  if (resolver !== INTERNAL) {
    safelyResolveThenable(this, resolver);
  }
}

Promise.prototype["catch"] = function (onRejected) {
  return this.then(null, onRejected);
};
Promise.prototype.then = function (onFulfilled, onRejected) {
  if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||
    typeof onRejected !== 'function' && this.state === REJECTED) {
    return this;
  }
  var promise = new this.constructor(INTERNAL);
  if (this.state !== PENDING) {
    var resolver = this.state === FULFILLED ? onFulfilled : onRejected;
    unwrap(promise, resolver, this.outcome);
  } else {
    this.queue.push(new QueueItem(promise, onFulfilled, onRejected));
  }

  return promise;
};
function QueueItem(promise, onFulfilled, onRejected) {
  this.promise = promise;
  if (typeof onFulfilled === 'function') {
    this.onFulfilled = onFulfilled;
    this.callFulfilled = this.otherCallFulfilled;
  }
  if (typeof onRejected === 'function') {
    this.onRejected = onRejected;
    this.callRejected = this.otherCallRejected;
  }
}
QueueItem.prototype.callFulfilled = function (value) {
  handlers.resolve(this.promise, value);
};
QueueItem.prototype.otherCallFulfilled = function (value) {
  unwrap(this.promise, this.onFulfilled, value);
};
QueueItem.prototype.callRejected = function (value) {
  handlers.reject(this.promise, value);
};
QueueItem.prototype.otherCallRejected = function (value) {
  unwrap(this.promise, this.onRejected, value);
};

function unwrap(promise, func, value) {
  immediate(function () {
    var returnValue;
    try {
      returnValue = func(value);
    } catch (e) {
      return handlers.reject(promise, e);
    }
    if (returnValue === promise) {
      handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));
    } else {
      handlers.resolve(promise, returnValue);
    }
  });
}

handlers.resolve = function (self, value) {
  var result = tryCatch(getThen, value);
  if (result.status === 'error') {
    return handlers.reject(self, result.value);
  }
  var thenable = result.value;

  if (thenable) {
    safelyResolveThenable(self, thenable);
  } else {
    self.state = FULFILLED;
    self.outcome = value;
    var i = -1;
    var len = self.queue.length;
    while (++i < len) {
      self.queue[i].callFulfilled(value);
    }
  }
  return self;
};
handlers.reject = function (self, error) {
  self.state = REJECTED;
  self.outcome = error;
  var i = -1;
  var len = self.queue.length;
  while (++i < len) {
    self.queue[i].callRejected(error);
  }
  return self;
};

function getThen(obj) {
  // Make sure we only access the accessor once as required by the spec
  var then = obj && obj.then;
  if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {
    return function appyThen() {
      then.apply(obj, arguments);
    };
  }
}

function safelyResolveThenable(self, thenable) {
  // Either fulfill, reject or reject with error
  var called = false;
  function onError(value) {
    if (called) {
      return;
    }
    called = true;
    handlers.reject(self, value);
  }

  function onSuccess(value) {
    if (called) {
      return;
    }
    called = true;
    handlers.resolve(self, value);
  }

  function tryToUnwrap() {
    thenable(onSuccess, onError);
  }

  var result = tryCatch(tryToUnwrap);
  if (result.status === 'error') {
    onError(result.value);
  }
}

function tryCatch(func, value) {
  var out = {};
  try {
    out.value = func(value);
    out.status = 'success';
  } catch (e) {
    out.status = 'error';
    out.value = e;
  }
  return out;
}

Promise.resolve = resolve;
function resolve(value) {
  if (value instanceof this) {
    return value;
  }
  return handlers.resolve(new this(INTERNAL), value);
}

Promise.reject = reject;
function reject(reason) {
  var promise = new this(INTERNAL);
  return handlers.reject(promise, reason);
}

Promise.all = all;
function all(iterable) {
  var self = this;
  if (Object.prototype.toString.call(iterable) !== '[object Array]') {
    return this.reject(new TypeError('must be an array'));
  }

  var len = iterable.length;
  var called = false;
  if (!len) {
    return this.resolve([]);
  }

  var values = new Array(len);
  var resolved = 0;
  var i = -1;
  var promise = new this(INTERNAL);

  while (++i < len) {
    allResolver(iterable[i], i);
  }
  return promise;
  function allResolver(value, i) {
    self.resolve(value).then(resolveFromAll, function (error) {
      if (!called) {
        called = true;
        handlers.reject(promise, error);
      }
    });
    function resolveFromAll(outValue) {
      values[i] = outValue;
      if (++resolved === len && !called) {
        called = true;
        handlers.resolve(promise, values);
      }
    }
  }
}

Promise.race = race;
function race(iterable) {
  var self = this;
  if (Object.prototype.toString.call(iterable) !== '[object Array]') {
    return this.reject(new TypeError('must be an array'));
  }

  var len = iterable.length;
  var called = false;
  if (!len) {
    return this.resolve([]);
  }

  var i = -1;
  var promise = new this(INTERNAL);

  while (++i < len) {
    resolver(iterable[i]);
  }
  return promise;
  function resolver(value) {
    self.resolve(value).then(function (response) {
      if (!called) {
        called = true;
        handlers.resolve(promise, response);
      }
    }, function (error) {
      if (!called) {
        called = true;
        handlers.reject(promise, error);
      }
    });
  }
}

},{"immediate":57}],59:[function(require,module,exports){
// Top level file is just a mixin of submodules & constants
'use strict';

var assign    = require('./lib/utils/common').assign;

var deflate   = require('./lib/deflate');
var inflate   = require('./lib/inflate');
var constants = require('./lib/zlib/constants');

var pako = {};

assign(pako, deflate, inflate, constants);

module.exports = pako;

},{"./lib/deflate":60,"./lib/inflate":61,"./lib/utils/common":62,"./lib/zlib/constants":65}],60:[function(require,module,exports){
'use strict';


var zlib_deflate = require('./zlib/deflate');
var utils        = require('./utils/common');
var strings      = require('./utils/strings');
var msg          = require('./zlib/messages');
var ZStream      = require('./zlib/zstream');

var toString = Object.prototype.toString;

/* Public constants ==========================================================*/
/* ===========================================================================*/

var Z_NO_FLUSH      = 0;
var Z_FINISH        = 4;

var Z_OK            = 0;
var Z_STREAM_END    = 1;
var Z_SYNC_FLUSH    = 2;

var Z_DEFAULT_COMPRESSION = -1;

var Z_DEFAULT_STRATEGY    = 0;

var Z_DEFLATED  = 8;

/* ===========================================================================*/


/**
 * class Deflate
 *
 * Generic JS-style wrapper for zlib calls. If you don't need
 * streaming behaviour - use more simple functions: [[deflate]],
 * [[deflateRaw]] and [[gzip]].
 **/

/* internal
 * Deflate.chunks -> Array
 *
 * Chunks of output data, if [[Deflate#onData]] not overriden.
 **/

/**
 * Deflate.result -> Uint8Array|Array
 *
 * Compressed result, generated by default [[Deflate#onData]]
 * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
 * (call [[Deflate#push]] with `Z_FINISH` / `true` param)  or if you
 * push a chunk with explicit flush (call [[Deflate#push]] with
 * `Z_SYNC_FLUSH` param).
 **/

/**
 * Deflate.err -> Number
 *
 * Error code after deflate finished. 0 (Z_OK) on success.
 * You will not need it in real life, because deflate errors
 * are possible only on wrong options or bad `onData` / `onEnd`
 * custom handlers.
 **/

/**
 * Deflate.msg -> String
 *
 * Error message, if [[Deflate.err]] != 0
 **/


/**
 * new Deflate(options)
 * - options (Object): zlib deflate options.
 *
 * Creates new deflator instance with specified params. Throws exception
 * on bad params. Supported options:
 *
 * - `level`
 * - `windowBits`
 * - `memLevel`
 * - `strategy`
 * - `dictionary`
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Additional options, for internal needs:
 *
 * - `chunkSize` - size of generated data chunks (16K by default)
 * - `raw` (Boolean) - do raw deflate
 * - `gzip` (Boolean) - create gzip wrapper
 * - `to` (String) - if equal to 'string', then result will be "binary string"
 *    (each char code [0..255])
 * - `header` (Object) - custom header for gzip
 *   - `text` (Boolean) - true if compressed data believed to be text
 *   - `time` (Number) - modification time, unix timestamp
 *   - `os` (Number) - operation system code
 *   - `extra` (Array) - array of bytes with extra data (max 65536)
 *   - `name` (String) - file name (binary string)
 *   - `comment` (String) - comment (binary string)
 *   - `hcrc` (Boolean) - true if header crc should be added
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
 *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
 *
 * var deflate = new pako.Deflate({ level: 3});
 *
 * deflate.push(chunk1, false);
 * deflate.push(chunk2, true);  // true -> last chunk
 *
 * if (deflate.err) { throw new Error(deflate.err); }
 *
 * console.log(deflate.result);
 * ```
 **/
function Deflate(options) {
  if (!(this instanceof Deflate)) return new Deflate(options);

  this.options = utils.assign({
    level: Z_DEFAULT_COMPRESSION,
    method: Z_DEFLATED,
    chunkSize: 16384,
    windowBits: 15,
    memLevel: 8,
    strategy: Z_DEFAULT_STRATEGY,
    to: ''
  }, options || {});

  var opt = this.options;

  if (opt.raw && (opt.windowBits > 0)) {
    opt.windowBits = -opt.windowBits;
  }

  else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
    opt.windowBits += 16;
  }

  this.err    = 0;      // error code, if happens (0 = Z_OK)
  this.msg    = '';     // error message
  this.ended  = false;  // used to avoid multiple onEnd() calls
  this.chunks = [];     // chunks of compressed data

  this.strm = new ZStream();
  this.strm.avail_out = 0;

  var status = zlib_deflate.deflateInit2(
    this.strm,
    opt.level,
    opt.method,
    opt.windowBits,
    opt.memLevel,
    opt.strategy
  );

  if (status !== Z_OK) {
    throw new Error(msg[status]);
  }

  if (opt.header) {
    zlib_deflate.deflateSetHeader(this.strm, opt.header);
  }

  if (opt.dictionary) {
    var dict;
    // Convert data if needed
    if (typeof opt.dictionary === 'string') {
      // If we need to compress text, change encoding to utf8.
      dict = strings.string2buf(opt.dictionary);
    } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
      dict = new Uint8Array(opt.dictionary);
    } else {
      dict = opt.dictionary;
    }

    status = zlib_deflate.deflateSetDictionary(this.strm, dict);

    if (status !== Z_OK) {
      throw new Error(msg[status]);
    }

    this._dict_set = true;
  }
}

/**
 * Deflate#push(data[, mode]) -> Boolean
 * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
 *   converted to utf8 byte sequence.
 * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
 *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
 *
 * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
 * new compressed chunks. Returns `true` on success. The last data block must have
 * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
 * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
 * can use mode Z_SYNC_FLUSH, keeping the compression context.
 *
 * On fail call [[Deflate#onEnd]] with error code and return false.
 *
 * We strongly recommend to use `Uint8Array` on input for best speed (output
 * array format is detected automatically). Also, don't skip last param and always
 * use the same type in your code (boolean or number). That will improve JS speed.
 *
 * For regular `Array`-s make sure all elements are [0..255].
 *
 * ##### Example
 *
 * ```javascript
 * push(chunk, false); // push one of data chunks
 * ...
 * push(chunk, true);  // push last chunk
 * ```
 **/
Deflate.prototype.push = function (data, mode) {
  var strm = this.strm;
  var chunkSize = this.options.chunkSize;
  var status, _mode;

  if (this.ended) { return false; }

  _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);

  // Convert data if needed
  if (typeof data === 'string') {
    // If we need to compress text, change encoding to utf8.
    strm.input = strings.string2buf(data);
  } else if (toString.call(data) === '[object ArrayBuffer]') {
    strm.input = new Uint8Array(data);
  } else {
    strm.input = data;
  }

  strm.next_in = 0;
  strm.avail_in = strm.input.length;

  do {
    if (strm.avail_out === 0) {
      strm.output = new utils.Buf8(chunkSize);
      strm.next_out = 0;
      strm.avail_out = chunkSize;
    }
    status = zlib_deflate.deflate(strm, _mode);    /* no bad return value */

    if (status !== Z_STREAM_END && status !== Z_OK) {
      this.onEnd(status);
      this.ended = true;
      return false;
    }
    if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
      if (this.options.to === 'string') {
        this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
      } else {
        this.onData(utils.shrinkBuf(strm.output, strm.next_out));
      }
    }
  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);

  // Finalize on the last chunk.
  if (_mode === Z_FINISH) {
    status = zlib_deflate.deflateEnd(this.strm);
    this.onEnd(status);
    this.ended = true;
    return status === Z_OK;
  }

  // callback interim results if Z_SYNC_FLUSH.
  if (_mode === Z_SYNC_FLUSH) {
    this.onEnd(Z_OK);
    strm.avail_out = 0;
    return true;
  }

  return true;
};


/**
 * Deflate#onData(chunk) -> Void
 * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
 *   on js engine support. When string output requested, each chunk
 *   will be string.
 *
 * By default, stores data blocks in `chunks[]` property and glue
 * those in `onEnd`. Override this handler, if you need another behaviour.
 **/
Deflate.prototype.onData = function (chunk) {
  this.chunks.push(chunk);
};


/**
 * Deflate#onEnd(status) -> Void
 * - status (Number): deflate status. 0 (Z_OK) on success,
 *   other if not.
 *
 * Called once after you tell deflate that the input stream is
 * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
 * or if an error happened. By default - join collected chunks,
 * free memory and fill `results` / `err` properties.
 **/
Deflate.prototype.onEnd = function (status) {
  // On success - join
  if (status === Z_OK) {
    if (this.options.to === 'string') {
      this.result = this.chunks.join('');
    } else {
      this.result = utils.flattenChunks(this.chunks);
    }
  }
  this.chunks = [];
  this.err = status;
  this.msg = this.strm.msg;
};


/**
 * deflate(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * Compress `data` with deflate algorithm and `options`.
 *
 * Supported options are:
 *
 * - level
 * - windowBits
 * - memLevel
 * - strategy
 * - dictionary
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Sugar (options):
 *
 * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
 *   negative windowBits implicitly.
 * - `to` (String) - if equal to 'string', then result will be "binary string"
 *    (each char code [0..255])
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
 *
 * console.log(pako.deflate(data));
 * ```
 **/
function deflate(input, options) {
  var deflator = new Deflate(options);

  deflator.push(input, true);

  // That will never happens, if you don't cheat with options :)
  if (deflator.err) { throw deflator.msg || msg[deflator.err]; }

  return deflator.result;
}


/**
 * deflateRaw(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * The same as [[deflate]], but creates raw data, without wrapper
 * (header and adler32 crc).
 **/
function deflateRaw(input, options) {
  options = options || {};
  options.raw = true;
  return deflate(input, options);
}


/**
 * gzip(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * The same as [[deflate]], but create gzip wrapper instead of
 * deflate one.
 **/
function gzip(input, options) {
  options = options || {};
  options.gzip = true;
  return deflate(input, options);
}


exports.Deflate = Deflate;
exports.deflate = deflate;
exports.deflateRaw = deflateRaw;
exports.gzip = gzip;

},{"./utils/common":62,"./utils/strings":63,"./zlib/deflate":67,"./zlib/messages":72,"./zlib/zstream":74}],61:[function(require,module,exports){
'use strict';


var zlib_inflate = require('./zlib/inflate');
var utils        = require('./utils/common');
var strings      = require('./utils/strings');
var c            = require('./zlib/constants');
var msg          = require('./zlib/messages');
var ZStream      = require('./zlib/zstream');
var GZheader     = require('./zlib/gzheader');

var toString = Object.prototype.toString;

/**
 * class Inflate
 *
 * Generic JS-style wrapper for zlib calls. If you don't need
 * streaming behaviour - use more simple functions: [[inflate]]
 * and [[inflateRaw]].
 **/

/* internal
 * inflate.chunks -> Array
 *
 * Chunks of output data, if [[Inflate#onData]] not overriden.
 **/

/**
 * Inflate.result -> Uint8Array|Array|String
 *
 * Uncompressed result, generated by default [[Inflate#onData]]
 * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
 * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
 * push a chunk with explicit flush (call [[Inflate#push]] with
 * `Z_SYNC_FLUSH` param).
 **/

/**
 * Inflate.err -> Number
 *
 * Error code after inflate finished. 0 (Z_OK) on success.
 * Should be checked if broken data possible.
 **/

/**
 * Inflate.msg -> String
 *
 * Error message, if [[Inflate.err]] != 0
 **/


/**
 * new Inflate(options)
 * - options (Object): zlib inflate options.
 *
 * Creates new inflator instance with specified params. Throws exception
 * on bad params. Supported options:
 *
 * - `windowBits`
 * - `dictionary`
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Additional options, for internal needs:
 *
 * - `chunkSize` - size of generated data chunks (16K by default)
 * - `raw` (Boolean) - do raw inflate
 * - `to` (String) - if equal to 'string', then result will be converted
 *   from utf8 to utf16 (javascript) string. When string output requested,
 *   chunk length can differ from `chunkSize`, depending on content.
 *
 * By default, when no options set, autodetect deflate/gzip data format via
 * wrapper header.
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
 *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
 *
 * var inflate = new pako.Inflate({ level: 3});
 *
 * inflate.push(chunk1, false);
 * inflate.push(chunk2, true);  // true -> last chunk
 *
 * if (inflate.err) { throw new Error(inflate.err); }
 *
 * console.log(inflate.result);
 * ```
 **/
function Inflate(options) {
  if (!(this instanceof Inflate)) return new Inflate(options);

  this.options = utils.assign({
    chunkSize: 16384,
    windowBits: 0,
    to: ''
  }, options || {});

  var opt = this.options;

  // Force window size for `raw` data, if not set directly,
  // because we have no header for autodetect.
  if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
    opt.windowBits = -opt.windowBits;
    if (opt.windowBits === 0) { opt.windowBits = -15; }
  }

  // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
  if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
      !(options && options.windowBits)) {
    opt.windowBits += 32;
  }

  // Gzip header has no info about windows size, we can do autodetect only
  // for deflate. So, if window size not set, force it to max when gzip possible
  if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
    // bit 3 (16) -> gzipped data
    // bit 4 (32) -> autodetect gzip/deflate
    if ((opt.windowBits & 15) === 0) {
      opt.windowBits |= 15;
    }
  }

  this.err    = 0;      // error code, if happens (0 = Z_OK)
  this.msg    = '';     // error message
  this.ended  = false;  // used to avoid multiple onEnd() calls
  this.chunks = [];     // chunks of compressed data

  this.strm   = new ZStream();
  this.strm.avail_out = 0;

  var status  = zlib_inflate.inflateInit2(
    this.strm,
    opt.windowBits
  );

  if (status !== c.Z_OK) {
    throw new Error(msg[status]);
  }

  this.header = new GZheader();

  zlib_inflate.inflateGetHeader(this.strm, this.header);
}

/**
 * Inflate#push(data[, mode]) -> Boolean
 * - data (Uint8Array|Array|ArrayBuffer|String): input data
 * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
 *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
 *
 * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
 * new output chunks. Returns `true` on success. The last data block must have
 * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
 * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
 * can use mode Z_SYNC_FLUSH, keeping the decompression context.
 *
 * On fail call [[Inflate#onEnd]] with error code and return false.
 *
 * We strongly recommend to use `Uint8Array` on input for best speed (output
 * format is detected automatically). Also, don't skip last param and always
 * use the same type in your code (boolean or number). That will improve JS speed.
 *
 * For regular `Array`-s make sure all elements are [0..255].
 *
 * ##### Example
 *
 * ```javascript
 * push(chunk, false); // push one of data chunks
 * ...
 * push(chunk, true);  // push last chunk
 * ```
 **/
Inflate.prototype.push = function (data, mode) {
  var strm = this.strm;
  var chunkSize = this.options.chunkSize;
  var dictionary = this.options.dictionary;
  var status, _mode;
  var next_out_utf8, tail, utf8str;
  var dict;

  // Flag to properly process Z_BUF_ERROR on testing inflate call
  // when we check that all output data was flushed.
  var allowBufError = false;

  if (this.ended) { return false; }
  _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);

  // Convert data if needed
  if (typeof data === 'string') {
    // Only binary strings can be decompressed on practice
    strm.input = strings.binstring2buf(data);
  } else if (toString.call(data) === '[object ArrayBuffer]') {
    strm.input = new Uint8Array(data);
  } else {
    strm.input = data;
  }

  strm.next_in = 0;
  strm.avail_in = strm.input.length;

  do {
    if (strm.avail_out === 0) {
      strm.output = new utils.Buf8(chunkSize);
      strm.next_out = 0;
      strm.avail_out = chunkSize;
    }

    status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH);    /* no bad return value */

    if (status === c.Z_NEED_DICT && dictionary) {
      // Convert data if needed
      if (typeof dictionary === 'string') {
        dict = strings.string2buf(dictionary);
      } else if (toString.call(dictionary) === '[object ArrayBuffer]') {
        dict = new Uint8Array(dictionary);
      } else {
        dict = dictionary;
      }

      status = zlib_inflate.inflateSetDictionary(this.strm, dict);

    }

    if (status === c.Z_BUF_ERROR && allowBufError === true) {
      status = c.Z_OK;
      allowBufError = false;
    }

    if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
      this.onEnd(status);
      this.ended = true;
      return false;
    }

    if (strm.next_out) {
      if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {

        if (this.options.to === 'string') {

          next_out_utf8 = strings.utf8border(strm.output, strm.next_out);

          tail = strm.next_out - next_out_utf8;
          utf8str = strings.buf2string(strm.output, next_out_utf8);

          // move tail
          strm.next_out = tail;
          strm.avail_out = chunkSize - tail;
          if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }

          this.onData(utf8str);

        } else {
          this.onData(utils.shrinkBuf(strm.output, strm.next_out));
        }
      }
    }

    // When no more input data, we should check that internal inflate buffers
    // are flushed. The only way to do it when avail_out = 0 - run one more
    // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
    // Here we set flag to process this error properly.
    //
    // NOTE. Deflate does not return error in this case and does not needs such
    // logic.
    if (strm.avail_in === 0 && strm.avail_out === 0) {
      allowBufError = true;
    }

  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);

  if (status === c.Z_STREAM_END) {
    _mode = c.Z_FINISH;
  }

  // Finalize on the last chunk.
  if (_mode === c.Z_FINISH) {
    status = zlib_inflate.inflateEnd(this.strm);
    this.onEnd(status);
    this.ended = true;
    return status === c.Z_OK;
  }

  // callback interim results if Z_SYNC_FLUSH.
  if (_mode === c.Z_SYNC_FLUSH) {
    this.onEnd(c.Z_OK);
    strm.avail_out = 0;
    return true;
  }

  return true;
};


/**
 * Inflate#onData(chunk) -> Void
 * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
 *   on js engine support. When string output requested, each chunk
 *   will be string.
 *
 * By default, stores data blocks in `chunks[]` property and glue
 * those in `onEnd`. Override this handler, if you need another behaviour.
 **/
Inflate.prototype.onData = function (chunk) {
  this.chunks.push(chunk);
};


/**
 * Inflate#onEnd(status) -> Void
 * - status (Number): inflate status. 0 (Z_OK) on success,
 *   other if not.
 *
 * Called either after you tell inflate that the input stream is
 * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
 * or if an error happened. By default - join collected chunks,
 * free memory and fill `results` / `err` properties.
 **/
Inflate.prototype.onEnd = function (status) {
  // On success - join
  if (status === c.Z_OK) {
    if (this.options.to === 'string') {
      // Glue & convert here, until we teach pako to send
      // utf8 alligned strings to onData
      this.result = this.chunks.join('');
    } else {
      this.result = utils.flattenChunks(this.chunks);
    }
  }
  this.chunks = [];
  this.err = status;
  this.msg = this.strm.msg;
};


/**
 * inflate(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to decompress.
 * - options (Object): zlib inflate options.
 *
 * Decompress `data` with inflate/ungzip and `options`. Autodetect
 * format via wrapper header by default. That's why we don't provide
 * separate `ungzip` method.
 *
 * Supported options are:
 *
 * - windowBits
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information.
 *
 * Sugar (options):
 *
 * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
 *   negative windowBits implicitly.
 * - `to` (String) - if equal to 'string', then result will be converted
 *   from utf8 to utf16 (javascript) string. When string output requested,
 *   chunk length can differ from `chunkSize`, depending on content.
 *
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , input = pako.deflate([1,2,3,4,5,6,7,8,9])
 *   , output;
 *
 * try {
 *   output = pako.inflate(input);
 * } catch (err)
 *   console.log(err);
 * }
 * ```
 **/
function inflate(input, options) {
  var inflator = new Inflate(options);

  inflator.push(input, true);

  // That will never happens, if you don't cheat with options :)
  if (inflator.err) { throw inflator.msg || msg[inflator.err]; }

  return inflator.result;
}


/**
 * inflateRaw(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to decompress.
 * - options (Object): zlib inflate options.
 *
 * The same as [[inflate]], but creates raw data, without wrapper
 * (header and adler32 crc).
 **/
function inflateRaw(input, options) {
  options = options || {};
  options.raw = true;
  return inflate(input, options);
}


/**
 * ungzip(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to decompress.
 * - options (Object): zlib inflate options.
 *
 * Just shortcut to [[inflate]], because it autodetects format
 * by header.content. Done for convenience.
 **/


exports.Inflate = Inflate;
exports.inflate = inflate;
exports.inflateRaw = inflateRaw;
exports.ungzip  = inflate;

},{"./utils/common":62,"./utils/strings":63,"./zlib/constants":65,"./zlib/gzheader":68,"./zlib/inflate":70,"./zlib/messages":72,"./zlib/zstream":74}],62:[function(require,module,exports){
'use strict';


var TYPED_OK =  (typeof Uint8Array !== 'undefined') &&
                (typeof Uint16Array !== 'undefined') &&
                (typeof Int32Array !== 'undefined');


exports.assign = function (obj /*from1, from2, from3, ...*/) {
  var sources = Array.prototype.slice.call(arguments, 1);
  while (sources.length) {
    var source = sources.shift();
    if (!source) { continue; }

    if (typeof source !== 'object') {
      throw new TypeError(source + 'must be non-object');
    }

    for (var p in source) {
      if (source.hasOwnProperty(p)) {
        obj[p] = source[p];
      }
    }
  }

  return obj;
};


// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
  if (buf.length === size) { return buf; }
  if (buf.subarray) { return buf.subarray(0, size); }
  buf.length = size;
  return buf;
};


var fnTyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    if (src.subarray && dest.subarray) {
      dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
      return;
    }
    // Fallback to ordinary array
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    var i, l, len, pos, chunk, result;

    // calculate data length
    len = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      len += chunks[i].length;
    }

    // join chunks
    result = new Uint8Array(len);
    pos = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      chunk = chunks[i];
      result.set(chunk, pos);
      pos += chunk.length;
    }

    return result;
  }
};

var fnUntyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    return [].concat.apply([], chunks);
  }
};


// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
  if (on) {
    exports.Buf8  = Uint8Array;
    exports.Buf16 = Uint16Array;
    exports.Buf32 = Int32Array;
    exports.assign(exports, fnTyped);
  } else {
    exports.Buf8  = Array;
    exports.Buf16 = Array;
    exports.Buf32 = Array;
    exports.assign(exports, fnUntyped);
  }
};

exports.setTyped(TYPED_OK);

},{}],63:[function(require,module,exports){
// String encode/decode helpers
'use strict';


var utils = require('./common');


// Quick check if we can use fast array to bin string conversion
//
// - apply(Array) can fail on Android 2.2
// - apply(Uint8Array) can fail on iOS 5.1 Safary
//
var STR_APPLY_OK = true;
var STR_APPLY_UIA_OK = true;

try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }


// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new utils.Buf8(256);
for (var q = 0; q < 256; q++) {
  _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
}
_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start


// convert string to array (typed, when possible)
exports.string2buf = function (str) {
  var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;

  // count binary size
  for (m_pos = 0; m_pos < str_len; m_pos++) {
    c = str.charCodeAt(m_pos);
    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
      c2 = str.charCodeAt(m_pos + 1);
      if ((c2 & 0xfc00) === 0xdc00) {
        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
        m_pos++;
      }
    }
    buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
  }

  // allocate buffer
  buf = new utils.Buf8(buf_len);

  // convert
  for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
    c = str.charCodeAt(m_pos);
    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
      c2 = str.charCodeAt(m_pos + 1);
      if ((c2 & 0xfc00) === 0xdc00) {
        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
        m_pos++;
      }
    }
    if (c < 0x80) {
      /* one byte */
      buf[i++] = c;
    } else if (c < 0x800) {
      /* two bytes */
      buf[i++] = 0xC0 | (c >>> 6);
      buf[i++] = 0x80 | (c & 0x3f);
    } else if (c < 0x10000) {
      /* three bytes */
      buf[i++] = 0xE0 | (c >>> 12);
      buf[i++] = 0x80 | (c >>> 6 & 0x3f);
      buf[i++] = 0x80 | (c & 0x3f);
    } else {
      /* four bytes */
      buf[i++] = 0xf0 | (c >>> 18);
      buf[i++] = 0x80 | (c >>> 12 & 0x3f);
      buf[i++] = 0x80 | (c >>> 6 & 0x3f);
      buf[i++] = 0x80 | (c & 0x3f);
    }
  }

  return buf;
};

// Helper (used in 2 places)
function buf2binstring(buf, len) {
  // use fallback for big arrays to avoid stack overflow
  if (len < 65537) {
    if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
      return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
    }
  }

  var result = '';
  for (var i = 0; i < len; i++) {
    result += String.fromCharCode(buf[i]);
  }
  return result;
}


// Convert byte array to binary string
exports.buf2binstring = function (buf) {
  return buf2binstring(buf, buf.length);
};


// Convert binary string (typed, when possible)
exports.binstring2buf = function (str) {
  var buf = new utils.Buf8(str.length);
  for (var i = 0, len = buf.length; i < len; i++) {
    buf[i] = str.charCodeAt(i);
  }
  return buf;
};


// convert array to string
exports.buf2string = function (buf, max) {
  var i, out, c, c_len;
  var len = max || buf.length;

  // Reserve max possible length (2 words per char)
  // NB: by unknown reasons, Array is significantly faster for
  //     String.fromCharCode.apply than Uint16Array.
  var utf16buf = new Array(len * 2);

  for (out = 0, i = 0; i < len;) {
    c = buf[i++];
    // quick process ascii
    if (c < 0x80) { utf16buf[out++] = c; continue; }

    c_len = _utf8len[c];
    // skip 5 & 6 byte codes
    if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }

    // apply mask on first byte
    c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
    // join the rest
    while (c_len > 1 && i < len) {
      c = (c << 6) | (buf[i++] & 0x3f);
      c_len--;
    }

    // terminated by end of string?
    if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }

    if (c < 0x10000) {
      utf16buf[out++] = c;
    } else {
      c -= 0x10000;
      utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
      utf16buf[out++] = 0xdc00 | (c & 0x3ff);
    }
  }

  return buf2binstring(utf16buf, out);
};


// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max   - length limit (mandatory);
exports.utf8border = function (buf, max) {
  var pos;

  max = max || buf.length;
  if (max > buf.length) { max = buf.length; }

  // go back from last position, until start of sequence found
  pos = max - 1;
  while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }

  // Fuckup - very small and broken sequence,
  // return max, because we should return something anyway.
  if (pos < 0) { return max; }

  // If we came to start of buffer - that means vuffer is too small,
  // return max too.
  if (pos === 0) { return max; }

  return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};

},{"./common":62}],64:[function(require,module,exports){
'use strict';

// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It doesn't worth to make additional optimizationa as in original.
// Small size is preferable.

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function adler32(adler, buf, len, pos) {
  var s1 = (adler & 0xffff) |0,
      s2 = ((adler >>> 16) & 0xffff) |0,
      n = 0;

  while (len !== 0) {
    // Set limit ~ twice less than 5552, to keep
    // s2 in 31-bits, because we force signed ints.
    // in other case %= will fail.
    n = len > 2000 ? 2000 : len;
    len -= n;

    do {
      s1 = (s1 + buf[pos++]) |0;
      s2 = (s2 + s1) |0;
    } while (--n);

    s1 %= 65521;
    s2 %= 65521;
  }

  return (s1 | (s2 << 16)) |0;
}


module.exports = adler32;

},{}],65:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

module.exports = {

  /* Allowed flush values; see deflate() and inflate() below for details */
  Z_NO_FLUSH:         0,
  Z_PARTIAL_FLUSH:    1,
  Z_SYNC_FLUSH:       2,
  Z_FULL_FLUSH:       3,
  Z_FINISH:           4,
  Z_BLOCK:            5,
  Z_TREES:            6,

  /* Return codes for the compression/decompression functions. Negative values
  * are errors, positive values are used for special but normal events.
  */
  Z_OK:               0,
  Z_STREAM_END:       1,
  Z_NEED_DICT:        2,
  Z_ERRNO:           -1,
  Z_STREAM_ERROR:    -2,
  Z_DATA_ERROR:      -3,
  //Z_MEM_ERROR:     -4,
  Z_BUF_ERROR:       -5,
  //Z_VERSION_ERROR: -6,

  /* compression levels */
  Z_NO_COMPRESSION:         0,
  Z_BEST_SPEED:             1,
  Z_BEST_COMPRESSION:       9,
  Z_DEFAULT_COMPRESSION:   -1,


  Z_FILTERED:               1,
  Z_HUFFMAN_ONLY:           2,
  Z_RLE:                    3,
  Z_FIXED:                  4,
  Z_DEFAULT_STRATEGY:       0,

  /* Possible values of the data_type field (though see inflate()) */
  Z_BINARY:                 0,
  Z_TEXT:                   1,
  //Z_ASCII:                1, // = Z_TEXT (deprecated)
  Z_UNKNOWN:                2,

  /* The deflate compression method */
  Z_DEFLATED:               8
  //Z_NULL:                 null // Use -1 or null inline, depending on var type
};

},{}],66:[function(require,module,exports){
'use strict';

// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

// Use ordinary array, since untyped makes no boost here
function makeTable() {
  var c, table = [];

  for (var n = 0; n < 256; n++) {
    c = n;
    for (var k = 0; k < 8; k++) {
      c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
    }
    table[n] = c;
  }

  return table;
}

// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();


function crc32(crc, buf, len, pos) {
  var t = crcTable,
      end = pos + len;

  crc ^= -1;

  for (var i = pos; i < end; i++) {
    crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  }

  return (crc ^ (-1)); // >>> 0;
}


module.exports = crc32;

},{}],67:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils   = require('../utils/common');
var trees   = require('./trees');
var adler32 = require('./adler32');
var crc32   = require('./crc32');
var msg     = require('./messages');

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH      = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
//var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
//var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
//var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;


/* compression levels */
//var Z_NO_COMPRESSION      = 0;
//var Z_BEST_SPEED          = 1;
//var Z_BEST_COMPRESSION    = 9;
var Z_DEFAULT_COMPRESSION = -1;


var Z_FILTERED            = 1;
var Z_HUFFMAN_ONLY        = 2;
var Z_RLE                 = 3;
var Z_FIXED               = 4;
var Z_DEFAULT_STRATEGY    = 0;

/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY              = 0;
//var Z_TEXT                = 1;
//var Z_ASCII               = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;


/* The deflate compression method */
var Z_DEFLATED  = 8;

/*============================================================================*/


var MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_MEM_LEVEL = 8;


var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS      = 256;
/* number of literal bytes 0..255 */
var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES       = 30;
/* number of distance codes */
var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */
var MAX_BITS  = 15;
/* All codes must not exceed MAX_BITS bits */

var MIN_MATCH = 3;
var MAX_MATCH = 258;
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);

var PRESET_DICT = 0x20;

var INIT_STATE = 42;
var EXTRA_STATE = 69;
var NAME_STATE = 73;
var COMMENT_STATE = 91;
var HCRC_STATE = 103;
var BUSY_STATE = 113;
var FINISH_STATE = 666;

var BS_NEED_MORE      = 1; /* block not completed, need more input or more output */
var BS_BLOCK_DONE     = 2; /* block flush performed */
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
var BS_FINISH_DONE    = 4; /* finish done, accept no more input or output */

var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.

function err(strm, errorCode) {
  strm.msg = msg[errorCode];
  return errorCode;
}

function rank(f) {
  return ((f) << 1) - ((f) > 4 ? 9 : 0);
}

function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }


/* =========================================================================
 * Flush as much pending output as possible. All deflate() output goes
 * through this function so some applications may wish to modify it
 * to avoid allocating a large strm->output buffer and copying into it.
 * (See also read_buf()).
 */
function flush_pending(strm) {
  var s = strm.state;

  //_tr_flush_bits(s);
  var len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) { return; }

  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}


function flush_block_only(s, last) {
  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  s.block_start = s.strstart;
  flush_pending(s.strm);
}


function put_byte(s, b) {
  s.pending_buf[s.pending++] = b;
}


/* =========================================================================
 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
 * IN assertion: the stream state is correct and there is enough room in
 * pending_buf.
 */
function putShortMSB(s, b) {
//  put_byte(s, (Byte)(b >> 8));
//  put_byte(s, (Byte)(b & 0xff));
  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  s.pending_buf[s.pending++] = b & 0xff;
}


/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->input buffer and copying from it.
 * (See also flush_pending()).
 */
function read_buf(strm, buf, start, size) {
  var len = strm.avail_in;

  if (len > size) { len = size; }
  if (len === 0) { return 0; }

  strm.avail_in -= len;

  // zmemcpy(buf, strm->next_in, len);
  utils.arraySet(buf, strm.input, strm.next_in, len, start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  }

  else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }

  strm.next_in += len;
  strm.total_in += len;

  return len;
}


/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 * OUT assertion: the match length is not greater than s->lookahead.
 */
function longest_match(s, cur_match) {
  var chain_length = s.max_chain_length;      /* max hash chain length */
  var scan = s.strstart; /* current string */
  var match;                       /* matched string */
  var len;                           /* length of current match */
  var best_len = s.prev_length;              /* best match length so far */
  var nice_match = s.nice_match;             /* stop if match long enough */
  var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
      s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;

  var _win = s.window; // shortcut

  var wmask = s.w_mask;
  var prev  = s.prev;

  /* Stop when cur_match becomes <= limit. To simplify the code,
   * we prevent matches with the string of window index 0.
   */

  var strend = s.strstart + MAX_MATCH;
  var scan_end1  = _win[scan + best_len - 1];
  var scan_end   = _win[scan + best_len];

  /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
   * It is easy to get rid of this optimization if necessary.
   */
  // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

  /* Do not waste too much time if we already have a good match: */
  if (s.prev_length >= s.good_match) {
    chain_length >>= 2;
  }
  /* Do not look for matches beyond the end of the input. This is necessary
   * to make deflate deterministic.
   */
  if (nice_match > s.lookahead) { nice_match = s.lookahead; }

  // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");

  do {
    // Assert(cur_match < s->strstart, "no future");
    match = cur_match;

    /* Skip to next match if the match length cannot increase
     * or if the match length is less than 2.  Note that the checks below
     * for insufficient lookahead only occur occasionally for performance
     * reasons.  Therefore uninitialized memory will be accessed, and
     * conditional jumps will be made that depend on those values.
     * However the length of the match is limited to the lookahead, so
     * the output of deflate is not affected by the uninitialized values.
     */

    if (_win[match + best_len]     !== scan_end  ||
        _win[match + best_len - 1] !== scan_end1 ||
        _win[match]                !== _win[scan] ||
        _win[++match]              !== _win[scan + 1]) {
      continue;
    }

    /* The check at best_len-1 can be removed because it will be made
     * again later. (This heuristic is not always a win.)
     * It is not necessary to compare scan[2] and match[2] since they
     * are always equal when the other bytes match, given that
     * the hash keys are equal and that HASH_BITS >= 8.
     */
    scan += 2;
    match++;
    // Assert(*scan == *match, "match[2]?");

    /* We check for insufficient lookahead only every 8th comparison;
     * the 256th check will be made at strstart+258.
     */
    do {
      /*jshint noempty:false*/
    } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             scan < strend);

    // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");

    len = MAX_MATCH - (strend - scan);
    scan = strend - MAX_MATCH;

    if (len > best_len) {
      s.match_start = cur_match;
      best_len = len;
      if (len >= nice_match) {
        break;
      }
      scan_end1  = _win[scan + best_len - 1];
      scan_end   = _win[scan + best_len];
    }
  } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);

  if (best_len <= s.lookahead) {
    return best_len;
  }
  return s.lookahead;
}


/* ===========================================================================
 * Fill the window when the lookahead becomes insufficient.
 * Updates strstart and lookahead.
 *
 * IN assertion: lookahead < MIN_LOOKAHEAD
 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
 *    At least one byte has been read, or avail_in == 0; reads are
 *    performed for at least two bytes (required for the zip translate_eol
 *    option -- not supported here).
 */
function fill_window(s) {
  var _w_size = s.w_size;
  var p, n, m, more, str;

  //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");

  do {
    more = s.window_size - s.lookahead - s.strstart;

    // JS ints have 32 bit, block below not needed
    /* Deal with !@#$% 64K limit: */
    //if (sizeof(int) <= 2) {
    //    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
    //        more = wsize;
    //
    //  } else if (more == (unsigned)(-1)) {
    //        /* Very unlikely, but possible on 16 bit machine if
    //         * strstart == 0 && lookahead == 1 (input done a byte at time)
    //         */
    //        more--;
    //    }
    //}


    /* If the window is almost full and there is insufficient lookahead,
     * move the upper half to the lower one to make room in the upper half.
     */
    if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {

      utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
      s.match_start -= _w_size;
      s.strstart -= _w_size;
      /* we now have strstart >= MAX_DIST */
      s.block_start -= _w_size;

      /* Slide the hash table (could be avoided with 32 bit values
       at the expense of memory usage). We slide even when level == 0
       to keep the hash table consistent if we switch back to level > 0
       later. (Using level 0 permanently is not an optimal usage of
       zlib, so we don't care about this pathological case.)
       */

      n = s.hash_size;
      p = n;
      do {
        m = s.head[--p];
        s.head[p] = (m >= _w_size ? m - _w_size : 0);
      } while (--n);

      n = _w_size;
      p = n;
      do {
        m = s.prev[--p];
        s.prev[p] = (m >= _w_size ? m - _w_size : 0);
        /* If n is not on any hash chain, prev[n] is garbage but
         * its value will never be used.
         */
      } while (--n);

      more += _w_size;
    }
    if (s.strm.avail_in === 0) {
      break;
    }

    /* If there was no sliding:
     *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
     *    more == window_size - lookahead - strstart
     * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
     * => more >= window_size - 2*WSIZE + 2
     * In the BIG_MEM or MMAP case (not yet supported),
     *   window_size == input_size + MIN_LOOKAHEAD  &&
     *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
     * Otherwise, window_size == 2*WSIZE so more >= 2.
     * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
     */
    //Assert(more >= 2, "more < 2");
    n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
    s.lookahead += n;

    /* Initialize the hash value now that we have some input: */
    if (s.lookahead + s.insert >= MIN_MATCH) {
      str = s.strstart - s.insert;
      s.ins_h = s.window[str];

      /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
//        Call update_hash() MIN_MATCH-3 more times
//#endif
      while (s.insert) {
        /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

        s.prev[str & s.w_mask] = s.head[s.ins_h];
        s.head[s.ins_h] = str;
        str++;
        s.insert--;
        if (s.lookahead + s.insert < MIN_MATCH) {
          break;
        }
      }
    }
    /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
     * but this is not important since only literal bytes will be emitted.
     */

  } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);

  /* If the WIN_INIT bytes after the end of the current data have never been
   * written, then zero those bytes in order to avoid memory check reports of
   * the use of uninitialized (or uninitialised as Julian writes) bytes by
   * the longest match routines.  Update the high water mark for the next
   * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
   * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
   */
//  if (s.high_water < s.window_size) {
//    var curr = s.strstart + s.lookahead;
//    var init = 0;
//
//    if (s.high_water < curr) {
//      /* Previous high water mark below current data -- zero WIN_INIT
//       * bytes or up to end of window, whichever is less.
//       */
//      init = s.window_size - curr;
//      if (init > WIN_INIT)
//        init = WIN_INIT;
//      zmemzero(s->window + curr, (unsigned)init);
//      s->high_water = curr + init;
//    }
//    else if (s->high_water < (ulg)curr + WIN_INIT) {
//      /* High water mark at or above current data, but below current data
//       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
//       * to end of window, whichever is less.
//       */
//      init = (ulg)curr + WIN_INIT - s->high_water;
//      if (init > s->window_size - s->high_water)
//        init = s->window_size - s->high_water;
//      zmemzero(s->window + s->high_water, (unsigned)init);
//      s->high_water += init;
//    }
//  }
//
//  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
//    "not enough room for search");
}

/* ===========================================================================
 * Copy without compression as much as possible from the input stream, return
 * the current block state.
 * This function does not insert new strings in the dictionary since
 * uncompressible data is probably not useful. This function is used
 * only for the level=0 compression option.
 * NOTE: this function should be optimized to avoid extra copying from
 * window to pending_buf.
 */
function deflate_stored(s, flush) {
  /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
   * to pending_buf_size, and each stored block has a 5 byte header:
   */
  var max_block_size = 0xffff;

  if (max_block_size > s.pending_buf_size - 5) {
    max_block_size = s.pending_buf_size - 5;
  }

  /* Copy as much as possible from input to output: */
  for (;;) {
    /* Fill the window as much as possible: */
    if (s.lookahead <= 1) {

      //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
      //  s->block_start >= (long)s->w_size, "slide too late");
//      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
//        s.block_start >= s.w_size)) {
//        throw  new Error("slide too late");
//      }

      fill_window(s);
      if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }

      if (s.lookahead === 0) {
        break;
      }
      /* flush the current block */
    }
    //Assert(s->block_start >= 0L, "block gone");
//    if (s.block_start < 0) throw new Error("block gone");

    s.strstart += s.lookahead;
    s.lookahead = 0;

    /* Emit a stored block if pending_buf will be full: */
    var max_start = s.block_start + max_block_size;

    if (s.strstart === 0 || s.strstart >= max_start) {
      /* strstart == 0 is possible when wraparound on 16-bit machine */
      s.lookahead = s.strstart - max_start;
      s.strstart = max_start;
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/


    }
    /* Flush if we may have to slide, otherwise block_start may become
     * negative and the data will be gone:
     */
    if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }

  s.insert = 0;

  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }

  if (s.strstart > s.block_start) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_NEED_MORE;
}

/* ===========================================================================
 * Compress as much as possible from the input stream, return the current
 * block state.
 * This function does not perform lazy evaluation of matches and inserts
 * new strings in the dictionary only for unmatched strings or for short
 * matches. It is used only for the fast compression options.
 */
function deflate_fast(s, flush) {
  var hash_head;        /* head of the hash chain */
  var bflush;           /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) {
        break; /* flush the current block */
      }
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     * At this point we have always match_length < MIN_MATCH
     */
    if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */
    }
    if (s.match_length >= MIN_MATCH) {
      // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only

      /*** _tr_tally_dist(s, s.strstart - s.match_start,
                     s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;

      /* Insert new strings in the hash table only if the match length
       * is not too large. This saves time but degrades compression.
       */
      if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
        s.match_length--; /* string at strstart already in table */
        do {
          s.strstart++;
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
          /* strstart never exceeds WSIZE-MAX_MATCH, so there are
           * always MIN_MATCH bytes ahead.
           */
        } while (--s.match_length !== 0);
        s.strstart++;
      } else
      {
        s.strstart += s.match_length;
        s.match_length = 0;
        s.ins_h = s.window[s.strstart];
        /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;

//#if MIN_MATCH != 3
//                Call UPDATE_HASH() MIN_MATCH-3 more times
//#endif
        /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
         * matter since it will be recomputed at next deflate call.
         */
      }
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s.window[s.strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * Same as above, but achieves better compression. We use a lazy
 * evaluation for matches: a match is finally adopted only if there is
 * no better match at the next window position.
 */
function deflate_slow(s, flush) {
  var hash_head;          /* head of hash chain */
  var bflush;              /* set if current block must be flushed */

  var max_insert;

  /* Process the input block. */
  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     */
    s.prev_length = s.match_length;
    s.prev_match = s.match_start;
    s.match_length = MIN_MATCH - 1;

    if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
        s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */

      if (s.match_length <= 5 &&
         (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {

        /* If prev_match is also MIN_MATCH, match_start is garbage
         * but we will ignore the current match anyway.
         */
        s.match_length = MIN_MATCH - 1;
      }
    }
    /* If there was a match at the previous step and the current
     * match is not better, output the previous match:
     */
    if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
      max_insert = s.strstart + s.lookahead - MIN_MATCH;
      /* Do not insert strings in hash table beyond this. */

      //check_match(s, s.strstart-1, s.prev_match, s.prev_length);

      /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
                     s.prev_length - MIN_MATCH, bflush);***/
      bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
      /* Insert in hash table all strings up to the end of the match.
       * strstart-1 and strstart are already inserted. If there is not
       * enough lookahead, the last two strings are not inserted in
       * the hash table.
       */
      s.lookahead -= s.prev_length - 1;
      s.prev_length -= 2;
      do {
        if (++s.strstart <= max_insert) {
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
        }
      } while (--s.prev_length !== 0);
      s.match_available = 0;
      s.match_length = MIN_MATCH - 1;
      s.strstart++;

      if (bflush) {
        /*** FLUSH_BLOCK(s, 0); ***/
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
        /***/
      }

    } else if (s.match_available) {
      /* If there was no match at the previous position, output a
       * single literal. If there was a match but the current match
       * is longer, truncate the previous match to a single literal.
       */
      //Tracevv((stderr,"%c", s->window[s->strstart-1]));
      /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

      if (bflush) {
        /*** FLUSH_BLOCK_ONLY(s, 0) ***/
        flush_block_only(s, false);
        /***/
      }
      s.strstart++;
      s.lookahead--;
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
    } else {
      /* There is no previous match to compare with, wait for
       * the next step to decide.
       */
      s.match_available = 1;
      s.strstart++;
      s.lookahead--;
    }
  }
  //Assert (flush != Z_NO_FLUSH, "no flush?");
  if (s.match_available) {
    //Tracevv((stderr,"%c", s->window[s->strstart-1]));
    /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

    s.match_available = 0;
  }
  s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_BLOCK_DONE;
}


/* ===========================================================================
 * For Z_RLE, simply look for runs of bytes, generate matches only of distance
 * one.  Do not maintain a hash table.  (It will be regenerated if this run of
 * deflate switches away from Z_RLE.)
 */
function deflate_rle(s, flush) {
  var bflush;            /* set if current block must be flushed */
  var prev;              /* byte at distance one to match */
  var scan, strend;      /* scan goes up to strend for length of run */

  var _win = s.window;

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the longest run, plus one for the unrolled loop.
     */
    if (s.lookahead <= MAX_MATCH) {
      fill_window(s);
      if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* See how many times the previous byte repeats */
    s.match_length = 0;
    if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
      scan = s.strstart - 1;
      prev = _win[scan];
      if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
        strend = s.strstart + MAX_MATCH;
        do {
          /*jshint noempty:false*/
        } while (prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 scan < strend);
        s.match_length = MAX_MATCH - (strend - scan);
        if (s.match_length > s.lookahead) {
          s.match_length = s.lookahead;
        }
      }
      //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
    }

    /* Emit match if have run of MIN_MATCH or longer, else emit literal */
    if (s.match_length >= MIN_MATCH) {
      //check_match(s, s.strstart, s.strstart - 1, s.match_length);

      /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;
      s.strstart += s.match_length;
      s.match_length = 0;
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s->window[s->strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
 * (It will be regenerated if this run of deflate switches away from Huffman.)
 */
function deflate_huff(s, flush) {
  var bflush;             /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we have a literal to write. */
    if (s.lookahead === 0) {
      fill_window(s);
      if (s.lookahead === 0) {
        if (flush === Z_NO_FLUSH) {
          return BS_NEED_MORE;
        }
        break;      /* flush the current block */
      }
    }

    /* Output a literal byte */
    s.match_length = 0;
    //Tracevv((stderr,"%c", s->window[s->strstart]));
    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
    s.lookahead--;
    s.strstart++;
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* Values for max_lazy_match, good_match and max_chain_length, depending on
 * the desired pack level (0..9). The values given below have been tuned to
 * exclude worst case performance for pathological files. Better values may be
 * found for specific files.
 */
function Config(good_length, max_lazy, nice_length, max_chain, func) {
  this.good_length = good_length;
  this.max_lazy = max_lazy;
  this.nice_length = nice_length;
  this.max_chain = max_chain;
  this.func = func;
}

var configuration_table;

configuration_table = [
  /*      good lazy nice chain */
  new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */
  new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */
  new Config(4, 5, 16, 8, deflate_fast),           /* 2 */
  new Config(4, 6, 32, 32, deflate_fast),          /* 3 */

  new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */
  new Config(8, 16, 32, 32, deflate_slow),         /* 5 */
  new Config(8, 16, 128, 128, deflate_slow),       /* 6 */
  new Config(8, 32, 128, 256, deflate_slow),       /* 7 */
  new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */
  new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */
];


/* ===========================================================================
 * Initialize the "longest match" routines for a new zlib stream
 */
function lm_init(s) {
  s.window_size = 2 * s.w_size;

  /*** CLEAR_HASH(s); ***/
  zero(s.head); // Fill with NIL (= 0);

  /* Set the default configuration parameters:
   */
  s.max_lazy_match = configuration_table[s.level].max_lazy;
  s.good_match = configuration_table[s.level].good_length;
  s.nice_match = configuration_table[s.level].nice_length;
  s.max_chain_length = configuration_table[s.level].max_chain;

  s.strstart = 0;
  s.block_start = 0;
  s.lookahead = 0;
  s.insert = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  s.ins_h = 0;
}


function DeflateState() {
  this.strm = null;            /* pointer back to this zlib stream */
  this.status = 0;            /* as the name implies */
  this.pending_buf = null;      /* output still pending */
  this.pending_buf_size = 0;  /* size of pending_buf */
  this.pending_out = 0;       /* next pending byte to output to the stream */
  this.pending = 0;           /* nb of bytes in the pending buffer */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.gzhead = null;         /* gzip header information to write */
  this.gzindex = 0;           /* where in extra, name, or comment */
  this.method = Z_DEFLATED; /* can only be DEFLATED */
  this.last_flush = -1;   /* value of flush param for previous deflate call */

  this.w_size = 0;  /* LZ77 window size (32K by default) */
  this.w_bits = 0;  /* log2(w_size)  (8..16) */
  this.w_mask = 0;  /* w_size - 1 */

  this.window = null;
  /* Sliding window. Input bytes are read into the second half of the window,
   * and move to the first half later to keep a dictionary of at least wSize
   * bytes. With this organization, matches are limited to a distance of
   * wSize-MAX_MATCH bytes, but this ensures that IO is always
   * performed with a length multiple of the block size.
   */

  this.window_size = 0;
  /* Actual size of window: 2*wSize, except when the user input buffer
   * is directly used as sliding window.
   */

  this.prev = null;
  /* Link to older string with same hash index. To limit the size of this
   * array to 64K, this link is maintained only for the last 32K strings.
   * An index in this array is thus a window index modulo 32K.
   */

  this.head = null;   /* Heads of the hash chains or NIL. */

  this.ins_h = 0;       /* hash index of string to be inserted */
  this.hash_size = 0;   /* number of elements in hash table */
  this.hash_bits = 0;   /* log2(hash_size) */
  this.hash_mask = 0;   /* hash_size-1 */

  this.hash_shift = 0;
  /* Number of bits by which ins_h must be shifted at each input
   * step. It must be such that after MIN_MATCH steps, the oldest
   * byte no longer takes part in the hash key, that is:
   *   hash_shift * MIN_MATCH >= hash_bits
   */

  this.block_start = 0;
  /* Window position at the beginning of the current output block. Gets
   * negative when the window is moved backwards.
   */

  this.match_length = 0;      /* length of best match */
  this.prev_match = 0;        /* previous match */
  this.match_available = 0;   /* set if previous match exists */
  this.strstart = 0;          /* start of string to insert */
  this.match_start = 0;       /* start of matching string */
  this.lookahead = 0;         /* number of valid bytes ahead in window */

  this.prev_length = 0;
  /* Length of the best match at previous step. Matches not greater than this
   * are discarded. This is used in the lazy match evaluation.
   */

  this.max_chain_length = 0;
  /* To speed up deflation, hash chains are never searched beyond this
   * length.  A higher limit improves compression ratio but degrades the
   * speed.
   */

  this.max_lazy_match = 0;
  /* Attempt to find a better match only when the current match is strictly
   * smaller than this value. This mechanism is used only for compression
   * levels >= 4.
   */
  // That's alias to max_lazy_match, don't use directly
  //this.max_insert_length = 0;
  /* Insert new strings in the hash table only if the match length is not
   * greater than this length. This saves time but degrades compression.
   * max_insert_length is used only for compression levels <= 3.
   */

  this.level = 0;     /* compression level (1..9) */
  this.strategy = 0;  /* favor or force Huffman coding*/

  this.good_match = 0;
  /* Use a faster search when the previous match is longer than this */

  this.nice_match = 0; /* Stop searching when current match exceeds this */

              /* used by trees.c: */

  /* Didn't use ct_data typedef below to suppress compiler warning */

  // struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
  // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
  // struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */

  // Use flat array of DOUBLE size, with interleaved fata,
  // because JS does not support effective
  this.dyn_ltree  = new utils.Buf16(HEAP_SIZE * 2);
  this.dyn_dtree  = new utils.Buf16((2 * D_CODES + 1) * 2);
  this.bl_tree    = new utils.Buf16((2 * BL_CODES + 1) * 2);
  zero(this.dyn_ltree);
  zero(this.dyn_dtree);
  zero(this.bl_tree);

  this.l_desc   = null;         /* desc. for literal tree */
  this.d_desc   = null;         /* desc. for distance tree */
  this.bl_desc  = null;         /* desc. for bit length tree */

  //ush bl_count[MAX_BITS+1];
  this.bl_count = new utils.Buf16(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  //int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
  this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */
  zero(this.heap);

  this.heap_len = 0;               /* number of elements in the heap */
  this.heap_max = 0;               /* element of largest frequency */
  /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
   * The same heap array is used to build all trees.
   */

  this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
  zero(this.depth);
  /* Depth of each subtree used as tie breaker for trees of equal frequency
   */

  this.l_buf = 0;          /* buffer index for literals or lengths */

  this.lit_bufsize = 0;
  /* Size of match buffer for literals/lengths.  There are 4 reasons for
   * limiting lit_bufsize to 64K:
   *   - frequencies can be kept in 16 bit counters
   *   - if compression is not successful for the first block, all input
   *     data is still in the window so we can still emit a stored block even
   *     when input comes from standard input.  (This can also be done for
   *     all blocks if lit_bufsize is not greater than 32K.)
   *   - if compression is not successful for a file smaller than 64K, we can
   *     even emit a stored file instead of a stored block (saving 5 bytes).
   *     This is applicable only for zip (not gzip or zlib).
   *   - creating new Huffman trees less frequently may not provide fast
   *     adaptation to changes in the input data statistics. (Take for
   *     example a binary file with poorly compressible code followed by
   *     a highly compressible string table.) Smaller buffer sizes give
   *     fast adaptation but have of course the overhead of transmitting
   *     trees more frequently.
   *   - I can't count above 4
   */

  this.last_lit = 0;      /* running index in l_buf */

  this.d_buf = 0;
  /* Buffer index for distances. To simplify the code, d_buf and l_buf have
   * the same number of elements. To use different lengths, an extra flag
   * array would be necessary.
   */

  this.opt_len = 0;       /* bit length of current block with optimal trees */
  this.static_len = 0;    /* bit length of current block with static trees */
  this.matches = 0;       /* number of string matches in current block */
  this.insert = 0;        /* bytes at end of window left to insert */


  this.bi_buf = 0;
  /* Output buffer. bits are inserted starting at the bottom (least
   * significant bits).
   */
  this.bi_valid = 0;
  /* Number of valid bits in bi_buf.  All bits above the last valid bit
   * are always zero.
   */

  // Used for window memory init. We safely ignore it for JS. That makes
  // sense only for pointers and memory check tools.
  //this.high_water = 0;
  /* High water mark offset in window for initialized bytes -- bytes above
   * this are set to zero in order to avoid memory check warnings when
   * longest match routines access bytes past the input.  This is then
   * updated to the new high water mark.
   */
}


function deflateResetKeep(strm) {
  var s;

  if (!strm || !strm.state) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.total_in = strm.total_out = 0;
  strm.data_type = Z_UNKNOWN;

  s = strm.state;
  s.pending = 0;
  s.pending_out = 0;

  if (s.wrap < 0) {
    s.wrap = -s.wrap;
    /* was made negative by deflate(..., Z_FINISH); */
  }
  s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
  strm.adler = (s.wrap === 2) ?
    0  // crc32(0, Z_NULL, 0)
  :
    1; // adler32(0, Z_NULL, 0)
  s.last_flush = Z_NO_FLUSH;
  trees._tr_init(s);
  return Z_OK;
}


function deflateReset(strm) {
  var ret = deflateResetKeep(strm);
  if (ret === Z_OK) {
    lm_init(strm.state);
  }
  return ret;
}


function deflateSetHeader(strm, head) {
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
  strm.state.gzhead = head;
  return Z_OK;
}


function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  if (!strm) { // === Z_NULL
    return Z_STREAM_ERROR;
  }
  var wrap = 1;

  if (level === Z_DEFAULT_COMPRESSION) {
    level = 6;
  }

  if (windowBits < 0) { /* suppress zlib wrapper */
    wrap = 0;
    windowBits = -windowBits;
  }

  else if (windowBits > 15) {
    wrap = 2;           /* write gzip wrapper instead */
    windowBits -= 16;
  }


  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
    windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
    strategy < 0 || strategy > Z_FIXED) {
    return err(strm, Z_STREAM_ERROR);
  }


  if (windowBits === 8) {
    windowBits = 9;
  }
  /* until 256-byte window bug fixed */

  var s = new DeflateState();

  strm.state = s;
  s.strm = strm;

  s.wrap = wrap;
  s.gzhead = null;
  s.w_bits = windowBits;
  s.w_size = 1 << s.w_bits;
  s.w_mask = s.w_size - 1;

  s.hash_bits = memLevel + 7;
  s.hash_size = 1 << s.hash_bits;
  s.hash_mask = s.hash_size - 1;
  s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);

  s.window = new utils.Buf8(s.w_size * 2);
  s.head = new utils.Buf16(s.hash_size);
  s.prev = new utils.Buf16(s.w_size);

  // Don't need mem init magic for JS.
  //s.high_water = 0;  /* nothing written to s->window yet */

  s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */

  s.pending_buf_size = s.lit_bufsize * 4;

  //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
  //s->pending_buf = (uchf *) overlay;
  s.pending_buf = new utils.Buf8(s.pending_buf_size);

  // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
  //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
  s.d_buf = 1 * s.lit_bufsize;

  //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
  s.l_buf = (1 + 2) * s.lit_bufsize;

  s.level = level;
  s.strategy = strategy;
  s.method = method;

  return deflateReset(strm);
}

function deflateInit(strm, level) {
  return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}


function deflate(strm, flush) {
  var old_flush, s;
  var beg, val; // for gzip header write only

  if (!strm || !strm.state ||
    flush > Z_BLOCK || flush < 0) {
    return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  }

  s = strm.state;

  if (!strm.output ||
      (!strm.input && strm.avail_in !== 0) ||
      (s.status === FINISH_STATE && flush !== Z_FINISH)) {
    return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
  }

  s.strm = strm; /* just in case */
  old_flush = s.last_flush;
  s.last_flush = flush;

  /* Write the header */
  if (s.status === INIT_STATE) {

    if (s.wrap === 2) { // GZIP header
      strm.adler = 0;  //crc32(0L, Z_NULL, 0);
      put_byte(s, 31);
      put_byte(s, 139);
      put_byte(s, 8);
      if (!s.gzhead) { // s->gzhead == Z_NULL
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, OS_CODE);
        s.status = BUSY_STATE;
      }
      else {
        put_byte(s, (s.gzhead.text ? 1 : 0) +
                    (s.gzhead.hcrc ? 2 : 0) +
                    (!s.gzhead.extra ? 0 : 4) +
                    (!s.gzhead.name ? 0 : 8) +
                    (!s.gzhead.comment ? 0 : 16)
                );
        put_byte(s, s.gzhead.time & 0xff);
        put_byte(s, (s.gzhead.time >> 8) & 0xff);
        put_byte(s, (s.gzhead.time >> 16) & 0xff);
        put_byte(s, (s.gzhead.time >> 24) & 0xff);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, s.gzhead.os & 0xff);
        if (s.gzhead.extra && s.gzhead.extra.length) {
          put_byte(s, s.gzhead.extra.length & 0xff);
          put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
        }
        if (s.gzhead.hcrc) {
          strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
        }
        s.gzindex = 0;
        s.status = EXTRA_STATE;
      }
    }
    else // DEFLATE header
    {
      var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
      var level_flags = -1;

      if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
        level_flags = 0;
      } else if (s.level < 6) {
        level_flags = 1;
      } else if (s.level === 6) {
        level_flags = 2;
      } else {
        level_flags = 3;
      }
      header |= (level_flags << 6);
      if (s.strstart !== 0) { header |= PRESET_DICT; }
      header += 31 - (header % 31);

      s.status = BUSY_STATE;
      putShortMSB(s, header);

      /* Save the adler32 of the preset dictionary: */
      if (s.strstart !== 0) {
        putShortMSB(s, strm.adler >>> 16);
        putShortMSB(s, strm.adler & 0xffff);
      }
      strm.adler = 1; // adler32(0L, Z_NULL, 0);
    }
  }

//#ifdef GZIP
  if (s.status === EXTRA_STATE) {
    if (s.gzhead.extra/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */

      while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            break;
          }
        }
        put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
        s.gzindex++;
      }
      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (s.gzindex === s.gzhead.extra.length) {
        s.gzindex = 0;
        s.status = NAME_STATE;
      }
    }
    else {
      s.status = NAME_STATE;
    }
  }
  if (s.status === NAME_STATE) {
    if (s.gzhead.name/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.name.length) {
          val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.gzindex = 0;
        s.status = COMMENT_STATE;
      }
    }
    else {
      s.status = COMMENT_STATE;
    }
  }
  if (s.status === COMMENT_STATE) {
    if (s.gzhead.comment/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.comment.length) {
          val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.status = HCRC_STATE;
      }
    }
    else {
      s.status = HCRC_STATE;
    }
  }
  if (s.status === HCRC_STATE) {
    if (s.gzhead.hcrc) {
      if (s.pending + 2 > s.pending_buf_size) {
        flush_pending(strm);
      }
      if (s.pending + 2 <= s.pending_buf_size) {
        put_byte(s, strm.adler & 0xff);
        put_byte(s, (strm.adler >> 8) & 0xff);
        strm.adler = 0; //crc32(0L, Z_NULL, 0);
        s.status = BUSY_STATE;
      }
    }
    else {
      s.status = BUSY_STATE;
    }
  }
//#endif

  /* Flush as much pending output as possible */
  if (s.pending !== 0) {
    flush_pending(strm);
    if (strm.avail_out === 0) {
      /* Since avail_out is 0, deflate will be called again with
       * more output space, but possibly with both pending and
       * avail_in equal to zero. There won't be anything to do,
       * but this is not an error situation so make sure we
       * return OK instead of BUF_ERROR at next call of deflate:
       */
      s.last_flush = -1;
      return Z_OK;
    }

    /* Make sure there is something to do and avoid duplicate consecutive
     * flushes. For repeated and useless calls with Z_FINISH, we keep
     * returning Z_STREAM_END instead of Z_BUF_ERROR.
     */
  } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
    flush !== Z_FINISH) {
    return err(strm, Z_BUF_ERROR);
  }

  /* User must not provide more input after the first FINISH: */
  if (s.status === FINISH_STATE && strm.avail_in !== 0) {
    return err(strm, Z_BUF_ERROR);
  }

  /* Start a new block or continue the current one.
   */
  if (strm.avail_in !== 0 || s.lookahead !== 0 ||
    (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
    var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
      (s.strategy === Z_RLE ? deflate_rle(s, flush) :
        configuration_table[s.level].func(s, flush));

    if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
      s.status = FINISH_STATE;
    }
    if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
      if (strm.avail_out === 0) {
        s.last_flush = -1;
        /* avoid BUF_ERROR next call, see above */
      }
      return Z_OK;
      /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
       * of deflate should use the same flush parameter to make sure
       * that the flush is complete. So we don't have to output an
       * empty block here, this will be done at next call. This also
       * ensures that for a very small output buffer, we emit at most
       * one empty block.
       */
    }
    if (bstate === BS_BLOCK_DONE) {
      if (flush === Z_PARTIAL_FLUSH) {
        trees._tr_align(s);
      }
      else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */

        trees._tr_stored_block(s, 0, 0, false);
        /* For a full flush, this empty block will be recognized
         * as a special marker by inflate_sync().
         */
        if (flush === Z_FULL_FLUSH) {
          /*** CLEAR_HASH(s); ***/             /* forget history */
          zero(s.head); // Fill with NIL (= 0);

          if (s.lookahead === 0) {
            s.strstart = 0;
            s.block_start = 0;
            s.insert = 0;
          }
        }
      }
      flush_pending(strm);
      if (strm.avail_out === 0) {
        s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
        return Z_OK;
      }
    }
  }
  //Assert(strm->avail_out > 0, "bug2");
  //if (strm.avail_out <= 0) { throw new Error("bug2");}

  if (flush !== Z_FINISH) { return Z_OK; }
  if (s.wrap <= 0) { return Z_STREAM_END; }

  /* Write the trailer */
  if (s.wrap === 2) {
    put_byte(s, strm.adler & 0xff);
    put_byte(s, (strm.adler >> 8) & 0xff);
    put_byte(s, (strm.adler >> 16) & 0xff);
    put_byte(s, (strm.adler >> 24) & 0xff);
    put_byte(s, strm.total_in & 0xff);
    put_byte(s, (strm.total_in >> 8) & 0xff);
    put_byte(s, (strm.total_in >> 16) & 0xff);
    put_byte(s, (strm.total_in >> 24) & 0xff);
  }
  else
  {
    putShortMSB(s, strm.adler >>> 16);
    putShortMSB(s, strm.adler & 0xffff);
  }

  flush_pending(strm);
  /* If avail_out is zero, the application will call deflate again
   * to flush the rest.
   */
  if (s.wrap > 0) { s.wrap = -s.wrap; }
  /* write the trailer only once! */
  return s.pending !== 0 ? Z_OK : Z_STREAM_END;
}

function deflateEnd(strm) {
  var status;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  status = strm.state.status;
  if (status !== INIT_STATE &&
    status !== EXTRA_STATE &&
    status !== NAME_STATE &&
    status !== COMMENT_STATE &&
    status !== HCRC_STATE &&
    status !== BUSY_STATE &&
    status !== FINISH_STATE
  ) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.state = null;

  return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
}


/* =========================================================================
 * Initializes the compression dictionary from the given byte
 * sequence without producing any compressed output.
 */
function deflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var s;
  var str, n;
  var wrap;
  var avail;
  var next;
  var input;
  var tmpDict;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  s = strm.state;
  wrap = s.wrap;

  if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
    return Z_STREAM_ERROR;
  }

  /* when using zlib wrappers, compute Adler-32 for provided dictionary */
  if (wrap === 1) {
    /* adler32(strm->adler, dictionary, dictLength); */
    strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
  }

  s.wrap = 0;   /* avoid computing Adler-32 in read_buf */

  /* if dictionary would fill window, just replace the history */
  if (dictLength >= s.w_size) {
    if (wrap === 0) {            /* already empty otherwise */
      /*** CLEAR_HASH(s); ***/
      zero(s.head); // Fill with NIL (= 0);
      s.strstart = 0;
      s.block_start = 0;
      s.insert = 0;
    }
    /* use the tail */
    // dictionary = dictionary.slice(dictLength - s.w_size);
    tmpDict = new utils.Buf8(s.w_size);
    utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
    dictionary = tmpDict;
    dictLength = s.w_size;
  }
  /* insert dictionary into window and hash */
  avail = strm.avail_in;
  next = strm.next_in;
  input = strm.input;
  strm.avail_in = dictLength;
  strm.next_in = 0;
  strm.input = dictionary;
  fill_window(s);
  while (s.lookahead >= MIN_MATCH) {
    str = s.strstart;
    n = s.lookahead - (MIN_MATCH - 1);
    do {
      /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

      s.prev[str & s.w_mask] = s.head[s.ins_h];

      s.head[s.ins_h] = str;
      str++;
    } while (--n);
    s.strstart = str;
    s.lookahead = MIN_MATCH - 1;
    fill_window(s);
  }
  s.strstart += s.lookahead;
  s.block_start = s.strstart;
  s.insert = s.lookahead;
  s.lookahead = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  strm.next_in = next;
  strm.input = input;
  strm.avail_in = avail;
  s.wrap = wrap;
  return Z_OK;
}


exports.deflateInit = deflateInit;
exports.deflateInit2 = deflateInit2;
exports.deflateReset = deflateReset;
exports.deflateResetKeep = deflateResetKeep;
exports.deflateSetHeader = deflateSetHeader;
exports.deflate = deflate;
exports.deflateEnd = deflateEnd;
exports.deflateSetDictionary = deflateSetDictionary;
exports.deflateInfo = 'pako deflate (from Nodeca project)';

/* Not implemented
exports.deflateBound = deflateBound;
exports.deflateCopy = deflateCopy;
exports.deflateParams = deflateParams;
exports.deflatePending = deflatePending;
exports.deflatePrime = deflatePrime;
exports.deflateTune = deflateTune;
*/

},{"../utils/common":62,"./adler32":64,"./crc32":66,"./messages":72,"./trees":73}],68:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function GZheader() {
  /* true if compressed data believed to be text */
  this.text       = 0;
  /* modification time */
  this.time       = 0;
  /* extra flags (not used when writing a gzip file) */
  this.xflags     = 0;
  /* operating system */
  this.os         = 0;
  /* pointer to extra field or Z_NULL if none */
  this.extra      = null;
  /* extra field length (valid if extra != Z_NULL) */
  this.extra_len  = 0; // Actually, we don't need it in JS,
                       // but leave for few code modifications

  //
  // Setup limits is not necessary because in js we should not preallocate memory
  // for inflate use constant limit in 65536 bytes
  //

  /* space at extra (only when reading header) */
  // this.extra_max  = 0;
  /* pointer to zero-terminated file name or Z_NULL */
  this.name       = '';
  /* space at name (only when reading header) */
  // this.name_max   = 0;
  /* pointer to zero-terminated comment or Z_NULL */
  this.comment    = '';
  /* space at comment (only when reading header) */
  // this.comm_max   = 0;
  /* true if there was or will be a header crc */
  this.hcrc       = 0;
  /* true when done reading gzip header (not used when writing a gzip file) */
  this.done       = false;
}

module.exports = GZheader;

},{}],69:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

// See state defs from inflate.js
var BAD = 30;       /* got a data error -- remain here until reset */
var TYPE = 12;      /* i: waiting for type bits, including last-flag bit */

/*
   Decode literal, length, and distance codes and write out the resulting
   literal and match bytes until either not enough input or output is
   available, an end-of-block is encountered, or a data error is encountered.
   When large enough input and output buffers are supplied to inflate(), for
   example, a 16K input buffer and a 64K output buffer, more than 95% of the
   inflate execution time is spent in this routine.

   Entry assumptions:

        state.mode === LEN
        strm.avail_in >= 6
        strm.avail_out >= 258
        start >= strm.avail_out
        state.bits < 8

   On return, state.mode is one of:

        LEN -- ran out of enough output space or enough available input
        TYPE -- reached end of block code, inflate() to interpret next block
        BAD -- error in block data

   Notes:

    - The maximum input bits used by a length/distance pair is 15 bits for the
      length code, 5 bits for the length extra, 15 bits for the distance code,
      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
      Therefore if strm.avail_in >= 6, then there is enough input to avoid
      checking for available input while decoding.

    - The maximum bytes that a single length/distance pair can output is 258
      bytes, which is the maximum length that can be coded.  inflate_fast()
      requires strm.avail_out >= 258 for each loop to avoid checking for
      output space.
 */
module.exports = function inflate_fast(strm, start) {
  var state;
  var _in;                    /* local strm.input */
  var last;                   /* have enough input while in < last */
  var _out;                   /* local strm.output */
  var beg;                    /* inflate()'s initial strm.output */
  var end;                    /* while out < end, enough space available */
//#ifdef INFLATE_STRICT
  var dmax;                   /* maximum distance from zlib header */
//#endif
  var wsize;                  /* window size or zero if not using window */
  var whave;                  /* valid bytes in the window */
  var wnext;                  /* window write index */
  // Use `s_window` instead `window`, avoid conflict with instrumentation tools
  var s_window;               /* allocated sliding window, if wsize != 0 */
  var hold;                   /* local strm.hold */
  var bits;                   /* local strm.bits */
  var lcode;                  /* local strm.lencode */
  var dcode;                  /* local strm.distcode */
  var lmask;                  /* mask for first level of length codes */
  var dmask;                  /* mask for first level of distance codes */
  var here;                   /* retrieved table entry */
  var op;                     /* code bits, operation, extra bits, or */
                              /*  window position, window bytes to copy */
  var len;                    /* match length, unused bytes */
  var dist;                   /* match distance */
  var from;                   /* where to copy match from */
  var from_source;


  var input, output; // JS specific, because we have no pointers

  /* copy state to local variables */
  state = strm.state;
  //here = state.here;
  _in = strm.next_in;
  input = strm.input;
  last = _in + (strm.avail_in - 5);
  _out = strm.next_out;
  output = strm.output;
  beg = _out - (start - strm.avail_out);
  end = _out + (strm.avail_out - 257);
//#ifdef INFLATE_STRICT
  dmax = state.dmax;
//#endif
  wsize = state.wsize;
  whave = state.whave;
  wnext = state.wnext;
  s_window = state.window;
  hold = state.hold;
  bits = state.bits;
  lcode = state.lencode;
  dcode = state.distcode;
  lmask = (1 << state.lenbits) - 1;
  dmask = (1 << state.distbits) - 1;


  /* decode literals and length/distances until end-of-block or not enough
     input data or output space */

  top:
  do {
    if (bits < 15) {
      hold += input[_in++] << bits;
      bits += 8;
      hold += input[_in++] << bits;
      bits += 8;
    }

    here = lcode[hold & lmask];

    dolen:
    for (;;) { // Goto emulation
      op = here >>> 24/*here.bits*/;
      hold >>>= op;
      bits -= op;
      op = (here >>> 16) & 0xff/*here.op*/;
      if (op === 0) {                          /* literal */
        //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
        //        "inflate:         literal '%c'\n" :
        //        "inflate:         literal 0x%02x\n", here.val));
        output[_out++] = here & 0xffff/*here.val*/;
      }
      else if (op & 16) {                     /* length base */
        len = here & 0xffff/*here.val*/;
        op &= 15;                           /* number of extra bits */
        if (op) {
          if (bits < op) {
            hold += input[_in++] << bits;
            bits += 8;
          }
          len += hold & ((1 << op) - 1);
          hold >>>= op;
          bits -= op;
        }
        //Tracevv((stderr, "inflate:         length %u\n", len));
        if (bits < 15) {
          hold += input[_in++] << bits;
          bits += 8;
          hold += input[_in++] << bits;
          bits += 8;
        }
        here = dcode[hold & dmask];

        dodist:
        for (;;) { // goto emulation
          op = here >>> 24/*here.bits*/;
          hold >>>= op;
          bits -= op;
          op = (here >>> 16) & 0xff/*here.op*/;

          if (op & 16) {                      /* distance base */
            dist = here & 0xffff/*here.val*/;
            op &= 15;                       /* number of extra bits */
            if (bits < op) {
              hold += input[_in++] << bits;
              bits += 8;
              if (bits < op) {
                hold += input[_in++] << bits;
                bits += 8;
              }
            }
            dist += hold & ((1 << op) - 1);
//#ifdef INFLATE_STRICT
            if (dist > dmax) {
              strm.msg = 'invalid distance too far back';
              state.mode = BAD;
              break top;
            }
//#endif
            hold >>>= op;
            bits -= op;
            //Tracevv((stderr, "inflate:         distance %u\n", dist));
            op = _out - beg;                /* max distance in output */
            if (dist > op) {                /* see if copy from window */
              op = dist - op;               /* distance back in window */
              if (op > whave) {
                if (state.sane) {
                  strm.msg = 'invalid distance too far back';
                  state.mode = BAD;
                  break top;
                }

// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
//                if (len <= op - whave) {
//                  do {
//                    output[_out++] = 0;
//                  } while (--len);
//                  continue top;
//                }
//                len -= op - whave;
//                do {
//                  output[_out++] = 0;
//                } while (--op > whave);
//                if (op === 0) {
//                  from = _out - dist;
//                  do {
//                    output[_out++] = output[from++];
//                  } while (--len);
//                  continue top;
//                }
//#endif
              }
              from = 0; // window index
              from_source = s_window;
              if (wnext === 0) {           /* very common case */
                from += wsize - op;
                if (op < len) {         /* some from window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = _out - dist;  /* rest from output */
                  from_source = output;
                }
              }
              else if (wnext < op) {      /* wrap around window */
                from += wsize + wnext - op;
                op -= wnext;
                if (op < len) {         /* some from end of window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = 0;
                  if (wnext < len) {  /* some from start of window */
                    op = wnext;
                    len -= op;
                    do {
                      output[_out++] = s_window[from++];
                    } while (--op);
                    from = _out - dist;      /* rest from output */
                    from_source = output;
                  }
                }
              }
              else {                      /* contiguous in window */
                from += wnext - op;
                if (op < len) {         /* some from window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = _out - dist;  /* rest from output */
                  from_source = output;
                }
              }
              while (len > 2) {
                output[_out++] = from_source[from++];
                output[_out++] = from_source[from++];
                output[_out++] = from_source[from++];
                len -= 3;
              }
              if (len) {
                output[_out++] = from_source[from++];
                if (len > 1) {
                  output[_out++] = from_source[from++];
                }
              }
            }
            else {
              from = _out - dist;          /* copy direct from output */
              do {                        /* minimum length is three */
                output[_out++] = output[from++];
                output[_out++] = output[from++];
                output[_out++] = output[from++];
                len -= 3;
              } while (len > 2);
              if (len) {
                output[_out++] = output[from++];
                if (len > 1) {
                  output[_out++] = output[from++];
                }
              }
            }
          }
          else if ((op & 64) === 0) {          /* 2nd level distance code */
            here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
            continue dodist;
          }
          else {
            strm.msg = 'invalid distance code';
            state.mode = BAD;
            break top;
          }

          break; // need to emulate goto via "continue"
        }
      }
      else if ((op & 64) === 0) {              /* 2nd level length code */
        here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
        continue dolen;
      }
      else if (op & 32) {                     /* end-of-block */
        //Tracevv((stderr, "inflate:         end of block\n"));
        state.mode = TYPE;
        break top;
      }
      else {
        strm.msg = 'invalid literal/length code';
        state.mode = BAD;
        break top;
      }

      break; // need to emulate goto via "continue"
    }
  } while (_in < last && _out < end);

  /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  len = bits >> 3;
  _in -= len;
  bits -= len << 3;
  hold &= (1 << bits) - 1;

  /* update state and return */
  strm.next_in = _in;
  strm.next_out = _out;
  strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
  strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
  state.hold = hold;
  state.bits = bits;
  return;
};

},{}],70:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils         = require('../utils/common');
var adler32       = require('./adler32');
var crc32         = require('./crc32');
var inflate_fast  = require('./inffast');
var inflate_table = require('./inftrees');

var CODES = 0;
var LENS = 1;
var DISTS = 2;

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH      = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
//var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;

/* The deflate compression method */
var Z_DEFLATED  = 8;


/* STATES ====================================================================*/
/* ===========================================================================*/


var    HEAD = 1;       /* i: waiting for magic header */
var    FLAGS = 2;      /* i: waiting for method and flags (gzip) */
var    TIME = 3;       /* i: waiting for modification time (gzip) */
var    OS = 4;         /* i: waiting for extra flags and operating system (gzip) */
var    EXLEN = 5;      /* i: waiting for extra length (gzip) */
var    EXTRA = 6;      /* i: waiting for extra bytes (gzip) */
var    NAME = 7;       /* i: waiting for end of file name (gzip) */
var    COMMENT = 8;    /* i: waiting for end of comment (gzip) */
var    HCRC = 9;       /* i: waiting for header crc (gzip) */
var    DICTID = 10;    /* i: waiting for dictionary check value */
var    DICT = 11;      /* waiting for inflateSetDictionary() call */
var        TYPE = 12;      /* i: waiting for type bits, including last-flag bit */
var        TYPEDO = 13;    /* i: same, but skip check to exit inflate on new block */
var        STORED = 14;    /* i: waiting for stored size (length and complement) */
var        COPY_ = 15;     /* i/o: same as COPY below, but only first time in */
var        COPY = 16;      /* i/o: waiting for input or output to copy stored block */
var        TABLE = 17;     /* i: waiting for dynamic block table lengths */
var        LENLENS = 18;   /* i: waiting for code length code lengths */
var        CODELENS = 19;  /* i: waiting for length/lit and distance code lengths */
var            LEN_ = 20;      /* i: same as LEN below, but only first time in */
var            LEN = 21;       /* i: waiting for length/lit/eob code */
var            LENEXT = 22;    /* i: waiting for length extra bits */
var            DIST = 23;      /* i: waiting for distance code */
var            DISTEXT = 24;   /* i: waiting for distance extra bits */
var            MATCH = 25;     /* o: waiting for output space to copy string */
var            LIT = 26;       /* o: waiting for output space to write literal */
var    CHECK = 27;     /* i: waiting for 32-bit check value */
var    LENGTH = 28;    /* i: waiting for 32-bit length (gzip) */
var    DONE = 29;      /* finished check, done -- remain here until reset */
var    BAD = 30;       /* got a data error -- remain here until reset */
var    MEM = 31;       /* got an inflate() memory error -- remain here until reset */
var    SYNC = 32;      /* looking for synchronization bytes to restart inflate() */

/* ===========================================================================*/



var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH =  (ENOUGH_LENS+ENOUGH_DISTS);

var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_WBITS = MAX_WBITS;


function zswap32(q) {
  return  (((q >>> 24) & 0xff) +
          ((q >>> 8) & 0xff00) +
          ((q & 0xff00) << 8) +
          ((q & 0xff) << 24));
}


function InflateState() {
  this.mode = 0;             /* current inflate mode */
  this.last = false;          /* true if processing last block */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.havedict = false;      /* true if dictionary provided */
  this.flags = 0;             /* gzip header method and flags (0 if zlib) */
  this.dmax = 0;              /* zlib header max distance (INFLATE_STRICT) */
  this.check = 0;             /* protected copy of check value */
  this.total = 0;             /* protected copy of output count */
  // TODO: may be {}
  this.head = null;           /* where to save gzip header information */

  /* sliding window */
  this.wbits = 0;             /* log base 2 of requested window size */
  this.wsize = 0;             /* window size or zero if not using window */
  this.whave = 0;             /* valid bytes in the window */
  this.wnext = 0;             /* window write index */
  this.window = null;         /* allocated sliding window, if needed */

  /* bit accumulator */
  this.hold = 0;              /* input bit accumulator */
  this.bits = 0;              /* number of bits in "in" */

  /* for string and stored block copying */
  this.length = 0;            /* literal or length of data to copy */
  this.offset = 0;            /* distance back to copy string from */

  /* for table and code decoding */
  this.extra = 0;             /* extra bits needed */

  /* fixed and dynamic code tables */
  this.lencode = null;          /* starting table for length/literal codes */
  this.distcode = null;         /* starting table for distance codes */
  this.lenbits = 0;           /* index bits for lencode */
  this.distbits = 0;          /* index bits for distcode */

  /* dynamic table building */
  this.ncode = 0;             /* number of code length code lengths */
  this.nlen = 0;              /* number of length code lengths */
  this.ndist = 0;             /* number of distance code lengths */
  this.have = 0;              /* number of code lengths in lens[] */
  this.next = null;              /* next available space in codes[] */

  this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
  this.work = new utils.Buf16(288); /* work area for code table building */

  /*
   because we don't have pointers in js, we use lencode and distcode directly
   as buffers so we don't need codes
  */
  //this.codes = new utils.Buf32(ENOUGH);       /* space for code tables */
  this.lendyn = null;              /* dynamic table for length/literal codes (JS specific) */
  this.distdyn = null;             /* dynamic table for distance codes (JS specific) */
  this.sane = 0;                   /* if false, allow invalid distance too far */
  this.back = 0;                   /* bits back of last unprocessed length/lit */
  this.was = 0;                    /* initial length of match */
}

function inflateResetKeep(strm) {
  var state;

  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  strm.total_in = strm.total_out = state.total = 0;
  strm.msg = ''; /*Z_NULL*/
  if (state.wrap) {       /* to support ill-conceived Java test suite */
    strm.adler = state.wrap & 1;
  }
  state.mode = HEAD;
  state.last = 0;
  state.havedict = 0;
  state.dmax = 32768;
  state.head = null/*Z_NULL*/;
  state.hold = 0;
  state.bits = 0;
  //state.lencode = state.distcode = state.next = state.codes;
  state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
  state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);

  state.sane = 1;
  state.back = -1;
  //Tracev((stderr, "inflate: reset\n"));
  return Z_OK;
}

function inflateReset(strm) {
  var state;

  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  state.wsize = 0;
  state.whave = 0;
  state.wnext = 0;
  return inflateResetKeep(strm);

}

function inflateReset2(strm, windowBits) {
  var wrap;
  var state;

  /* get the state */
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;

  /* extract wrap request from windowBits parameter */
  if (windowBits < 0) {
    wrap = 0;
    windowBits = -windowBits;
  }
  else {
    wrap = (windowBits >> 4) + 1;
    if (windowBits < 48) {
      windowBits &= 15;
    }
  }

  /* set number of window bits, free window if different */
  if (windowBits && (windowBits < 8 || windowBits > 15)) {
    return Z_STREAM_ERROR;
  }
  if (state.window !== null && state.wbits !== windowBits) {
    state.window = null;
  }

  /* update state and reset the rest of it */
  state.wrap = wrap;
  state.wbits = windowBits;
  return inflateReset(strm);
}

function inflateInit2(strm, windowBits) {
  var ret;
  var state;

  if (!strm) { return Z_STREAM_ERROR; }
  //strm.msg = Z_NULL;                 /* in case we return an error */

  state = new InflateState();

  //if (state === Z_NULL) return Z_MEM_ERROR;
  //Tracev((stderr, "inflate: allocated\n"));
  strm.state = state;
  state.window = null/*Z_NULL*/;
  ret = inflateReset2(strm, windowBits);
  if (ret !== Z_OK) {
    strm.state = null/*Z_NULL*/;
  }
  return ret;
}

function inflateInit(strm) {
  return inflateInit2(strm, DEF_WBITS);
}


/*
 Return state with length and distance decoding tables and index sizes set to
 fixed code decoding.  Normally this returns fixed tables from inffixed.h.
 If BUILDFIXED is defined, then instead this routine builds the tables the
 first time it's called, and returns those tables the first time and
 thereafter.  This reduces the size of the code by about 2K bytes, in
 exchange for a little execution time.  However, BUILDFIXED should not be
 used for threaded applications, since the rewriting of the tables and virgin
 may not be thread-safe.
 */
var virgin = true;

var lenfix, distfix; // We have no pointers in JS, so keep tables separate

function fixedtables(state) {
  /* build fixed huffman tables if first call (may not be thread safe) */
  if (virgin) {
    var sym;

    lenfix = new utils.Buf32(512);
    distfix = new utils.Buf32(32);

    /* literal/length table */
    sym = 0;
    while (sym < 144) { state.lens[sym++] = 8; }
    while (sym < 256) { state.lens[sym++] = 9; }
    while (sym < 280) { state.lens[sym++] = 7; }
    while (sym < 288) { state.lens[sym++] = 8; }

    inflate_table(LENS,  state.lens, 0, 288, lenfix,   0, state.work, { bits: 9 });

    /* distance table */
    sym = 0;
    while (sym < 32) { state.lens[sym++] = 5; }

    inflate_table(DISTS, state.lens, 0, 32,   distfix, 0, state.work, { bits: 5 });

    /* do this just once */
    virgin = false;
  }

  state.lencode = lenfix;
  state.lenbits = 9;
  state.distcode = distfix;
  state.distbits = 5;
}


/*
 Update the window with the last wsize (normally 32K) bytes written before
 returning.  If window does not exist yet, create it.  This is only called
 when a window is already in use, or when output has been written during this
 inflate call, but the end of the deflate stream has not been reached yet.
 It is also called to create a window for dictionary data when a dictionary
 is loaded.

 Providing output buffers larger than 32K to inflate() should provide a speed
 advantage, since only the last 32K of output is copied to the sliding window
 upon return from inflate(), and since all distances after the first 32K of
 output will fall in the output data, making match copies simpler and faster.
 The advantage may be dependent on the size of the processor's data caches.
 */
function updatewindow(strm, src, end, copy) {
  var dist;
  var state = strm.state;

  /* if it hasn't been done already, allocate space for the window */
  if (state.window === null) {
    state.wsize = 1 << state.wbits;
    state.wnext = 0;
    state.whave = 0;

    state.window = new utils.Buf8(state.wsize);
  }

  /* copy state->wsize or less output bytes into the circular window */
  if (copy >= state.wsize) {
    utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
    state.wnext = 0;
    state.whave = state.wsize;
  }
  else {
    dist = state.wsize - state.wnext;
    if (dist > copy) {
      dist = copy;
    }
    //zmemcpy(state->window + state->wnext, end - copy, dist);
    utils.arraySet(state.window, src, end - copy, dist, state.wnext);
    copy -= dist;
    if (copy) {
      //zmemcpy(state->window, end - copy, copy);
      utils.arraySet(state.window, src, end - copy, copy, 0);
      state.wnext = copy;
      state.whave = state.wsize;
    }
    else {
      state.wnext += dist;
      if (state.wnext === state.wsize) { state.wnext = 0; }
      if (state.whave < state.wsize) { state.whave += dist; }
    }
  }
  return 0;
}

function inflate(strm, flush) {
  var state;
  var input, output;          // input/output buffers
  var next;                   /* next input INDEX */
  var put;                    /* next output INDEX */
  var have, left;             /* available input and output */
  var hold;                   /* bit buffer */
  var bits;                   /* bits in bit buffer */
  var _in, _out;              /* save starting available input and output */
  var copy;                   /* number of stored or match bytes to copy */
  var from;                   /* where to copy match bytes from */
  var from_source;
  var here = 0;               /* current decoding table entry */
  var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
  //var last;                   /* parent table entry */
  var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
  var len;                    /* length to copy for repeats, bits to drop */
  var ret;                    /* return code */
  var hbuf = new utils.Buf8(4);    /* buffer for gzip header crc calculation */
  var opts;

  var n; // temporary var for NEED_BITS

  var order = /* permutation of code lengths */
    [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];


  if (!strm || !strm.state || !strm.output ||
      (!strm.input && strm.avail_in !== 0)) {
    return Z_STREAM_ERROR;
  }

  state = strm.state;
  if (state.mode === TYPE) { state.mode = TYPEDO; }    /* skip check */


  //--- LOAD() ---
  put = strm.next_out;
  output = strm.output;
  left = strm.avail_out;
  next = strm.next_in;
  input = strm.input;
  have = strm.avail_in;
  hold = state.hold;
  bits = state.bits;
  //---

  _in = have;
  _out = left;
  ret = Z_OK;

  inf_leave: // goto emulation
  for (;;) {
    switch (state.mode) {
    case HEAD:
      if (state.wrap === 0) {
        state.mode = TYPEDO;
        break;
      }
      //=== NEEDBITS(16);
      while (bits < 16) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      if ((state.wrap & 2) && hold === 0x8b1f) {  /* gzip header */
        state.check = 0/*crc32(0L, Z_NULL, 0)*/;
        //=== CRC2(state.check, hold);
        hbuf[0] = hold & 0xff;
        hbuf[1] = (hold >>> 8) & 0xff;
        state.check = crc32(state.check, hbuf, 2, 0);
        //===//

        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = FLAGS;
        break;
      }
      state.flags = 0;           /* expect zlib header */
      if (state.head) {
        state.head.done = false;
      }
      if (!(state.wrap & 1) ||   /* check if zlib header allowed */
        (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
        strm.msg = 'incorrect header check';
        state.mode = BAD;
        break;
      }
      if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
        strm.msg = 'unknown compression method';
        state.mode = BAD;
        break;
      }
      //--- DROPBITS(4) ---//
      hold >>>= 4;
      bits -= 4;
      //---//
      len = (hold & 0x0f)/*BITS(4)*/ + 8;
      if (state.wbits === 0) {
        state.wbits = len;
      }
      else if (len > state.wbits) {
        strm.msg = 'invalid window size';
        state.mode = BAD;
        break;
      }
      state.dmax = 1 << len;
      //Tracev((stderr, "inflate:   zlib header ok\n"));
      strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
      state.mode = hold & 0x200 ? DICTID : TYPE;
      //=== INITBITS();
      hold = 0;
      bits = 0;
      //===//
      break;
    case FLAGS:
      //=== NEEDBITS(16); */
      while (bits < 16) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      state.flags = hold;
      if ((state.flags & 0xff) !== Z_DEFLATED) {
        strm.msg = 'unknown compression method';
        state.mode = BAD;
        break;
      }
      if (state.flags & 0xe000) {
        strm.msg = 'unknown header flags set';
        state.mode = BAD;
        break;
      }
      if (state.head) {
        state.head.text = ((hold >> 8) & 1);
      }
      if (state.flags & 0x0200) {
        //=== CRC2(state.check, hold);
        hbuf[0] = hold & 0xff;
        hbuf[1] = (hold >>> 8) & 0xff;
        state.check = crc32(state.check, hbuf, 2, 0);
        //===//
      }
      //=== INITBITS();
      hold = 0;
      bits = 0;
      //===//
      state.mode = TIME;
      /* falls through */
    case TIME:
      //=== NEEDBITS(32); */
      while (bits < 32) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      if (state.head) {
        state.head.time = hold;
      }
      if (state.flags & 0x0200) {
        //=== CRC4(state.check, hold)
        hbuf[0] = hold & 0xff;
        hbuf[1] = (hold >>> 8) & 0xff;
        hbuf[2] = (hold >>> 16) & 0xff;
        hbuf[3] = (hold >>> 24) & 0xff;
        state.check = crc32(state.check, hbuf, 4, 0);
        //===
      }
      //=== INITBITS();
      hold = 0;
      bits = 0;
      //===//
      state.mode = OS;
      /* falls through */
    case OS:
      //=== NEEDBITS(16); */
      while (bits < 16) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      if (state.head) {
        state.head.xflags = (hold & 0xff);
        state.head.os = (hold >> 8);
      }
      if (state.flags & 0x0200) {
        //=== CRC2(state.check, hold);
        hbuf[0] = hold & 0xff;
        hbuf[1] = (hold >>> 8) & 0xff;
        state.check = crc32(state.check, hbuf, 2, 0);
        //===//
      }
      //=== INITBITS();
      hold = 0;
      bits = 0;
      //===//
      state.mode = EXLEN;
      /* falls through */
    case EXLEN:
      if (state.flags & 0x0400) {
        //=== NEEDBITS(16); */
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.length = hold;
        if (state.head) {
          state.head.extra_len = hold;
        }
        if (state.flags & 0x0200) {
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
      }
      else if (state.head) {
        state.head.extra = null/*Z_NULL*/;
      }
      state.mode = EXTRA;
      /* falls through */
    case EXTRA:
      if (state.flags & 0x0400) {
        copy = state.length;
        if (copy > have) { copy = have; }
        if (copy) {
          if (state.head) {
            len = state.head.extra_len - state.length;
            if (!state.head.extra) {
              // Use untyped array for more conveniend processing later
              state.head.extra = new Array(state.head.extra_len);
            }
            utils.arraySet(
              state.head.extra,
              input,
              next,
              // extra field is limited to 65536 bytes
              // - no need for additional size check
              copy,
              /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
              len
            );
            //zmemcpy(state.head.extra + len, next,
            //        len + copy > state.head.extra_max ?
            //        state.head.extra_max - len : copy);
          }
          if (state.flags & 0x0200) {
            state.check = crc32(state.check, input, copy, next);
          }
          have -= copy;
          next += copy;
          state.length -= copy;
        }
        if (state.length) { break inf_leave; }
      }
      state.length = 0;
      state.mode = NAME;
      /* falls through */
    case NAME:
      if (state.flags & 0x0800) {
        if (have === 0) { break inf_leave; }
        copy = 0;
        do {
          // TODO: 2 or 1 bytes?
          len = input[next + copy++];
          /* use constant limit because in js we should not preallocate memory */
          if (state.head && len &&
              (state.length < 65536 /*state.head.name_max*/)) {
            state.head.name += String.fromCharCode(len);
          }
        } while (len && copy < have);

        if (state.flags & 0x0200) {
          state.check = crc32(state.check, input, copy, next);
        }
        have -= copy;
        next += copy;
        if (len) { break inf_leave; }
      }
      else if (state.head) {
        state.head.name = null;
      }
      state.length = 0;
      state.mode = COMMENT;
      /* falls through */
    case COMMENT:
      if (state.flags & 0x1000) {
        if (have === 0) { break inf_leave; }
        copy = 0;
        do {
          len = input[next + copy++];
          /* use constant limit because in js we should not preallocate memory */
          if (state.head && len &&
              (state.length < 65536 /*state.head.comm_max*/)) {
            state.head.comment += String.fromCharCode(len);
          }
        } while (len && copy < have);
        if (state.flags & 0x0200) {
          state.check = crc32(state.check, input, copy, next);
        }
        have -= copy;
        next += copy;
        if (len) { break inf_leave; }
      }
      else if (state.head) {
        state.head.comment = null;
      }
      state.mode = HCRC;
      /* falls through */
    case HCRC:
      if (state.flags & 0x0200) {
        //=== NEEDBITS(16); */
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if (hold !== (state.check & 0xffff)) {
          strm.msg = 'header crc mismatch';
          state.mode = BAD;
          break;
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
      }
      if (state.head) {
        state.head.hcrc = ((state.flags >> 9) & 1);
        state.head.done = true;
      }
      strm.adler = state.check = 0;
      state.mode = TYPE;
      break;
    case DICTID:
      //=== NEEDBITS(32); */
      while (bits < 32) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      strm.adler = state.check = zswap32(hold);
      //=== INITBITS();
      hold = 0;
      bits = 0;
      //===//
      state.mode = DICT;
      /* falls through */
    case DICT:
      if (state.havedict === 0) {
        //--- RESTORE() ---
        strm.next_out = put;
        strm.avail_out = left;
        strm.next_in = next;
        strm.avail_in = have;
        state.hold = hold;
        state.bits = bits;
        //---
        return Z_NEED_DICT;
      }
      strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
      state.mode = TYPE;
      /* falls through */
    case TYPE:
      if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
      /* falls through */
    case TYPEDO:
      if (state.last) {
        //--- BYTEBITS() ---//
        hold >>>= bits & 7;
        bits -= bits & 7;
        //---//
        state.mode = CHECK;
        break;
      }
      //=== NEEDBITS(3); */
      while (bits < 3) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      state.last = (hold & 0x01)/*BITS(1)*/;
      //--- DROPBITS(1) ---//
      hold >>>= 1;
      bits -= 1;
      //---//

      switch ((hold & 0x03)/*BITS(2)*/) {
      case 0:                             /* stored block */
        //Tracev((stderr, "inflate:     stored block%s\n",
        //        state.last ? " (last)" : ""));
        state.mode = STORED;
        break;
      case 1:                             /* fixed block */
        fixedtables(state);
        //Tracev((stderr, "inflate:     fixed codes block%s\n",
        //        state.last ? " (last)" : ""));
        state.mode = LEN_;             /* decode codes */
        if (flush === Z_TREES) {
          //--- DROPBITS(2) ---//
          hold >>>= 2;
          bits -= 2;
          //---//
          break inf_leave;
        }
        break;
      case 2:                             /* dynamic block */
        //Tracev((stderr, "inflate:     dynamic codes block%s\n",
        //        state.last ? " (last)" : ""));
        state.mode = TABLE;
        break;
      case 3:
        strm.msg = 'invalid block type';
        state.mode = BAD;
      }
      //--- DROPBITS(2) ---//
      hold >>>= 2;
      bits -= 2;
      //---//
      break;
    case STORED:
      //--- BYTEBITS() ---// /* go to byte boundary */
      hold >>>= bits & 7;
      bits -= bits & 7;
      //---//
      //=== NEEDBITS(32); */
      while (bits < 32) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
        strm.msg = 'invalid stored block lengths';
        state.mode = BAD;
        break;
      }
      state.length = hold & 0xffff;
      //Tracev((stderr, "inflate:       stored length %u\n",
      //        state.length));
      //=== INITBITS();
      hold = 0;
      bits = 0;
      //===//
      state.mode = COPY_;
      if (flush === Z_TREES) { break inf_leave; }
      /* falls through */
    case COPY_:
      state.mode = COPY;
      /* falls through */
    case COPY:
      copy = state.length;
      if (copy) {
        if (copy > have) { copy = have; }
        if (copy > left) { copy = left; }
        if (copy === 0) { break inf_leave; }
        //--- zmemcpy(put, next, copy); ---
        utils.arraySet(output, input, next, copy, put);
        //---//
        have -= copy;
        next += copy;
        left -= copy;
        put += copy;
        state.length -= copy;
        break;
      }
      //Tracev((stderr, "inflate:       stored end\n"));
      state.mode = TYPE;
      break;
    case TABLE:
      //=== NEEDBITS(14); */
      while (bits < 14) {
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
      }
      //===//
      state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
      //--- DROPBITS(5) ---//
      hold >>>= 5;
      bits -= 5;
      //---//
      state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
      //--- DROPBITS(5) ---//
      hold >>>= 5;
      bits -= 5;
      //---//
      state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
      //--- DROPBITS(4) ---//
      hold >>>= 4;
      bits -= 4;
      //---//
//#ifndef PKZIP_BUG_WORKAROUND
      if (state.nlen > 286 || state.ndist > 30) {
        strm.msg = 'too many length or distance symbols';
        state.mode = BAD;
        break;
      }
//#endif
      //Tracev((stderr, "inflate:       table sizes ok\n"));
      state.have = 0;
      state.mode = LENLENS;
      /* falls through */
    case LENLENS:
      while (state.have < state.ncode) {
        //=== NEEDBITS(3);
        while (bits < 3) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
        //--- DROPBITS(3) ---//
        hold >>>= 3;
        bits -= 3;
        //---//
      }
      while (state.have < 19) {
        state.lens[order[state.have++]] = 0;
      }
      // We have separate tables & no pointers. 2 commented lines below not needed.
      //state.next = state.codes;
      //state.lencode = state.next;
      // Switch to use dynamic table
      state.lencode = state.lendyn;
      state.lenbits = 7;

      opts = { bits: state.lenbits };
      ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
      state.lenbits = opts.bits;

      if (ret) {
        strm.msg = 'invalid code lengths set';
        state.mode = BAD;
        break;
      }
      //Tracev((stderr, "inflate:       code lengths ok\n"));
      state.have = 0;
      state.mode = CODELENS;
      /* falls through */
    case CODELENS:
      while (state.have < state.nlen + state.ndist) {
        for (;;) {
          here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if ((here_bits) <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        if (here_val < 16) {
          //--- DROPBITS(here.bits) ---//
          hold >>>= here_bits;
          bits -= here_bits;
          //---//
          state.lens[state.have++] = here_val;
        }
        else {
          if (here_val === 16) {
            //=== NEEDBITS(here.bits + 2);
            n = here_bits + 2;
            while (bits < n) {
              if (have === 0) { break inf_leave; }
              have--;
              hold += input[next++] << bits;
              bits += 8;
            }
            //===//
            //--- DROPBITS(here.bits) ---//
            hold >>>= here_bits;
            bits -= here_bits;
            //---//
            if (state.have === 0) {
              strm.msg = 'invalid bit length repeat';
              state.mode = BAD;
              break;
            }
            len = state.lens[state.have - 1];
            copy = 3 + (hold & 0x03);//BITS(2);
            //--- DROPBITS(2) ---//
            hold >>>= 2;
            bits -= 2;
            //---//
          }
          else if (here_val === 17) {
            //=== NEEDBITS(here.bits + 3);
            n = here_bits + 3;
            while (bits < n) {
              if (have === 0) { break inf_leave; }
              have--;
              hold += input[next++] << bits;
              bits += 8;
            }
            //===//
            //--- DROPBITS(here.bits) ---//
            hold >>>= here_bits;
            bits -= here_bits;
            //---//
            len = 0;
            copy = 3 + (hold & 0x07);//BITS(3);
            //--- DROPBITS(3) ---//
            hold >>>= 3;
            bits -= 3;
            //---//
          }
          else {
            //=== NEEDBITS(here.bits + 7);
            n = here_bits + 7;
            while (bits < n) {
              if (have === 0) { break inf_leave; }
              have--;
              hold += input[next++] << bits;
              bits += 8;
            }
            //===//
            //--- DROPBITS(here.bits) ---//
            hold >>>= here_bits;
            bits -= here_bits;
            //---//
            len = 0;
            copy = 11 + (hold & 0x7f);//BITS(7);
            //--- DROPBITS(7) ---//
            hold >>>= 7;
            bits -= 7;
            //---//
          }
          if (state.have + copy > state.nlen + state.ndist) {
            strm.msg = 'invalid bit length repeat';
            state.mode = BAD;
            break;
          }
          while (copy--) {
            state.lens[state.have++] = len;
          }
        }
      }

      /* handle error breaks in while */
      if (state.mode === BAD) { break; }

      /* check for end-of-block code (better have one) */
      if (state.lens[256] === 0) {
        strm.msg = 'invalid code -- missing end-of-block';
        state.mode = BAD;
        break;
      }

      /* build code tables -- note: do not change the lenbits or distbits
         values here (9 and 6) without reading the comments in inftrees.h
         concerning the ENOUGH constants, which depend on those values */
      state.lenbits = 9;

      opts = { bits: state.lenbits };
      ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
      // We have separate tables & no pointers. 2 commented lines below not needed.
      // state.next_index = opts.table_index;
      state.lenbits = opts.bits;
      // state.lencode = state.next;

      if (ret) {
        strm.msg = 'invalid literal/lengths set';
        state.mode = BAD;
        break;
      }

      state.distbits = 6;
      //state.distcode.copy(state.codes);
      // Switch to use dynamic table
      state.distcode = state.distdyn;
      opts = { bits: state.distbits };
      ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
      // We have separate tables & no pointers. 2 commented lines below not needed.
      // state.next_index = opts.table_index;
      state.distbits = opts.bits;
      // state.distcode = state.next;

      if (ret) {
        strm.msg = 'invalid distances set';
        state.mode = BAD;
        break;
      }
      //Tracev((stderr, 'inflate:       codes ok\n'));
      state.mode = LEN_;
      if (flush === Z_TREES) { break inf_leave; }
      /* falls through */
    case LEN_:
      state.mode = LEN;
      /* falls through */
    case LEN:
      if (have >= 6 && left >= 258) {
        //--- RESTORE() ---
        strm.next_out = put;
        strm.avail_out = left;
        strm.next_in = next;
        strm.avail_in = have;
        state.hold = hold;
        state.bits = bits;
        //---
        inflate_fast(strm, _out);
        //--- LOAD() ---
        put = strm.next_out;
        output = strm.output;
        left = strm.avail_out;
        next = strm.next_in;
        input = strm.input;
        have = strm.avail_in;
        hold = state.hold;
        bits = state.bits;
        //---

        if (state.mode === TYPE) {
          state.back = -1;
        }
        break;
      }
      state.back = 0;
      for (;;) {
        here = state.lencode[hold & ((1 << state.lenbits) - 1)];  /*BITS(state.lenbits)*/
        here_bits = here >>> 24;
        here_op = (here >>> 16) & 0xff;
        here_val = here & 0xffff;

        if (here_bits <= bits) { break; }
        //--- PULLBYTE() ---//
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
        //---//
      }
      if (here_op && (here_op & 0xf0) === 0) {
        last_bits = here_bits;
        last_op = here_op;
        last_val = here_val;
        for (;;) {
          here = state.lencode[last_val +
                  ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if ((last_bits + here_bits) <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        //--- DROPBITS(last.bits) ---//
        hold >>>= last_bits;
        bits -= last_bits;
        //---//
        state.back += last_bits;
      }
      //--- DROPBITS(here.bits) ---//
      hold >>>= here_bits;
      bits -= here_bits;
      //---//
      state.back += here_bits;
      state.length = here_val;
      if (here_op === 0) {
        //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
        //        "inflate:         literal '%c'\n" :
        //        "inflate:         literal 0x%02x\n", here.val));
        state.mode = LIT;
        break;
      }
      if (here_op & 32) {
        //Tracevv((stderr, "inflate:         end of block\n"));
        state.back = -1;
        state.mode = TYPE;
        break;
      }
      if (here_op & 64) {
        strm.msg = 'invalid literal/length code';
        state.mode = BAD;
        break;
      }
      state.extra = here_op & 15;
      state.mode = LENEXT;
      /* falls through */
    case LENEXT:
      if (state.extra) {
        //=== NEEDBITS(state.extra);
        n = state.extra;
        while (bits < n) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
        //--- DROPBITS(state.extra) ---//
        hold >>>= state.extra;
        bits -= state.extra;
        //---//
        state.back += state.extra;
      }
      //Tracevv((stderr, "inflate:         length %u\n", state.length));
      state.was = state.length;
      state.mode = DIST;
      /* falls through */
    case DIST:
      for (;;) {
        here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
        here_bits = here >>> 24;
        here_op = (here >>> 16) & 0xff;
        here_val = here & 0xffff;

        if ((here_bits) <= bits) { break; }
        //--- PULLBYTE() ---//
        if (have === 0) { break inf_leave; }
        have--;
        hold += input[next++] << bits;
        bits += 8;
        //---//
      }
      if ((here_op & 0xf0) === 0) {
        last_bits = here_bits;
        last_op = here_op;
        last_val = here_val;
        for (;;) {
          here = state.distcode[last_val +
                  ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if ((last_bits + here_bits) <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        //--- DROPBITS(last.bits) ---//
        hold >>>= last_bits;
        bits -= last_bits;
        //---//
        state.back += last_bits;
      }
      //--- DROPBITS(here.bits) ---//
      hold >>>= here_bits;
      bits -= here_bits;
      //---//
      state.back += here_bits;
      if (here_op & 64) {
        strm.msg = 'invalid distance code';
        state.mode = BAD;
        break;
      }
      state.offset = here_val;
      state.extra = (here_op) & 15;
      state.mode = DISTEXT;
      /* falls through */
    case DISTEXT:
      if (state.extra) {
        //=== NEEDBITS(state.extra);
        n = state.extra;
        while (bits < n) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
        //--- DROPBITS(state.extra) ---//
        hold >>>= state.extra;
        bits -= state.extra;
        //---//
        state.back += state.extra;
      }
//#ifdef INFLATE_STRICT
      if (state.offset > state.dmax) {
        strm.msg = 'invalid distance too far back';
        state.mode = BAD;
        break;
      }
//#endif
      //Tracevv((stderr, "inflate:         distance %u\n", state.offset));
      state.mode = MATCH;
      /* falls through */
    case MATCH:
      if (left === 0) { break inf_leave; }
      copy = _out - left;
      if (state.offset > copy) {         /* copy from window */
        copy = state.offset - copy;
        if (copy > state.whave) {
          if (state.sane) {
            strm.msg = 'invalid distance too far back';
            state.mode = BAD;
            break;
          }
// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
//          Trace((stderr, "inflate.c too far\n"));
//          copy -= state.whave;
//          if (copy > state.length) { copy = state.length; }
//          if (copy > left) { copy = left; }
//          left -= copy;
//          state.length -= copy;
//          do {
//            output[put++] = 0;
//          } while (--copy);
//          if (state.length === 0) { state.mode = LEN; }
//          break;
//#endif
        }
        if (copy > state.wnext) {
          copy -= state.wnext;
          from = state.wsize - copy;
        }
        else {
          from = state.wnext - copy;
        }
        if (copy > state.length) { copy = state.length; }
        from_source = state.window;
      }
      else {                              /* copy from output */
        from_source = output;
        from = put - state.offset;
        copy = state.length;
      }
      if (copy > left) { copy = left; }
      left -= copy;
      state.length -= copy;
      do {
        output[put++] = from_source[from++];
      } while (--copy);
      if (state.length === 0) { state.mode = LEN; }
      break;
    case LIT:
      if (left === 0) { break inf_leave; }
      output[put++] = state.length;
      left--;
      state.mode = LEN;
      break;
    case CHECK:
      if (state.wrap) {
        //=== NEEDBITS(32);
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          // Use '|' insdead of '+' to make sure that result is signed
          hold |= input[next++] << bits;
          bits += 8;
        }
        //===//
        _out -= left;
        strm.total_out += _out;
        state.total += _out;
        if (_out) {
          strm.adler = state.check =
              /*UPDATE(state.check, put - _out, _out);*/
              (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));

        }
        _out = left;
        // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
        if ((state.flags ? hold : zswap32(hold)) !== state.check) {
          strm.msg = 'incorrect data check';
          state.mode = BAD;
          break;
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        //Tracev((stderr, "inflate:   check matches trailer\n"));
      }
      state.mode = LENGTH;
      /* falls through */
    case LENGTH:
      if (state.wrap && state.flags) {
        //=== NEEDBITS(32);
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if (hold !== (state.total & 0xffffffff)) {
          strm.msg = 'incorrect length check';
          state.mode = BAD;
          break;
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        //Tracev((stderr, "inflate:   length matches trailer\n"));
      }
      state.mode = DONE;
      /* falls through */
    case DONE:
      ret = Z_STREAM_END;
      break inf_leave;
    case BAD:
      ret = Z_DATA_ERROR;
      break inf_leave;
    case MEM:
      return Z_MEM_ERROR;
    case SYNC:
      /* falls through */
    default:
      return Z_STREAM_ERROR;
    }
  }

  // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"

  /*
     Return from inflate(), updating the total counts and the check value.
     If there was no progress during the inflate() call, return a buffer
     error.  Call updatewindow() to create and/or update the window state.
     Note: a memory error from inflate() is non-recoverable.
   */

  //--- RESTORE() ---
  strm.next_out = put;
  strm.avail_out = left;
  strm.next_in = next;
  strm.avail_in = have;
  state.hold = hold;
  state.bits = bits;
  //---

  if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
                      (state.mode < CHECK || flush !== Z_FINISH))) {
    if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
      state.mode = MEM;
      return Z_MEM_ERROR;
    }
  }
  _in -= strm.avail_in;
  _out -= strm.avail_out;
  strm.total_in += _in;
  strm.total_out += _out;
  state.total += _out;
  if (state.wrap && _out) {
    strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
      (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
  }
  strm.data_type = state.bits + (state.last ? 64 : 0) +
                    (state.mode === TYPE ? 128 : 0) +
                    (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
  if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
    ret = Z_BUF_ERROR;
  }
  return ret;
}

function inflateEnd(strm) {

  if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
    return Z_STREAM_ERROR;
  }

  var state = strm.state;
  if (state.window) {
    state.window = null;
  }
  strm.state = null;
  return Z_OK;
}

function inflateGetHeader(strm, head) {
  var state;

  /* check state */
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }

  /* save header structure */
  state.head = head;
  head.done = false;
  return Z_OK;
}

function inflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var state;
  var dictid;
  var ret;

  /* check state */
  if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
  state = strm.state;

  if (state.wrap !== 0 && state.mode !== DICT) {
    return Z_STREAM_ERROR;
  }

  /* check for correct dictionary identifier */
  if (state.mode === DICT) {
    dictid = 1; /* adler32(0, null, 0)*/
    /* dictid = adler32(dictid, dictionary, dictLength); */
    dictid = adler32(dictid, dictionary, dictLength, 0);
    if (dictid !== state.check) {
      return Z_DATA_ERROR;
    }
  }
  /* copy dictionary to window using updatewindow(), which will amend the
   existing dictionary if appropriate */
  ret = updatewindow(strm, dictionary, dictLength, dictLength);
  if (ret) {
    state.mode = MEM;
    return Z_MEM_ERROR;
  }
  state.havedict = 1;
  // Tracev((stderr, "inflate:   dictionary set\n"));
  return Z_OK;
}

exports.inflateReset = inflateReset;
exports.inflateReset2 = inflateReset2;
exports.inflateResetKeep = inflateResetKeep;
exports.inflateInit = inflateInit;
exports.inflateInit2 = inflateInit2;
exports.inflate = inflate;
exports.inflateEnd = inflateEnd;
exports.inflateGetHeader = inflateGetHeader;
exports.inflateSetDictionary = inflateSetDictionary;
exports.inflateInfo = 'pako inflate (from Nodeca project)';

/* Not implemented
exports.inflateCopy = inflateCopy;
exports.inflateGetDictionary = inflateGetDictionary;
exports.inflateMark = inflateMark;
exports.inflatePrime = inflatePrime;
exports.inflateSync = inflateSync;
exports.inflateSyncPoint = inflateSyncPoint;
exports.inflateUndermine = inflateUndermine;
*/

},{"../utils/common":62,"./adler32":64,"./crc32":66,"./inffast":69,"./inftrees":71}],71:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils = require('../utils/common');

var MAXBITS = 15;
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);

var CODES = 0;
var LENS = 1;
var DISTS = 2;

var lbase = [ /* Length codes 257..285 base */
  3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
];

var lext = [ /* Length codes 257..285 extra */
  16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
  19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
];

var dbase = [ /* Distance codes 0..29 base */
  1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  8193, 12289, 16385, 24577, 0, 0
];

var dext = [ /* Distance codes 0..29 extra */
  16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
  23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
  28, 28, 29, 29, 64, 64
];

module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
  var bits = opts.bits;
      //here = opts.here; /* table entry for duplication */

  var len = 0;               /* a code's length in bits */
  var sym = 0;               /* index of code symbols */
  var min = 0, max = 0;          /* minimum and maximum code lengths */
  var root = 0;              /* number of index bits for root table */
  var curr = 0;              /* number of index bits for current table */
  var drop = 0;              /* code bits to drop for sub-table */
  var left = 0;                   /* number of prefix codes available */
  var used = 0;              /* code entries in table used */
  var huff = 0;              /* Huffman code */
  var incr;              /* for incrementing code, index */
  var fill;              /* index for replicating entries */
  var low;               /* low bits for current root entry */
  var mask;              /* mask for low root bits */
  var next;             /* next available space in table */
  var base = null;     /* base value table to use */
  var base_index = 0;
//  var shoextra;    /* extra bits table to use */
  var end;                    /* use base and extra for symbol > end */
  var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];    /* number of codes of each length */
  var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];     /* offsets in table for each length */
  var extra = null;
  var extra_index = 0;

  var here_bits, here_op, here_val;

  /*
   Process a set of code lengths to create a canonical Huffman code.  The
   code lengths are lens[0..codes-1].  Each length corresponds to the
   symbols 0..codes-1.  The Huffman code is generated by first sorting the
   symbols by length from short to long, and retaining the symbol order
   for codes with equal lengths.  Then the code starts with all zero bits
   for the first code of the shortest length, and the codes are integer
   increments for the same length, and zeros are appended as the length
   increases.  For the deflate format, these bits are stored backwards
   from their more natural integer increment ordering, and so when the
   decoding tables are built in the large loop below, the integer codes
   are incremented backwards.

   This routine assumes, but does not check, that all of the entries in
   lens[] are in the range 0..MAXBITS.  The caller must assure this.
   1..MAXBITS is interpreted as that code length.  zero means that that
   symbol does not occur in this code.

   The codes are sorted by computing a count of codes for each length,
   creating from that a table of starting indices for each length in the
   sorted table, and then entering the symbols in order in the sorted
   table.  The sorted table is work[], with that space being provided by
   the caller.

   The length counts are used for other purposes as well, i.e. finding
   the minimum and maximum length codes, determining if there are any
   codes at all, checking for a valid set of lengths, and looking ahead
   at length counts to determine sub-table sizes when building the
   decoding tables.
   */

  /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  for (len = 0; len <= MAXBITS; len++) {
    count[len] = 0;
  }
  for (sym = 0; sym < codes; sym++) {
    count[lens[lens_index + sym]]++;
  }

  /* bound code lengths, force root to be within code lengths */
  root = bits;
  for (max = MAXBITS; max >= 1; max--) {
    if (count[max] !== 0) { break; }
  }
  if (root > max) {
    root = max;
  }
  if (max === 0) {                     /* no symbols to code at all */
    //table.op[opts.table_index] = 64;  //here.op = (var char)64;    /* invalid code marker */
    //table.bits[opts.table_index] = 1;   //here.bits = (var char)1;
    //table.val[opts.table_index++] = 0;   //here.val = (var short)0;
    table[table_index++] = (1 << 24) | (64 << 16) | 0;


    //table.op[opts.table_index] = 64;
    //table.bits[opts.table_index] = 1;
    //table.val[opts.table_index++] = 0;
    table[table_index++] = (1 << 24) | (64 << 16) | 0;

    opts.bits = 1;
    return 0;     /* no symbols, but wait for decoding to report error */
  }
  for (min = 1; min < max; min++) {
    if (count[min] !== 0) { break; }
  }
  if (root < min) {
    root = min;
  }

  /* check for an over-subscribed or incomplete set of lengths */
  left = 1;
  for (len = 1; len <= MAXBITS; len++) {
    left <<= 1;
    left -= count[len];
    if (left < 0) {
      return -1;
    }        /* over-subscribed */
  }
  if (left > 0 && (type === CODES || max !== 1)) {
    return -1;                      /* incomplete set */
  }

  /* generate offsets into symbol table for each length for sorting */
  offs[1] = 0;
  for (len = 1; len < MAXBITS; len++) {
    offs[len + 1] = offs[len] + count[len];
  }

  /* sort symbols by length, by symbol order within each length */
  for (sym = 0; sym < codes; sym++) {
    if (lens[lens_index + sym] !== 0) {
      work[offs[lens[lens_index + sym]]++] = sym;
    }
  }

  /*
   Create and fill in decoding tables.  In this loop, the table being
   filled is at next and has curr index bits.  The code being used is huff
   with length len.  That code is converted to an index by dropping drop
   bits off of the bottom.  For codes where len is less than drop + curr,
   those top drop + curr - len bits are incremented through all values to
   fill the table with replicated entries.

   root is the number of index bits for the root table.  When len exceeds
   root, sub-tables are created pointed to by the root entry with an index
   of the low root bits of huff.  This is saved in low to check for when a
   new sub-table should be started.  drop is zero when the root table is
   being filled, and drop is root when sub-tables are being filled.

   When a new sub-table is needed, it is necessary to look ahead in the
   code lengths to determine what size sub-table is needed.  The length
   counts are used for this, and so count[] is decremented as codes are
   entered in the tables.

   used keeps track of how many table entries have been allocated from the
   provided *table space.  It is checked for LENS and DIST tables against
   the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
   the initial root table size constants.  See the comments in inftrees.h
   for more information.

   sym increments through all symbols, and the loop terminates when
   all codes of length max, i.e. all codes, have been processed.  This
   routine permits incomplete codes, so another loop after this one fills
   in the rest of the decoding tables with invalid code markers.
   */

  /* set up for code type */
  // poor man optimization - use if-else instead of switch,
  // to avoid deopts in old v8
  if (type === CODES) {
    base = extra = work;    /* dummy value--not used */
    end = 19;

  } else if (type === LENS) {
    base = lbase;
    base_index -= 257;
    extra = lext;
    extra_index -= 257;
    end = 256;

  } else {                    /* DISTS */
    base = dbase;
    extra = dext;
    end = -1;
  }

  /* initialize opts for loop */
  huff = 0;                   /* starting code */
  sym = 0;                    /* starting code symbol */
  len = min;                  /* starting code length */
  next = table_index;              /* current table to fill in */
  curr = root;                /* current table index bits */
  drop = 0;                   /* current bits to drop from code for index */
  low = -1;                   /* trigger new sub-table when len > root */
  used = 1 << root;          /* use root table entries */
  mask = used - 1;            /* mask for comparing low */

  /* check available table space */
  if ((type === LENS && used > ENOUGH_LENS) ||
    (type === DISTS && used > ENOUGH_DISTS)) {
    return 1;
  }

  /* process all codes and make table entries */
  for (;;) {
    /* create table entry */
    here_bits = len - drop;
    if (work[sym] < end) {
      here_op = 0;
      here_val = work[sym];
    }
    else if (work[sym] > end) {
      here_op = extra[extra_index + work[sym]];
      here_val = base[base_index + work[sym]];
    }
    else {
      here_op = 32 + 64;         /* end of block */
      here_val = 0;
    }

    /* replicate for those indices with low len bits equal to huff */
    incr = 1 << (len - drop);
    fill = 1 << curr;
    min = fill;                 /* save offset to next table */
    do {
      fill -= incr;
      table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
    } while (fill !== 0);

    /* backwards increment the len-bit code huff */
    incr = 1 << (len - 1);
    while (huff & incr) {
      incr >>= 1;
    }
    if (incr !== 0) {
      huff &= incr - 1;
      huff += incr;
    } else {
      huff = 0;
    }

    /* go to next symbol, update count, len */
    sym++;
    if (--count[len] === 0) {
      if (len === max) { break; }
      len = lens[lens_index + work[sym]];
    }

    /* create new sub-table if needed */
    if (len > root && (huff & mask) !== low) {
      /* if first time, transition to sub-tables */
      if (drop === 0) {
        drop = root;
      }

      /* increment past last table */
      next += min;            /* here min is 1 << curr */

      /* determine length of next table */
      curr = len - drop;
      left = 1 << curr;
      while (curr + drop < max) {
        left -= count[curr + drop];
        if (left <= 0) { break; }
        curr++;
        left <<= 1;
      }

      /* check for enough space */
      used += 1 << curr;
      if ((type === LENS && used > ENOUGH_LENS) ||
        (type === DISTS && used > ENOUGH_DISTS)) {
        return 1;
      }

      /* point entry in root table to sub-table */
      low = huff & mask;
      /*table.op[low] = curr;
      table.bits[low] = root;
      table.val[low] = next - opts.table_index;*/
      table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
    }
  }

  /* fill in remaining table entry if code is incomplete (guaranteed to have
   at most one remaining entry, since if the code is incomplete, the
   maximum code length that was allowed to get this far is one bit) */
  if (huff !== 0) {
    //table.op[next + huff] = 64;            /* invalid code marker */
    //table.bits[next + huff] = len - drop;
    //table.val[next + huff] = 0;
    table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
  }

  /* set return parameters */
  //opts.table_index += used;
  opts.bits = root;
  return 0;
};

},{"../utils/common":62}],72:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

module.exports = {
  2:      'need dictionary',     /* Z_NEED_DICT       2  */
  1:      'stream end',          /* Z_STREAM_END      1  */
  0:      '',                    /* Z_OK              0  */
  '-1':   'file error',          /* Z_ERRNO         (-1) */
  '-2':   'stream error',        /* Z_STREAM_ERROR  (-2) */
  '-3':   'data error',          /* Z_DATA_ERROR    (-3) */
  '-4':   'insufficient memory', /* Z_MEM_ERROR     (-4) */
  '-5':   'buffer error',        /* Z_BUF_ERROR     (-5) */
  '-6':   'incompatible version' /* Z_VERSION_ERROR (-6) */
};

},{}],73:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils = require('../utils/common');

/* Public constants ==========================================================*/
/* ===========================================================================*/


//var Z_FILTERED          = 1;
//var Z_HUFFMAN_ONLY      = 2;
//var Z_RLE               = 3;
var Z_FIXED               = 4;
//var Z_DEFAULT_STRATEGY  = 0;

/* Possible values of the data_type field (though see inflate()) */
var Z_BINARY              = 0;
var Z_TEXT                = 1;
//var Z_ASCII             = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;

/*============================================================================*/


function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }

// From zutil.h

var STORED_BLOCK = 0;
var STATIC_TREES = 1;
var DYN_TREES    = 2;
/* The three kinds of block type */

var MIN_MATCH    = 3;
var MAX_MATCH    = 258;
/* The minimum and maximum match lengths */

// From deflate.h
/* ===========================================================================
 * Internal compression state.
 */

var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */

var LITERALS      = 256;
/* number of literal bytes 0..255 */

var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */

var D_CODES       = 30;
/* number of distance codes */

var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */

var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */

var MAX_BITS      = 15;
/* All codes must not exceed MAX_BITS bits */

var Buf_size      = 16;
/* size of bit buffer in bi_buf */


/* ===========================================================================
 * Constants
 */

var MAX_BL_BITS = 7;
/* Bit length codes must not exceed MAX_BL_BITS bits */

var END_BLOCK   = 256;
/* end of block literal code */

var REP_3_6     = 16;
/* repeat previous bit length 3-6 times (2 bits of repeat count) */

var REPZ_3_10   = 17;
/* repeat a zero length 3-10 times  (3 bits of repeat count) */

var REPZ_11_138 = 18;
/* repeat a zero length 11-138 times  (7 bits of repeat count) */

/* eslint-disable comma-spacing,array-bracket-spacing */
var extra_lbits =   /* extra bits for each length code */
  [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];

var extra_dbits =   /* extra bits for each distance code */
  [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];

var extra_blbits =  /* extra bits for each bit length code */
  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];

var bl_order =
  [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
/* eslint-enable comma-spacing,array-bracket-spacing */

/* The lengths of the bit length codes are sent in order of decreasing
 * probability, to avoid transmitting the lengths for unused bit length codes.
 */

/* ===========================================================================
 * Local data. These are initialized only once.
 */

// We pre-fill arrays with 0 to avoid uninitialized gaps

var DIST_CODE_LEN = 512; /* see definition of array dist_code below */

// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
var static_ltree  = new Array((L_CODES + 2) * 2);
zero(static_ltree);
/* The static literal tree. Since the bit lengths are imposed, there is no
 * need for the L_CODES extra codes used during heap construction. However
 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
 * below).
 */

var static_dtree  = new Array(D_CODES * 2);
zero(static_dtree);
/* The static distance tree. (Actually a trivial tree since all codes use
 * 5 bits.)
 */

var _dist_code    = new Array(DIST_CODE_LEN);
zero(_dist_code);
/* Distance codes. The first 256 values correspond to the distances
 * 3 .. 258, the last 256 values correspond to the top 8 bits of
 * the 15 bit distances.
 */

var _length_code  = new Array(MAX_MATCH - MIN_MATCH + 1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */

var base_length   = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */

var base_dist     = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */


function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {

  this.static_tree  = static_tree;  /* static tree or NULL */
  this.extra_bits   = extra_bits;   /* extra bits for each code or NULL */
  this.extra_base   = extra_base;   /* base index for extra_bits */
  this.elems        = elems;        /* max number of elements in the tree */
  this.max_length   = max_length;   /* max bit length for the codes */

  // show if `static_tree` has data or dummy - needed for monomorphic objects
  this.has_stree    = static_tree && static_tree.length;
}


var static_l_desc;
var static_d_desc;
var static_bl_desc;


function TreeDesc(dyn_tree, stat_desc) {
  this.dyn_tree = dyn_tree;     /* the dynamic tree */
  this.max_code = 0;            /* largest code with non zero frequency */
  this.stat_desc = stat_desc;   /* the corresponding static tree */
}



function d_code(dist) {
  return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
}


/* ===========================================================================
 * Output a short LSB first on the stream.
 * IN assertion: there is enough room in pendingBuf.
 */
function put_short(s, w) {
//    put_byte(s, (uch)((w) & 0xff));
//    put_byte(s, (uch)((ush)(w) >> 8));
  s.pending_buf[s.pending++] = (w) & 0xff;
  s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
}


/* ===========================================================================
 * Send a value on a given number of bits.
 * IN assertion: length <= 16 and value fits in length bits.
 */
function send_bits(s, value, length) {
  if (s.bi_valid > (Buf_size - length)) {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    put_short(s, s.bi_buf);
    s.bi_buf = value >> (Buf_size - s.bi_valid);
    s.bi_valid += length - Buf_size;
  } else {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    s.bi_valid += length;
  }
}


function send_code(s, c, tree) {
  send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
}


/* ===========================================================================
 * Reverse the first len bits of a code, using straightforward code (a faster
 * method would use a table)
 * IN assertion: 1 <= len <= 15
 */
function bi_reverse(code, len) {
  var res = 0;
  do {
    res |= code & 1;
    code >>>= 1;
    res <<= 1;
  } while (--len > 0);
  return res >>> 1;
}


/* ===========================================================================
 * Flush the bit buffer, keeping at most 7 bits in it.
 */
function bi_flush(s) {
  if (s.bi_valid === 16) {
    put_short(s, s.bi_buf);
    s.bi_buf = 0;
    s.bi_valid = 0;

  } else if (s.bi_valid >= 8) {
    s.pending_buf[s.pending++] = s.bi_buf & 0xff;
    s.bi_buf >>= 8;
    s.bi_valid -= 8;
  }
}


/* ===========================================================================
 * Compute the optimal bit lengths for a tree and update the total bit length
 * for the current block.
 * IN assertion: the fields freq and dad are set, heap[heap_max] and
 *    above are the tree nodes sorted by increasing frequency.
 * OUT assertions: the field len is set to the optimal bit length, the
 *     array bl_count contains the frequencies for each bit length.
 *     The length opt_len is updated; static_len is also updated if stree is
 *     not null.
 */
function gen_bitlen(s, desc)
//    deflate_state *s;
//    tree_desc *desc;    /* the tree descriptor */
{
  var tree            = desc.dyn_tree;
  var max_code        = desc.max_code;
  var stree           = desc.stat_desc.static_tree;
  var has_stree       = desc.stat_desc.has_stree;
  var extra           = desc.stat_desc.extra_bits;
  var base            = desc.stat_desc.extra_base;
  var max_length      = desc.stat_desc.max_length;
  var h;              /* heap index */
  var n, m;           /* iterate over the tree elements */
  var bits;           /* bit length */
  var xbits;          /* extra bits */
  var f;              /* frequency */
  var overflow = 0;   /* number of elements with bit length too large */

  for (bits = 0; bits <= MAX_BITS; bits++) {
    s.bl_count[bits] = 0;
  }

  /* In a first pass, compute the optimal bit lengths (which may
   * overflow in the case of the bit length tree).
   */
  tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */

  for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
    n = s.heap[h];
    bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
    if (bits > max_length) {
      bits = max_length;
      overflow++;
    }
    tree[n * 2 + 1]/*.Len*/ = bits;
    /* We overwrite tree[n].Dad which is no longer needed */

    if (n > max_code) { continue; } /* not a leaf node */

    s.bl_count[bits]++;
    xbits = 0;
    if (n >= base) {
      xbits = extra[n - base];
    }
    f = tree[n * 2]/*.Freq*/;
    s.opt_len += f * (bits + xbits);
    if (has_stree) {
      s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
    }
  }
  if (overflow === 0) { return; }

  // Trace((stderr,"\nbit length overflow\n"));
  /* This happens for example on obj2 and pic of the Calgary corpus */

  /* Find the first bit length which could increase: */
  do {
    bits = max_length - 1;
    while (s.bl_count[bits] === 0) { bits--; }
    s.bl_count[bits]--;      /* move one leaf down the tree */
    s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
    s.bl_count[max_length]--;
    /* The brother of the overflow item also moves one step up,
     * but this does not affect bl_count[max_length]
     */
    overflow -= 2;
  } while (overflow > 0);

  /* Now recompute all bit lengths, scanning in increasing frequency.
   * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
   * lengths instead of fixing only the wrong ones. This idea is taken
   * from 'ar' written by Haruhiko Okumura.)
   */
  for (bits = max_length; bits !== 0; bits--) {
    n = s.bl_count[bits];
    while (n !== 0) {
      m = s.heap[--h];
      if (m > max_code) { continue; }
      if (tree[m * 2 + 1]/*.Len*/ !== bits) {
        // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
        s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
        tree[m * 2 + 1]/*.Len*/ = bits;
      }
      n--;
    }
  }
}


/* ===========================================================================
 * Generate the codes for a given tree and bit counts (which need not be
 * optimal).
 * IN assertion: the array bl_count contains the bit length statistics for
 * the given tree and the field len is set for all tree elements.
 * OUT assertion: the field code is set for all tree elements of non
 *     zero code length.
 */
function gen_codes(tree, max_code, bl_count)
//    ct_data *tree;             /* the tree to decorate */
//    int max_code;              /* largest code with non zero frequency */
//    ushf *bl_count;            /* number of codes at each bit length */
{
  var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
  var code = 0;              /* running code value */
  var bits;                  /* bit index */
  var n;                     /* code index */

  /* The distribution counts are first used to generate the code values
   * without bit reversal.
   */
  for (bits = 1; bits <= MAX_BITS; bits++) {
    next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
  }
  /* Check that the bit counts in bl_count are consistent. The last code
   * must be all ones.
   */
  //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
  //        "inconsistent bit counts");
  //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));

  for (n = 0;  n <= max_code; n++) {
    var len = tree[n * 2 + 1]/*.Len*/;
    if (len === 0) { continue; }
    /* Now reverse the bits */
    tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);

    //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
    //     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
  }
}


/* ===========================================================================
 * Initialize the various 'constant' tables.
 */
function tr_static_init() {
  var n;        /* iterates over tree elements */
  var bits;     /* bit counter */
  var length;   /* length value */
  var code;     /* code value */
  var dist;     /* distance index */
  var bl_count = new Array(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  // do check in _tr_init()
  //if (static_init_done) return;

  /* For some embedded targets, global variables are not initialized: */
/*#ifdef NO_INIT_GLOBAL_POINTERS
  static_l_desc.static_tree = static_ltree;
  static_l_desc.extra_bits = extra_lbits;
  static_d_desc.static_tree = static_dtree;
  static_d_desc.extra_bits = extra_dbits;
  static_bl_desc.extra_bits = extra_blbits;
#endif*/

  /* Initialize the mapping length (0..255) -> length code (0..28) */
  length = 0;
  for (code = 0; code < LENGTH_CODES - 1; code++) {
    base_length[code] = length;
    for (n = 0; n < (1 << extra_lbits[code]); n++) {
      _length_code[length++] = code;
    }
  }
  //Assert (length == 256, "tr_static_init: length != 256");
  /* Note that the length 255 (match length 258) can be represented
   * in two different ways: code 284 + 5 bits or code 285, so we
   * overwrite length_code[255] to use the best encoding:
   */
  _length_code[length - 1] = code;

  /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  dist = 0;
  for (code = 0; code < 16; code++) {
    base_dist[code] = dist;
    for (n = 0; n < (1 << extra_dbits[code]); n++) {
      _dist_code[dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: dist != 256");
  dist >>= 7; /* from now on, all distances are divided by 128 */
  for (; code < D_CODES; code++) {
    base_dist[code] = dist << 7;
    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
      _dist_code[256 + dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: 256+dist != 512");

  /* Construct the codes of the static literal tree */
  for (bits = 0; bits <= MAX_BITS; bits++) {
    bl_count[bits] = 0;
  }

  n = 0;
  while (n <= 143) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  while (n <= 255) {
    static_ltree[n * 2 + 1]/*.Len*/ = 9;
    n++;
    bl_count[9]++;
  }
  while (n <= 279) {
    static_ltree[n * 2 + 1]/*.Len*/ = 7;
    n++;
    bl_count[7]++;
  }
  while (n <= 287) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  /* Codes 286 and 287 do not exist, but we must include them in the
   * tree construction to get a canonical Huffman tree (longest code
   * all ones)
   */
  gen_codes(static_ltree, L_CODES + 1, bl_count);

  /* The static distance tree is trivial: */
  for (n = 0; n < D_CODES; n++) {
    static_dtree[n * 2 + 1]/*.Len*/ = 5;
    static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
  }

  // Now data ready and we can init static trees
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS);
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0,         BL_CODES, MAX_BL_BITS);

  //static_init_done = true;
}


/* ===========================================================================
 * Initialize a new block.
 */
function init_block(s) {
  var n; /* iterates over tree elements */

  /* Initialize the trees. */
  for (n = 0; n < L_CODES;  n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < D_CODES;  n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }

  s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
  s.opt_len = s.static_len = 0;
  s.last_lit = s.matches = 0;
}


/* ===========================================================================
 * Flush the bit buffer and align the output on a byte boundary
 */
function bi_windup(s)
{
  if (s.bi_valid > 8) {
    put_short(s, s.bi_buf);
  } else if (s.bi_valid > 0) {
    //put_byte(s, (Byte)s->bi_buf);
    s.pending_buf[s.pending++] = s.bi_buf;
  }
  s.bi_buf = 0;
  s.bi_valid = 0;
}

/* ===========================================================================
 * Copy a stored block, storing first the length and its
 * one's complement if requested.
 */
function copy_block(s, buf, len, header)
//DeflateState *s;
//charf    *buf;    /* the input data */
//unsigned len;     /* its length */
//int      header;  /* true if block header must be written */
{
  bi_windup(s);        /* align on byte boundary */

  if (header) {
    put_short(s, len);
    put_short(s, ~len);
  }
//  while (len--) {
//    put_byte(s, *buf++);
//  }
  utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  s.pending += len;
}

/* ===========================================================================
 * Compares to subtrees, using the tree depth as tie breaker when
 * the subtrees have equal frequency. This minimizes the worst case length.
 */
function smaller(tree, n, m, depth) {
  var _n2 = n * 2;
  var _m2 = m * 2;
  return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
         (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
}

/* ===========================================================================
 * Restore the heap property by moving down the tree starting at node k,
 * exchanging a node with the smallest of its two sons if necessary, stopping
 * when the heap property is re-established (each father smaller than its
 * two sons).
 */
function pqdownheap(s, tree, k)
//    deflate_state *s;
//    ct_data *tree;  /* the tree to restore */
//    int k;               /* node to move down */
{
  var v = s.heap[k];
  var j = k << 1;  /* left son of k */
  while (j <= s.heap_len) {
    /* Set j to the smallest of the two sons: */
    if (j < s.heap_len &&
      smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
      j++;
    }
    /* Exit if v is smaller than both sons */
    if (smaller(tree, v, s.heap[j], s.depth)) { break; }

    /* Exchange v with the smallest son */
    s.heap[k] = s.heap[j];
    k = j;

    /* And continue down the tree, setting j to the left son of k */
    j <<= 1;
  }
  s.heap[k] = v;
}


// inlined manually
// var SMALLEST = 1;

/* ===========================================================================
 * Send the block data compressed using the given Huffman trees
 */
function compress_block(s, ltree, dtree)
//    deflate_state *s;
//    const ct_data *ltree; /* literal tree */
//    const ct_data *dtree; /* distance tree */
{
  var dist;           /* distance of matched string */
  var lc;             /* match length or unmatched char (if dist == 0) */
  var lx = 0;         /* running index in l_buf */
  var code;           /* the code to send */
  var extra;          /* number of extra bits to send */

  if (s.last_lit !== 0) {
    do {
      dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
      lc = s.pending_buf[s.l_buf + lx];
      lx++;

      if (dist === 0) {
        send_code(s, lc, ltree); /* send a literal byte */
        //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
      } else {
        /* Here, lc is the match length - MIN_MATCH */
        code = _length_code[lc];
        send_code(s, code + LITERALS + 1, ltree); /* send the length code */
        extra = extra_lbits[code];
        if (extra !== 0) {
          lc -= base_length[code];
          send_bits(s, lc, extra);       /* send the extra length bits */
        }
        dist--; /* dist is now the match distance - 1 */
        code = d_code(dist);
        //Assert (code < D_CODES, "bad d_code");

        send_code(s, code, dtree);       /* send the distance code */
        extra = extra_dbits[code];
        if (extra !== 0) {
          dist -= base_dist[code];
          send_bits(s, dist, extra);   /* send the extra distance bits */
        }
      } /* literal or match pair ? */

      /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
      //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
      //       "pendingBuf overflow");

    } while (lx < s.last_lit);
  }

  send_code(s, END_BLOCK, ltree);
}


/* ===========================================================================
 * Construct one Huffman tree and assigns the code bit strings and lengths.
 * Update the total bit length for the current block.
 * IN assertion: the field freq is set for all tree elements.
 * OUT assertions: the fields len and code are set to the optimal bit length
 *     and corresponding code. The length opt_len is updated; static_len is
 *     also updated if stree is not null. The field max_code is set.
 */
function build_tree(s, desc)
//    deflate_state *s;
//    tree_desc *desc; /* the tree descriptor */
{
  var tree     = desc.dyn_tree;
  var stree    = desc.stat_desc.static_tree;
  var has_stree = desc.stat_desc.has_stree;
  var elems    = desc.stat_desc.elems;
  var n, m;          /* iterate over heap elements */
  var max_code = -1; /* largest code with non zero frequency */
  var node;          /* new node being created */

  /* Construct the initial heap, with least frequent element in
   * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
   * heap[0] is not used.
   */
  s.heap_len = 0;
  s.heap_max = HEAP_SIZE;

  for (n = 0; n < elems; n++) {
    if (tree[n * 2]/*.Freq*/ !== 0) {
      s.heap[++s.heap_len] = max_code = n;
      s.depth[n] = 0;

    } else {
      tree[n * 2 + 1]/*.Len*/ = 0;
    }
  }

  /* The pkzip format requires that at least one distance code exists,
   * and that at least one bit should be sent even if there is only one
   * possible code. So to avoid special checks later on we force at least
   * two codes of non zero frequency.
   */
  while (s.heap_len < 2) {
    node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
    tree[node * 2]/*.Freq*/ = 1;
    s.depth[node] = 0;
    s.opt_len--;

    if (has_stree) {
      s.static_len -= stree[node * 2 + 1]/*.Len*/;
    }
    /* node is 0 or 1 so it does not have extra bits */
  }
  desc.max_code = max_code;

  /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
   * establish sub-heaps of increasing lengths:
   */
  for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }

  /* Construct the Huffman tree by repeatedly combining the least two
   * frequent nodes.
   */
  node = elems;              /* next internal node of the tree */
  do {
    //pqremove(s, tree, n);  /* n = node of least frequency */
    /*** pqremove ***/
    n = s.heap[1/*SMALLEST*/];
    s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
    pqdownheap(s, tree, 1/*SMALLEST*/);
    /***/

    m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */

    s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
    s.heap[--s.heap_max] = m;

    /* Create a new node father of n and m */
    tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
    s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
    tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;

    /* and insert the new node in the heap */
    s.heap[1/*SMALLEST*/] = node++;
    pqdownheap(s, tree, 1/*SMALLEST*/);

  } while (s.heap_len >= 2);

  s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];

  /* At this point, the fields freq and dad are set. We can now
   * generate the bit lengths.
   */
  gen_bitlen(s, desc);

  /* The field len is now set, we can generate the bit codes */
  gen_codes(tree, max_code, s.bl_count);
}


/* ===========================================================================
 * Scan a literal or distance tree to determine the frequencies of the codes
 * in the bit length tree.
 */
function scan_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree;   /* the tree to be scanned */
//    int max_code;    /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }
  tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      s.bl_tree[curlen * 2]/*.Freq*/ += count;

    } else if (curlen !== 0) {

      if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
      s.bl_tree[REP_3_6 * 2]/*.Freq*/++;

    } else if (count <= 10) {
      s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;

    } else {
      s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
    }

    count = 0;
    prevlen = curlen;

    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Send a literal or distance tree in compressed form, using the codes in
 * bl_tree.
 */
function send_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree; /* the tree to be scanned */
//    int max_code;       /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  /* tree[max_code+1].Len = -1; */  /* guard already set */
  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);

    } else if (curlen !== 0) {
      if (curlen !== prevlen) {
        send_code(s, curlen, s.bl_tree);
        count--;
      }
      //Assert(count >= 3 && count <= 6, " 3_6?");
      send_code(s, REP_3_6, s.bl_tree);
      send_bits(s, count - 3, 2);

    } else if (count <= 10) {
      send_code(s, REPZ_3_10, s.bl_tree);
      send_bits(s, count - 3, 3);

    } else {
      send_code(s, REPZ_11_138, s.bl_tree);
      send_bits(s, count - 11, 7);
    }

    count = 0;
    prevlen = curlen;
    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Construct the Huffman tree for the bit lengths and return the index in
 * bl_order of the last bit length code to send.
 */
function build_bl_tree(s) {
  var max_blindex;  /* index of last bit length code of non zero freq */

  /* Determine the bit length frequencies for literal and distance trees */
  scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  scan_tree(s, s.dyn_dtree, s.d_desc.max_code);

  /* Build the bit length tree: */
  build_tree(s, s.bl_desc);
  /* opt_len now includes the length of the tree representations, except
   * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
   */

  /* Determine the number of bit length codes to send. The pkzip format
   * requires that at least 4 bit length codes be sent. (appnote.txt says
   * 3 but the actual value used is 4.)
   */
  for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
    if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
      break;
    }
  }
  /* Update opt_len to include the bit length tree and counts */
  s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
  //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  //        s->opt_len, s->static_len));

  return max_blindex;
}


/* ===========================================================================
 * Send the header for a block using dynamic Huffman trees: the counts, the
 * lengths of the bit length codes, the literal tree and the distance tree.
 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
 */
function send_all_trees(s, lcodes, dcodes, blcodes)
//    deflate_state *s;
//    int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
  var rank;                    /* index in bl_order */

  //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  //        "too many codes");
  //Tracev((stderr, "\nbl counts: "));
  send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
  send_bits(s, dcodes - 1,   5);
  send_bits(s, blcodes - 4,  4); /* not -3 as stated in appnote.txt */
  for (rank = 0; rank < blcodes; rank++) {
    //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
    send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
  }
  //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
  //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
  //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}


/* ===========================================================================
 * Check if the data type is TEXT or BINARY, using the following algorithm:
 * - TEXT if the two conditions below are satisfied:
 *    a) There are no non-portable control characters belonging to the
 *       "black list" (0..6, 14..25, 28..31).
 *    b) There is at least one printable character belonging to the
 *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
 * - BINARY otherwise.
 * - The following partially-portable control characters form a
 *   "gray list" that is ignored in this detection algorithm:
 *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
 * IN assertion: the fields Freq of dyn_ltree are set.
 */
function detect_data_type(s) {
  /* black_mask is the bit mask of black-listed bytes
   * set bits 0..6, 14..25, and 28..31
   * 0xf3ffc07f = binary 11110011111111111100000001111111
   */
  var black_mask = 0xf3ffc07f;
  var n;

  /* Check for non-textual ("black-listed") bytes. */
  for (n = 0; n <= 31; n++, black_mask >>>= 1) {
    if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
      return Z_BINARY;
    }
  }

  /* Check for textual ("white-listed") bytes. */
  if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
      s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
    return Z_TEXT;
  }
  for (n = 32; n < LITERALS; n++) {
    if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
      return Z_TEXT;
    }
  }

  /* There are no "black-listed" or "white-listed" bytes:
   * this stream either is empty or has tolerated ("gray-listed") bytes only.
   */
  return Z_BINARY;
}


var static_init_done = false;

/* ===========================================================================
 * Initialize the tree data structures for a new zlib stream.
 */
function _tr_init(s)
{

  if (!static_init_done) {
    tr_static_init();
    static_init_done = true;
  }

  s.l_desc  = new TreeDesc(s.dyn_ltree, static_l_desc);
  s.d_desc  = new TreeDesc(s.dyn_dtree, static_d_desc);
  s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);

  s.bi_buf = 0;
  s.bi_valid = 0;

  /* Initialize the first block of the first file: */
  init_block(s);
}


/* ===========================================================================
 * Send a stored block
 */
function _tr_stored_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */
  copy_block(s, buf, stored_len, true); /* with header */
}


/* ===========================================================================
 * Send one empty static block to give enough lookahead for inflate.
 * This takes 10 bits, of which 7 may remain in the bit buffer.
 */
function _tr_align(s) {
  send_bits(s, STATIC_TREES << 1, 3);
  send_code(s, END_BLOCK, static_ltree);
  bi_flush(s);
}


/* ===========================================================================
 * Determine the best encoding for the current block: dynamic trees, static
 * trees or store, and output the encoded block to the zip file.
 */
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block, or NULL if too old */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  var opt_lenb, static_lenb;  /* opt_len and static_len in bytes */
  var max_blindex = 0;        /* index of last bit length code of non zero freq */

  /* Build the Huffman trees unless a stored block is forced */
  if (s.level > 0) {

    /* Check if the file is binary or text */
    if (s.strm.data_type === Z_UNKNOWN) {
      s.strm.data_type = detect_data_type(s);
    }

    /* Construct the literal and distance trees */
    build_tree(s, s.l_desc);
    // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));

    build_tree(s, s.d_desc);
    // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));
    /* At this point, opt_len and static_len are the total bit lengths of
     * the compressed block data, excluding the tree representations.
     */

    /* Build the bit length tree for the above two trees, and get the index
     * in bl_order of the last bit length code to send.
     */
    max_blindex = build_bl_tree(s);

    /* Determine the best encoding. Compute the block lengths in bytes. */
    opt_lenb = (s.opt_len + 3 + 7) >>> 3;
    static_lenb = (s.static_len + 3 + 7) >>> 3;

    // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
    //        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
    //        s->last_lit));

    if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }

  } else {
    // Assert(buf != (char*)0, "lost buf");
    opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
  }

  if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
    /* 4: two words for the lengths */

    /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
     * Otherwise we can't have processed more than WSIZE input bytes since
     * the last block flush, because compression would have been
     * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
     * transform a block into a stored block.
     */
    _tr_stored_block(s, buf, stored_len, last);

  } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {

    send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
    compress_block(s, static_ltree, static_dtree);

  } else {
    send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
    send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
    compress_block(s, s.dyn_ltree, s.dyn_dtree);
  }
  // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
  /* The above check is made mod 2^32, for files larger than 512 MB
   * and uLong implemented on 32 bits.
   */
  init_block(s);

  if (last) {
    bi_windup(s);
  }
  // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
  //       s->compressed_len-7*last));
}

/* ===========================================================================
 * Save the match info and tally the frequency counts. Return true if
 * the current block must be flushed.
 */
function _tr_tally(s, dist, lc)
//    deflate_state *s;
//    unsigned dist;  /* distance of matched string */
//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
  //var out_length, in_length, dcode;

  s.pending_buf[s.d_buf + s.last_lit * 2]     = (dist >>> 8) & 0xff;
  s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;

  s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
  s.last_lit++;

  if (dist === 0) {
    /* lc is the unmatched char */
    s.dyn_ltree[lc * 2]/*.Freq*/++;
  } else {
    s.matches++;
    /* Here, lc is the match length - MIN_MATCH */
    dist--;             /* dist = match distance - 1 */
    //Assert((ush)dist < (ush)MAX_DIST(s) &&
    //       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
    //       (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");

    s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
    s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
  }

// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility

//#ifdef TRUNCATE_BLOCK
//  /* Try to guess if it is profitable to stop the current block here */
//  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
//    /* Compute an upper bound for the compressed length */
//    out_length = s.last_lit*8;
//    in_length = s.strstart - s.block_start;
//
//    for (dcode = 0; dcode < D_CODES; dcode++) {
//      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
//    }
//    out_length >>>= 3;
//    //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
//    //       s->last_lit, in_length, out_length,
//    //       100L - out_length*100L/in_length));
//    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
//      return true;
//    }
//  }
//#endif

  return (s.last_lit === s.lit_bufsize - 1);
  /* We avoid equality with lit_bufsize because of wraparound at 64K
   * on 16 bit machines and because stored blocks are restricted to
   * 64K-1 bytes.
   */
}

exports._tr_init  = _tr_init;
exports._tr_stored_block = _tr_stored_block;
exports._tr_flush_block  = _tr_flush_block;
exports._tr_tally = _tr_tally;
exports._tr_align = _tr_align;

},{"../utils/common":62}],74:[function(require,module,exports){
'use strict';

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function ZStream() {
  /* next input byte */
  this.input = null; // JS specific, because we have no pointers
  this.next_in = 0;
  /* number of bytes available at input */
  this.avail_in = 0;
  /* total number of input bytes read so far */
  this.total_in = 0;
  /* next output byte should be put there */
  this.output = null; // JS specific, because we have no pointers
  this.next_out = 0;
  /* remaining free space at output */
  this.avail_out = 0;
  /* total number of bytes output so far */
  this.total_out = 0;
  /* last error message, NULL if no error */
  this.msg = ''/*Z_NULL*/;
  /* not visible by applications */
  this.state = null;
  /* best guess about the data type: binary or text */
  this.data_type = 2/*Z_UNKNOWN*/;
  /* adler32 value of the uncompressed data */
  this.adler = 0;
}

module.exports = ZStream;

},{}]},{},[10])(10)
});
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(792).Buffer, __webpack_require__(152)))

/***/ }),
/* 806 */
/***/ (function(module, exports, __webpack_require__) {

var require;var require;/* pako 0.2.9 nodeca/pako */(function(f){if(true){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return require(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';


var TYPED_OK =  (typeof Uint8Array !== 'undefined') &&
                (typeof Uint16Array !== 'undefined') &&
                (typeof Int32Array !== 'undefined');


exports.assign = function (obj /*from1, from2, from3, ...*/) {
  var sources = Array.prototype.slice.call(arguments, 1);
  while (sources.length) {
    var source = sources.shift();
    if (!source) { continue; }

    if (typeof source !== 'object') {
      throw new TypeError(source + 'must be non-object');
    }

    for (var p in source) {
      if (source.hasOwnProperty(p)) {
        obj[p] = source[p];
      }
    }
  }

  return obj;
};


// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
  if (buf.length === size) { return buf; }
  if (buf.subarray) { return buf.subarray(0, size); }
  buf.length = size;
  return buf;
};


var fnTyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    if (src.subarray && dest.subarray) {
      dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
      return;
    }
    // Fallback to ordinary array
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    var i, l, len, pos, chunk, result;

    // calculate data length
    len = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      len += chunks[i].length;
    }

    // join chunks
    result = new Uint8Array(len);
    pos = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      chunk = chunks[i];
      result.set(chunk, pos);
      pos += chunk.length;
    }

    return result;
  }
};

var fnUntyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    return [].concat.apply([], chunks);
  }
};


// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
  if (on) {
    exports.Buf8  = Uint8Array;
    exports.Buf16 = Uint16Array;
    exports.Buf32 = Int32Array;
    exports.assign(exports, fnTyped);
  } else {
    exports.Buf8  = Array;
    exports.Buf16 = Array;
    exports.Buf32 = Array;
    exports.assign(exports, fnUntyped);
  }
};

exports.setTyped(TYPED_OK);

},{}],2:[function(require,module,exports){
// String encode/decode helpers
'use strict';


var utils = require('./common');


// Quick check if we can use fast array to bin string conversion
//
// - apply(Array) can fail on Android 2.2
// - apply(Uint8Array) can fail on iOS 5.1 Safary
//
var STR_APPLY_OK = true;
var STR_APPLY_UIA_OK = true;

try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }


// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new utils.Buf8(256);
for (var q = 0; q < 256; q++) {
  _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
}
_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start


// convert string to array (typed, when possible)
exports.string2buf = function (str) {
  var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;

  // count binary size
  for (m_pos = 0; m_pos < str_len; m_pos++) {
    c = str.charCodeAt(m_pos);
    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
      c2 = str.charCodeAt(m_pos + 1);
      if ((c2 & 0xfc00) === 0xdc00) {
        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
        m_pos++;
      }
    }
    buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
  }

  // allocate buffer
  buf = new utils.Buf8(buf_len);

  // convert
  for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
    c = str.charCodeAt(m_pos);
    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
      c2 = str.charCodeAt(m_pos + 1);
      if ((c2 & 0xfc00) === 0xdc00) {
        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
        m_pos++;
      }
    }
    if (c < 0x80) {
      /* one byte */
      buf[i++] = c;
    } else if (c < 0x800) {
      /* two bytes */
      buf[i++] = 0xC0 | (c >>> 6);
      buf[i++] = 0x80 | (c & 0x3f);
    } else if (c < 0x10000) {
      /* three bytes */
      buf[i++] = 0xE0 | (c >>> 12);
      buf[i++] = 0x80 | (c >>> 6 & 0x3f);
      buf[i++] = 0x80 | (c & 0x3f);
    } else {
      /* four bytes */
      buf[i++] = 0xf0 | (c >>> 18);
      buf[i++] = 0x80 | (c >>> 12 & 0x3f);
      buf[i++] = 0x80 | (c >>> 6 & 0x3f);
      buf[i++] = 0x80 | (c & 0x3f);
    }
  }

  return buf;
};

// Helper (used in 2 places)
function buf2binstring(buf, len) {
  // use fallback for big arrays to avoid stack overflow
  if (len < 65537) {
    if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
      return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
    }
  }

  var result = '';
  for (var i = 0; i < len; i++) {
    result += String.fromCharCode(buf[i]);
  }
  return result;
}


// Convert byte array to binary string
exports.buf2binstring = function (buf) {
  return buf2binstring(buf, buf.length);
};


// Convert binary string (typed, when possible)
exports.binstring2buf = function (str) {
  var buf = new utils.Buf8(str.length);
  for (var i = 0, len = buf.length; i < len; i++) {
    buf[i] = str.charCodeAt(i);
  }
  return buf;
};


// convert array to string
exports.buf2string = function (buf, max) {
  var i, out, c, c_len;
  var len = max || buf.length;

  // Reserve max possible length (2 words per char)
  // NB: by unknown reasons, Array is significantly faster for
  //     String.fromCharCode.apply than Uint16Array.
  var utf16buf = new Array(len * 2);

  for (out = 0, i = 0; i < len;) {
    c = buf[i++];
    // quick process ascii
    if (c < 0x80) { utf16buf[out++] = c; continue; }

    c_len = _utf8len[c];
    // skip 5 & 6 byte codes
    if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }

    // apply mask on first byte
    c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
    // join the rest
    while (c_len > 1 && i < len) {
      c = (c << 6) | (buf[i++] & 0x3f);
      c_len--;
    }

    // terminated by end of string?
    if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }

    if (c < 0x10000) {
      utf16buf[out++] = c;
    } else {
      c -= 0x10000;
      utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
      utf16buf[out++] = 0xdc00 | (c & 0x3ff);
    }
  }

  return buf2binstring(utf16buf, out);
};


// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max   - length limit (mandatory);
exports.utf8border = function (buf, max) {
  var pos;

  max = max || buf.length;
  if (max > buf.length) { max = buf.length; }

  // go back from last position, until start of sequence found
  pos = max - 1;
  while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }

  // Fuckup - very small and broken sequence,
  // return max, because we should return something anyway.
  if (pos < 0) { return max; }

  // If we came to start of buffer - that means vuffer is too small,
  // return max too.
  if (pos === 0) { return max; }

  return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};

},{"./common":1}],3:[function(require,module,exports){
'use strict';

// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It doesn't worth to make additional optimizationa as in original.
// Small size is preferable.

function adler32(adler, buf, len, pos) {
  var s1 = (adler & 0xffff) |0,
      s2 = ((adler >>> 16) & 0xffff) |0,
      n = 0;

  while (len !== 0) {
    // Set limit ~ twice less than 5552, to keep
    // s2 in 31-bits, because we force signed ints.
    // in other case %= will fail.
    n = len > 2000 ? 2000 : len;
    len -= n;

    do {
      s1 = (s1 + buf[pos++]) |0;
      s2 = (s2 + s1) |0;
    } while (--n);

    s1 %= 65521;
    s2 %= 65521;
  }

  return (s1 | (s2 << 16)) |0;
}


module.exports = adler32;

},{}],4:[function(require,module,exports){
'use strict';

// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.


// Use ordinary array, since untyped makes no boost here
function makeTable() {
  var c, table = [];

  for (var n = 0; n < 256; n++) {
    c = n;
    for (var k = 0; k < 8; k++) {
      c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
    }
    table[n] = c;
  }

  return table;
}

// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();


function crc32(crc, buf, len, pos) {
  var t = crcTable,
      end = pos + len;

  crc ^= -1;

  for (var i = pos; i < end; i++) {
    crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  }

  return (crc ^ (-1)); // >>> 0;
}


module.exports = crc32;

},{}],5:[function(require,module,exports){
'use strict';

var utils   = require('../utils/common');
var trees   = require('./trees');
var adler32 = require('./adler32');
var crc32   = require('./crc32');
var msg     = require('./messages');

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH      = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
//var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
//var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
//var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;


/* compression levels */
//var Z_NO_COMPRESSION      = 0;
//var Z_BEST_SPEED          = 1;
//var Z_BEST_COMPRESSION    = 9;
var Z_DEFAULT_COMPRESSION = -1;


var Z_FILTERED            = 1;
var Z_HUFFMAN_ONLY        = 2;
var Z_RLE                 = 3;
var Z_FIXED               = 4;
var Z_DEFAULT_STRATEGY    = 0;

/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY              = 0;
//var Z_TEXT                = 1;
//var Z_ASCII               = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;


/* The deflate compression method */
var Z_DEFLATED  = 8;

/*============================================================================*/


var MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_MEM_LEVEL = 8;


var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS      = 256;
/* number of literal bytes 0..255 */
var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES       = 30;
/* number of distance codes */
var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */
var MAX_BITS  = 15;
/* All codes must not exceed MAX_BITS bits */

var MIN_MATCH = 3;
var MAX_MATCH = 258;
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);

var PRESET_DICT = 0x20;

var INIT_STATE = 42;
var EXTRA_STATE = 69;
var NAME_STATE = 73;
var COMMENT_STATE = 91;
var HCRC_STATE = 103;
var BUSY_STATE = 113;
var FINISH_STATE = 666;

var BS_NEED_MORE      = 1; /* block not completed, need more input or more output */
var BS_BLOCK_DONE     = 2; /* block flush performed */
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
var BS_FINISH_DONE    = 4; /* finish done, accept no more input or output */

var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.

function err(strm, errorCode) {
  strm.msg = msg[errorCode];
  return errorCode;
}

function rank(f) {
  return ((f) << 1) - ((f) > 4 ? 9 : 0);
}

function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }


/* =========================================================================
 * Flush as much pending output as possible. All deflate() output goes
 * through this function so some applications may wish to modify it
 * to avoid allocating a large strm->output buffer and copying into it.
 * (See also read_buf()).
 */
function flush_pending(strm) {
  var s = strm.state;

  //_tr_flush_bits(s);
  var len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) { return; }

  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}


function flush_block_only(s, last) {
  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  s.block_start = s.strstart;
  flush_pending(s.strm);
}


function put_byte(s, b) {
  s.pending_buf[s.pending++] = b;
}


/* =========================================================================
 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
 * IN assertion: the stream state is correct and there is enough room in
 * pending_buf.
 */
function putShortMSB(s, b) {
//  put_byte(s, (Byte)(b >> 8));
//  put_byte(s, (Byte)(b & 0xff));
  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  s.pending_buf[s.pending++] = b & 0xff;
}


/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->input buffer and copying from it.
 * (See also flush_pending()).
 */
function read_buf(strm, buf, start, size) {
  var len = strm.avail_in;

  if (len > size) { len = size; }
  if (len === 0) { return 0; }

  strm.avail_in -= len;

  // zmemcpy(buf, strm->next_in, len);
  utils.arraySet(buf, strm.input, strm.next_in, len, start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  }

  else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }

  strm.next_in += len;
  strm.total_in += len;

  return len;
}


/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 * OUT assertion: the match length is not greater than s->lookahead.
 */
function longest_match(s, cur_match) {
  var chain_length = s.max_chain_length;      /* max hash chain length */
  var scan = s.strstart; /* current string */
  var match;                       /* matched string */
  var len;                           /* length of current match */
  var best_len = s.prev_length;              /* best match length so far */
  var nice_match = s.nice_match;             /* stop if match long enough */
  var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
      s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;

  var _win = s.window; // shortcut

  var wmask = s.w_mask;
  var prev  = s.prev;

  /* Stop when cur_match becomes <= limit. To simplify the code,
   * we prevent matches with the string of window index 0.
   */

  var strend = s.strstart + MAX_MATCH;
  var scan_end1  = _win[scan + best_len - 1];
  var scan_end   = _win[scan + best_len];

  /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
   * It is easy to get rid of this optimization if necessary.
   */
  // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

  /* Do not waste too much time if we already have a good match: */
  if (s.prev_length >= s.good_match) {
    chain_length >>= 2;
  }
  /* Do not look for matches beyond the end of the input. This is necessary
   * to make deflate deterministic.
   */
  if (nice_match > s.lookahead) { nice_match = s.lookahead; }

  // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");

  do {
    // Assert(cur_match < s->strstart, "no future");
    match = cur_match;

    /* Skip to next match if the match length cannot increase
     * or if the match length is less than 2.  Note that the checks below
     * for insufficient lookahead only occur occasionally for performance
     * reasons.  Therefore uninitialized memory will be accessed, and
     * conditional jumps will be made that depend on those values.
     * However the length of the match is limited to the lookahead, so
     * the output of deflate is not affected by the uninitialized values.
     */

    if (_win[match + best_len]     !== scan_end  ||
        _win[match + best_len - 1] !== scan_end1 ||
        _win[match]                !== _win[scan] ||
        _win[++match]              !== _win[scan + 1]) {
      continue;
    }

    /* The check at best_len-1 can be removed because it will be made
     * again later. (This heuristic is not always a win.)
     * It is not necessary to compare scan[2] and match[2] since they
     * are always equal when the other bytes match, given that
     * the hash keys are equal and that HASH_BITS >= 8.
     */
    scan += 2;
    match++;
    // Assert(*scan == *match, "match[2]?");

    /* We check for insufficient lookahead only every 8th comparison;
     * the 256th check will be made at strstart+258.
     */
    do {
      /*jshint noempty:false*/
    } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             scan < strend);

    // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");

    len = MAX_MATCH - (strend - scan);
    scan = strend - MAX_MATCH;

    if (len > best_len) {
      s.match_start = cur_match;
      best_len = len;
      if (len >= nice_match) {
        break;
      }
      scan_end1  = _win[scan + best_len - 1];
      scan_end   = _win[scan + best_len];
    }
  } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);

  if (best_len <= s.lookahead) {
    return best_len;
  }
  return s.lookahead;
}


/* ===========================================================================
 * Fill the window when the lookahead becomes insufficient.
 * Updates strstart and lookahead.
 *
 * IN assertion: lookahead < MIN_LOOKAHEAD
 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
 *    At least one byte has been read, or avail_in == 0; reads are
 *    performed for at least two bytes (required for the zip translate_eol
 *    option -- not supported here).
 */
function fill_window(s) {
  var _w_size = s.w_size;
  var p, n, m, more, str;

  //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");

  do {
    more = s.window_size - s.lookahead - s.strstart;

    // JS ints have 32 bit, block below not needed
    /* Deal with !@#$% 64K limit: */
    //if (sizeof(int) <= 2) {
    //    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
    //        more = wsize;
    //
    //  } else if (more == (unsigned)(-1)) {
    //        /* Very unlikely, but possible on 16 bit machine if
    //         * strstart == 0 && lookahead == 1 (input done a byte at time)
    //         */
    //        more--;
    //    }
    //}


    /* If the window is almost full and there is insufficient lookahead,
     * move the upper half to the lower one to make room in the upper half.
     */
    if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {

      utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
      s.match_start -= _w_size;
      s.strstart -= _w_size;
      /* we now have strstart >= MAX_DIST */
      s.block_start -= _w_size;

      /* Slide the hash table (could be avoided with 32 bit values
       at the expense of memory usage). We slide even when level == 0
       to keep the hash table consistent if we switch back to level > 0
       later. (Using level 0 permanently is not an optimal usage of
       zlib, so we don't care about this pathological case.)
       */

      n = s.hash_size;
      p = n;
      do {
        m = s.head[--p];
        s.head[p] = (m >= _w_size ? m - _w_size : 0);
      } while (--n);

      n = _w_size;
      p = n;
      do {
        m = s.prev[--p];
        s.prev[p] = (m >= _w_size ? m - _w_size : 0);
        /* If n is not on any hash chain, prev[n] is garbage but
         * its value will never be used.
         */
      } while (--n);

      more += _w_size;
    }
    if (s.strm.avail_in === 0) {
      break;
    }

    /* If there was no sliding:
     *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
     *    more == window_size - lookahead - strstart
     * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
     * => more >= window_size - 2*WSIZE + 2
     * In the BIG_MEM or MMAP case (not yet supported),
     *   window_size == input_size + MIN_LOOKAHEAD  &&
     *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
     * Otherwise, window_size == 2*WSIZE so more >= 2.
     * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
     */
    //Assert(more >= 2, "more < 2");
    n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
    s.lookahead += n;

    /* Initialize the hash value now that we have some input: */
    if (s.lookahead + s.insert >= MIN_MATCH) {
      str = s.strstart - s.insert;
      s.ins_h = s.window[str];

      /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
//        Call update_hash() MIN_MATCH-3 more times
//#endif
      while (s.insert) {
        /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

        s.prev[str & s.w_mask] = s.head[s.ins_h];
        s.head[s.ins_h] = str;
        str++;
        s.insert--;
        if (s.lookahead + s.insert < MIN_MATCH) {
          break;
        }
      }
    }
    /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
     * but this is not important since only literal bytes will be emitted.
     */

  } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);

  /* If the WIN_INIT bytes after the end of the current data have never been
   * written, then zero those bytes in order to avoid memory check reports of
   * the use of uninitialized (or uninitialised as Julian writes) bytes by
   * the longest match routines.  Update the high water mark for the next
   * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
   * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
   */
//  if (s.high_water < s.window_size) {
//    var curr = s.strstart + s.lookahead;
//    var init = 0;
//
//    if (s.high_water < curr) {
//      /* Previous high water mark below current data -- zero WIN_INIT
//       * bytes or up to end of window, whichever is less.
//       */
//      init = s.window_size - curr;
//      if (init > WIN_INIT)
//        init = WIN_INIT;
//      zmemzero(s->window + curr, (unsigned)init);
//      s->high_water = curr + init;
//    }
//    else if (s->high_water < (ulg)curr + WIN_INIT) {
//      /* High water mark at or above current data, but below current data
//       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
//       * to end of window, whichever is less.
//       */
//      init = (ulg)curr + WIN_INIT - s->high_water;
//      if (init > s->window_size - s->high_water)
//        init = s->window_size - s->high_water;
//      zmemzero(s->window + s->high_water, (unsigned)init);
//      s->high_water += init;
//    }
//  }
//
//  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
//    "not enough room for search");
}

/* ===========================================================================
 * Copy without compression as much as possible from the input stream, return
 * the current block state.
 * This function does not insert new strings in the dictionary since
 * uncompressible data is probably not useful. This function is used
 * only for the level=0 compression option.
 * NOTE: this function should be optimized to avoid extra copying from
 * window to pending_buf.
 */
function deflate_stored(s, flush) {
  /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
   * to pending_buf_size, and each stored block has a 5 byte header:
   */
  var max_block_size = 0xffff;

  if (max_block_size > s.pending_buf_size - 5) {
    max_block_size = s.pending_buf_size - 5;
  }

  /* Copy as much as possible from input to output: */
  for (;;) {
    /* Fill the window as much as possible: */
    if (s.lookahead <= 1) {

      //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
      //  s->block_start >= (long)s->w_size, "slide too late");
//      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
//        s.block_start >= s.w_size)) {
//        throw  new Error("slide too late");
//      }

      fill_window(s);
      if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }

      if (s.lookahead === 0) {
        break;
      }
      /* flush the current block */
    }
    //Assert(s->block_start >= 0L, "block gone");
//    if (s.block_start < 0) throw new Error("block gone");

    s.strstart += s.lookahead;
    s.lookahead = 0;

    /* Emit a stored block if pending_buf will be full: */
    var max_start = s.block_start + max_block_size;

    if (s.strstart === 0 || s.strstart >= max_start) {
      /* strstart == 0 is possible when wraparound on 16-bit machine */
      s.lookahead = s.strstart - max_start;
      s.strstart = max_start;
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/


    }
    /* Flush if we may have to slide, otherwise block_start may become
     * negative and the data will be gone:
     */
    if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }

  s.insert = 0;

  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }

  if (s.strstart > s.block_start) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_NEED_MORE;
}

/* ===========================================================================
 * Compress as much as possible from the input stream, return the current
 * block state.
 * This function does not perform lazy evaluation of matches and inserts
 * new strings in the dictionary only for unmatched strings or for short
 * matches. It is used only for the fast compression options.
 */
function deflate_fast(s, flush) {
  var hash_head;        /* head of the hash chain */
  var bflush;           /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) {
        break; /* flush the current block */
      }
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     * At this point we have always match_length < MIN_MATCH
     */
    if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */
    }
    if (s.match_length >= MIN_MATCH) {
      // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only

      /*** _tr_tally_dist(s, s.strstart - s.match_start,
                     s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;

      /* Insert new strings in the hash table only if the match length
       * is not too large. This saves time but degrades compression.
       */
      if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
        s.match_length--; /* string at strstart already in table */
        do {
          s.strstart++;
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
          /* strstart never exceeds WSIZE-MAX_MATCH, so there are
           * always MIN_MATCH bytes ahead.
           */
        } while (--s.match_length !== 0);
        s.strstart++;
      } else
      {
        s.strstart += s.match_length;
        s.match_length = 0;
        s.ins_h = s.window[s.strstart];
        /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;

//#if MIN_MATCH != 3
//                Call UPDATE_HASH() MIN_MATCH-3 more times
//#endif
        /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
         * matter since it will be recomputed at next deflate call.
         */
      }
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s.window[s.strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * Same as above, but achieves better compression. We use a lazy
 * evaluation for matches: a match is finally adopted only if there is
 * no better match at the next window position.
 */
function deflate_slow(s, flush) {
  var hash_head;          /* head of hash chain */
  var bflush;              /* set if current block must be flushed */

  var max_insert;

  /* Process the input block. */
  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     */
    s.prev_length = s.match_length;
    s.prev_match = s.match_start;
    s.match_length = MIN_MATCH - 1;

    if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
        s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */

      if (s.match_length <= 5 &&
         (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {

        /* If prev_match is also MIN_MATCH, match_start is garbage
         * but we will ignore the current match anyway.
         */
        s.match_length = MIN_MATCH - 1;
      }
    }
    /* If there was a match at the previous step and the current
     * match is not better, output the previous match:
     */
    if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
      max_insert = s.strstart + s.lookahead - MIN_MATCH;
      /* Do not insert strings in hash table beyond this. */

      //check_match(s, s.strstart-1, s.prev_match, s.prev_length);

      /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
                     s.prev_length - MIN_MATCH, bflush);***/
      bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
      /* Insert in hash table all strings up to the end of the match.
       * strstart-1 and strstart are already inserted. If there is not
       * enough lookahead, the last two strings are not inserted in
       * the hash table.
       */
      s.lookahead -= s.prev_length - 1;
      s.prev_length -= 2;
      do {
        if (++s.strstart <= max_insert) {
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
        }
      } while (--s.prev_length !== 0);
      s.match_available = 0;
      s.match_length = MIN_MATCH - 1;
      s.strstart++;

      if (bflush) {
        /*** FLUSH_BLOCK(s, 0); ***/
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
        /***/
      }

    } else if (s.match_available) {
      /* If there was no match at the previous position, output a
       * single literal. If there was a match but the current match
       * is longer, truncate the previous match to a single literal.
       */
      //Tracevv((stderr,"%c", s->window[s->strstart-1]));
      /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

      if (bflush) {
        /*** FLUSH_BLOCK_ONLY(s, 0) ***/
        flush_block_only(s, false);
        /***/
      }
      s.strstart++;
      s.lookahead--;
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
    } else {
      /* There is no previous match to compare with, wait for
       * the next step to decide.
       */
      s.match_available = 1;
      s.strstart++;
      s.lookahead--;
    }
  }
  //Assert (flush != Z_NO_FLUSH, "no flush?");
  if (s.match_available) {
    //Tracevv((stderr,"%c", s->window[s->strstart-1]));
    /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

    s.match_available = 0;
  }
  s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_BLOCK_DONE;
}


/* ===========================================================================
 * For Z_RLE, simply look for runs of bytes, generate matches only of distance
 * one.  Do not maintain a hash table.  (It will be regenerated if this run of
 * deflate switches away from Z_RLE.)
 */
function deflate_rle(s, flush) {
  var bflush;            /* set if current block must be flushed */
  var prev;              /* byte at distance one to match */
  var scan, strend;      /* scan goes up to strend for length of run */

  var _win = s.window;

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the longest run, plus one for the unrolled loop.
     */
    if (s.lookahead <= MAX_MATCH) {
      fill_window(s);
      if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* See how many times the previous byte repeats */
    s.match_length = 0;
    if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
      scan = s.strstart - 1;
      prev = _win[scan];
      if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
        strend = s.strstart + MAX_MATCH;
        do {
          /*jshint noempty:false*/
        } while (prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 scan < strend);
        s.match_length = MAX_MATCH - (strend - scan);
        if (s.match_length > s.lookahead) {
          s.match_length = s.lookahead;
        }
      }
      //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
    }

    /* Emit match if have run of MIN_MATCH or longer, else emit literal */
    if (s.match_length >= MIN_MATCH) {
      //check_match(s, s.strstart, s.strstart - 1, s.match_length);

      /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;
      s.strstart += s.match_length;
      s.match_length = 0;
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s->window[s->strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
 * (It will be regenerated if this run of deflate switches away from Huffman.)
 */
function deflate_huff(s, flush) {
  var bflush;             /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we have a literal to write. */
    if (s.lookahead === 0) {
      fill_window(s);
      if (s.lookahead === 0) {
        if (flush === Z_NO_FLUSH) {
          return BS_NEED_MORE;
        }
        break;      /* flush the current block */
      }
    }

    /* Output a literal byte */
    s.match_length = 0;
    //Tracevv((stderr,"%c", s->window[s->strstart]));
    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
    s.lookahead--;
    s.strstart++;
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* Values for max_lazy_match, good_match and max_chain_length, depending on
 * the desired pack level (0..9). The values given below have been tuned to
 * exclude worst case performance for pathological files. Better values may be
 * found for specific files.
 */
function Config(good_length, max_lazy, nice_length, max_chain, func) {
  this.good_length = good_length;
  this.max_lazy = max_lazy;
  this.nice_length = nice_length;
  this.max_chain = max_chain;
  this.func = func;
}

var configuration_table;

configuration_table = [
  /*      good lazy nice chain */
  new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */
  new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */
  new Config(4, 5, 16, 8, deflate_fast),           /* 2 */
  new Config(4, 6, 32, 32, deflate_fast),          /* 3 */

  new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */
  new Config(8, 16, 32, 32, deflate_slow),         /* 5 */
  new Config(8, 16, 128, 128, deflate_slow),       /* 6 */
  new Config(8, 32, 128, 256, deflate_slow),       /* 7 */
  new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */
  new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */
];


/* ===========================================================================
 * Initialize the "longest match" routines for a new zlib stream
 */
function lm_init(s) {
  s.window_size = 2 * s.w_size;

  /*** CLEAR_HASH(s); ***/
  zero(s.head); // Fill with NIL (= 0);

  /* Set the default configuration parameters:
   */
  s.max_lazy_match = configuration_table[s.level].max_lazy;
  s.good_match = configuration_table[s.level].good_length;
  s.nice_match = configuration_table[s.level].nice_length;
  s.max_chain_length = configuration_table[s.level].max_chain;

  s.strstart = 0;
  s.block_start = 0;
  s.lookahead = 0;
  s.insert = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  s.ins_h = 0;
}


function DeflateState() {
  this.strm = null;            /* pointer back to this zlib stream */
  this.status = 0;            /* as the name implies */
  this.pending_buf = null;      /* output still pending */
  this.pending_buf_size = 0;  /* size of pending_buf */
  this.pending_out = 0;       /* next pending byte to output to the stream */
  this.pending = 0;           /* nb of bytes in the pending buffer */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.gzhead = null;         /* gzip header information to write */
  this.gzindex = 0;           /* where in extra, name, or comment */
  this.method = Z_DEFLATED; /* can only be DEFLATED */
  this.last_flush = -1;   /* value of flush param for previous deflate call */

  this.w_size = 0;  /* LZ77 window size (32K by default) */
  this.w_bits = 0;  /* log2(w_size)  (8..16) */
  this.w_mask = 0;  /* w_size - 1 */

  this.window = null;
  /* Sliding window. Input bytes are read into the second half of the window,
   * and move to the first half later to keep a dictionary of at least wSize
   * bytes. With this organization, matches are limited to a distance of
   * wSize-MAX_MATCH bytes, but this ensures that IO is always
   * performed with a length multiple of the block size.
   */

  this.window_size = 0;
  /* Actual size of window: 2*wSize, except when the user input buffer
   * is directly used as sliding window.
   */

  this.prev = null;
  /* Link to older string with same hash index. To limit the size of this
   * array to 64K, this link is maintained only for the last 32K strings.
   * An index in this array is thus a window index modulo 32K.
   */

  this.head = null;   /* Heads of the hash chains or NIL. */

  this.ins_h = 0;       /* hash index of string to be inserted */
  this.hash_size = 0;   /* number of elements in hash table */
  this.hash_bits = 0;   /* log2(hash_size) */
  this.hash_mask = 0;   /* hash_size-1 */

  this.hash_shift = 0;
  /* Number of bits by which ins_h must be shifted at each input
   * step. It must be such that after MIN_MATCH steps, the oldest
   * byte no longer takes part in the hash key, that is:
   *   hash_shift * MIN_MATCH >= hash_bits
   */

  this.block_start = 0;
  /* Window position at the beginning of the current output block. Gets
   * negative when the window is moved backwards.
   */

  this.match_length = 0;      /* length of best match */
  this.prev_match = 0;        /* previous match */
  this.match_available = 0;   /* set if previous match exists */
  this.strstart = 0;          /* start of string to insert */
  this.match_start = 0;       /* start of matching string */
  this.lookahead = 0;         /* number of valid bytes ahead in window */

  this.prev_length = 0;
  /* Length of the best match at previous step. Matches not greater than this
   * are discarded. This is used in the lazy match evaluation.
   */

  this.max_chain_length = 0;
  /* To speed up deflation, hash chains are never searched beyond this
   * length.  A higher limit improves compression ratio but degrades the
   * speed.
   */

  this.max_lazy_match = 0;
  /* Attempt to find a better match only when the current match is strictly
   * smaller than this value. This mechanism is used only for compression
   * levels >= 4.
   */
  // That's alias to max_lazy_match, don't use directly
  //this.max_insert_length = 0;
  /* Insert new strings in the hash table only if the match length is not
   * greater than this length. This saves time but degrades compression.
   * max_insert_length is used only for compression levels <= 3.
   */

  this.level = 0;     /* compression level (1..9) */
  this.strategy = 0;  /* favor or force Huffman coding*/

  this.good_match = 0;
  /* Use a faster search when the previous match is longer than this */

  this.nice_match = 0; /* Stop searching when current match exceeds this */

              /* used by trees.c: */

  /* Didn't use ct_data typedef below to suppress compiler warning */

  // struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
  // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
  // struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */

  // Use flat array of DOUBLE size, with interleaved fata,
  // because JS does not support effective
  this.dyn_ltree  = new utils.Buf16(HEAP_SIZE * 2);
  this.dyn_dtree  = new utils.Buf16((2 * D_CODES + 1) * 2);
  this.bl_tree    = new utils.Buf16((2 * BL_CODES + 1) * 2);
  zero(this.dyn_ltree);
  zero(this.dyn_dtree);
  zero(this.bl_tree);

  this.l_desc   = null;         /* desc. for literal tree */
  this.d_desc   = null;         /* desc. for distance tree */
  this.bl_desc  = null;         /* desc. for bit length tree */

  //ush bl_count[MAX_BITS+1];
  this.bl_count = new utils.Buf16(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  //int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
  this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */
  zero(this.heap);

  this.heap_len = 0;               /* number of elements in the heap */
  this.heap_max = 0;               /* element of largest frequency */
  /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
   * The same heap array is used to build all trees.
   */

  this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
  zero(this.depth);
  /* Depth of each subtree used as tie breaker for trees of equal frequency
   */

  this.l_buf = 0;          /* buffer index for literals or lengths */

  this.lit_bufsize = 0;
  /* Size of match buffer for literals/lengths.  There are 4 reasons for
   * limiting lit_bufsize to 64K:
   *   - frequencies can be kept in 16 bit counters
   *   - if compression is not successful for the first block, all input
   *     data is still in the window so we can still emit a stored block even
   *     when input comes from standard input.  (This can also be done for
   *     all blocks if lit_bufsize is not greater than 32K.)
   *   - if compression is not successful for a file smaller than 64K, we can
   *     even emit a stored file instead of a stored block (saving 5 bytes).
   *     This is applicable only for zip (not gzip or zlib).
   *   - creating new Huffman trees less frequently may not provide fast
   *     adaptation to changes in the input data statistics. (Take for
   *     example a binary file with poorly compressible code followed by
   *     a highly compressible string table.) Smaller buffer sizes give
   *     fast adaptation but have of course the overhead of transmitting
   *     trees more frequently.
   *   - I can't count above 4
   */

  this.last_lit = 0;      /* running index in l_buf */

  this.d_buf = 0;
  /* Buffer index for distances. To simplify the code, d_buf and l_buf have
   * the same number of elements. To use different lengths, an extra flag
   * array would be necessary.
   */

  this.opt_len = 0;       /* bit length of current block with optimal trees */
  this.static_len = 0;    /* bit length of current block with static trees */
  this.matches = 0;       /* number of string matches in current block */
  this.insert = 0;        /* bytes at end of window left to insert */


  this.bi_buf = 0;
  /* Output buffer. bits are inserted starting at the bottom (least
   * significant bits).
   */
  this.bi_valid = 0;
  /* Number of valid bits in bi_buf.  All bits above the last valid bit
   * are always zero.
   */

  // Used for window memory init. We safely ignore it for JS. That makes
  // sense only for pointers and memory check tools.
  //this.high_water = 0;
  /* High water mark offset in window for initialized bytes -- bytes above
   * this are set to zero in order to avoid memory check warnings when
   * longest match routines access bytes past the input.  This is then
   * updated to the new high water mark.
   */
}


function deflateResetKeep(strm) {
  var s;

  if (!strm || !strm.state) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.total_in = strm.total_out = 0;
  strm.data_type = Z_UNKNOWN;

  s = strm.state;
  s.pending = 0;
  s.pending_out = 0;

  if (s.wrap < 0) {
    s.wrap = -s.wrap;
    /* was made negative by deflate(..., Z_FINISH); */
  }
  s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
  strm.adler = (s.wrap === 2) ?
    0  // crc32(0, Z_NULL, 0)
  :
    1; // adler32(0, Z_NULL, 0)
  s.last_flush = Z_NO_FLUSH;
  trees._tr_init(s);
  return Z_OK;
}


function deflateReset(strm) {
  var ret = deflateResetKeep(strm);
  if (ret === Z_OK) {
    lm_init(strm.state);
  }
  return ret;
}


function deflateSetHeader(strm, head) {
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
  strm.state.gzhead = head;
  return Z_OK;
}


function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  if (!strm) { // === Z_NULL
    return Z_STREAM_ERROR;
  }
  var wrap = 1;

  if (level === Z_DEFAULT_COMPRESSION) {
    level = 6;
  }

  if (windowBits < 0) { /* suppress zlib wrapper */
    wrap = 0;
    windowBits = -windowBits;
  }

  else if (windowBits > 15) {
    wrap = 2;           /* write gzip wrapper instead */
    windowBits -= 16;
  }


  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
    windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
    strategy < 0 || strategy > Z_FIXED) {
    return err(strm, Z_STREAM_ERROR);
  }


  if (windowBits === 8) {
    windowBits = 9;
  }
  /* until 256-byte window bug fixed */

  var s = new DeflateState();

  strm.state = s;
  s.strm = strm;

  s.wrap = wrap;
  s.gzhead = null;
  s.w_bits = windowBits;
  s.w_size = 1 << s.w_bits;
  s.w_mask = s.w_size - 1;

  s.hash_bits = memLevel + 7;
  s.hash_size = 1 << s.hash_bits;
  s.hash_mask = s.hash_size - 1;
  s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);

  s.window = new utils.Buf8(s.w_size * 2);
  s.head = new utils.Buf16(s.hash_size);
  s.prev = new utils.Buf16(s.w_size);

  // Don't need mem init magic for JS.
  //s.high_water = 0;  /* nothing written to s->window yet */

  s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */

  s.pending_buf_size = s.lit_bufsize * 4;

  //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
  //s->pending_buf = (uchf *) overlay;
  s.pending_buf = new utils.Buf8(s.pending_buf_size);

  // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
  //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
  s.d_buf = 1 * s.lit_bufsize;

  //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
  s.l_buf = (1 + 2) * s.lit_bufsize;

  s.level = level;
  s.strategy = strategy;
  s.method = method;

  return deflateReset(strm);
}

function deflateInit(strm, level) {
  return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}


function deflate(strm, flush) {
  var old_flush, s;
  var beg, val; // for gzip header write only

  if (!strm || !strm.state ||
    flush > Z_BLOCK || flush < 0) {
    return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  }

  s = strm.state;

  if (!strm.output ||
      (!strm.input && strm.avail_in !== 0) ||
      (s.status === FINISH_STATE && flush !== Z_FINISH)) {
    return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
  }

  s.strm = strm; /* just in case */
  old_flush = s.last_flush;
  s.last_flush = flush;

  /* Write the header */
  if (s.status === INIT_STATE) {

    if (s.wrap === 2) { // GZIP header
      strm.adler = 0;  //crc32(0L, Z_NULL, 0);
      put_byte(s, 31);
      put_byte(s, 139);
      put_byte(s, 8);
      if (!s.gzhead) { // s->gzhead == Z_NULL
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, OS_CODE);
        s.status = BUSY_STATE;
      }
      else {
        put_byte(s, (s.gzhead.text ? 1 : 0) +
                    (s.gzhead.hcrc ? 2 : 0) +
                    (!s.gzhead.extra ? 0 : 4) +
                    (!s.gzhead.name ? 0 : 8) +
                    (!s.gzhead.comment ? 0 : 16)
                );
        put_byte(s, s.gzhead.time & 0xff);
        put_byte(s, (s.gzhead.time >> 8) & 0xff);
        put_byte(s, (s.gzhead.time >> 16) & 0xff);
        put_byte(s, (s.gzhead.time >> 24) & 0xff);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, s.gzhead.os & 0xff);
        if (s.gzhead.extra && s.gzhead.extra.length) {
          put_byte(s, s.gzhead.extra.length & 0xff);
          put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
        }
        if (s.gzhead.hcrc) {
          strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
        }
        s.gzindex = 0;
        s.status = EXTRA_STATE;
      }
    }
    else // DEFLATE header
    {
      var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
      var level_flags = -1;

      if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
        level_flags = 0;
      } else if (s.level < 6) {
        level_flags = 1;
      } else if (s.level === 6) {
        level_flags = 2;
      } else {
        level_flags = 3;
      }
      header |= (level_flags << 6);
      if (s.strstart !== 0) { header |= PRESET_DICT; }
      header += 31 - (header % 31);

      s.status = BUSY_STATE;
      putShortMSB(s, header);

      /* Save the adler32 of the preset dictionary: */
      if (s.strstart !== 0) {
        putShortMSB(s, strm.adler >>> 16);
        putShortMSB(s, strm.adler & 0xffff);
      }
      strm.adler = 1; // adler32(0L, Z_NULL, 0);
    }
  }

//#ifdef GZIP
  if (s.status === EXTRA_STATE) {
    if (s.gzhead.extra/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */

      while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            break;
          }
        }
        put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
        s.gzindex++;
      }
      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (s.gzindex === s.gzhead.extra.length) {
        s.gzindex = 0;
        s.status = NAME_STATE;
      }
    }
    else {
      s.status = NAME_STATE;
    }
  }
  if (s.status === NAME_STATE) {
    if (s.gzhead.name/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.name.length) {
          val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.gzindex = 0;
        s.status = COMMENT_STATE;
      }
    }
    else {
      s.status = COMMENT_STATE;
    }
  }
  if (s.status === COMMENT_STATE) {
    if (s.gzhead.comment/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.comment.length) {
          val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.status = HCRC_STATE;
      }
    }
    else {
      s.status = HCRC_STATE;
    }
  }
  if (s.status === HCRC_STATE) {
    if (s.gzhead.hcrc) {
      if (s.pending + 2 > s.pending_buf_size) {
        flush_pending(strm);
      }
      if (s.pending + 2 <= s.pending_buf_size) {
        put_byte(s, strm.adler & 0xff);
        put_byte(s, (strm.adler >> 8) & 0xff);
        strm.adler = 0; //crc32(0L, Z_NULL, 0);
        s.status = BUSY_STATE;
      }
    }
    else {
      s.status = BUSY_STATE;
    }
  }
//#endif

  /* Flush as much pending output as possible */
  if (s.pending !== 0) {
    flush_pending(strm);
    if (strm.avail_out === 0) {
      /* Since avail_out is 0, deflate will be called again with
       * more output space, but possibly with both pending and
       * avail_in equal to zero. There won't be anything to do,
       * but this is not an error situation so make sure we
       * return OK instead of BUF_ERROR at next call of deflate:
       */
      s.last_flush = -1;
      return Z_OK;
    }

    /* Make sure there is something to do and avoid duplicate consecutive
     * flushes. For repeated and useless calls with Z_FINISH, we keep
     * returning Z_STREAM_END instead of Z_BUF_ERROR.
     */
  } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
    flush !== Z_FINISH) {
    return err(strm, Z_BUF_ERROR);
  }

  /* User must not provide more input after the first FINISH: */
  if (s.status === FINISH_STATE && strm.avail_in !== 0) {
    return err(strm, Z_BUF_ERROR);
  }

  /* Start a new block or continue the current one.
   */
  if (strm.avail_in !== 0 || s.lookahead !== 0 ||
    (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
    var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
      (s.strategy === Z_RLE ? deflate_rle(s, flush) :
        configuration_table[s.level].func(s, flush));

    if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
      s.status = FINISH_STATE;
    }
    if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
      if (strm.avail_out === 0) {
        s.last_flush = -1;
        /* avoid BUF_ERROR next call, see above */
      }
      return Z_OK;
      /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
       * of deflate should use the same flush parameter to make sure
       * that the flush is complete. So we don't have to output an
       * empty block here, this will be done at next call. This also
       * ensures that for a very small output buffer, we emit at most
       * one empty block.
       */
    }
    if (bstate === BS_BLOCK_DONE) {
      if (flush === Z_PARTIAL_FLUSH) {
        trees._tr_align(s);
      }
      else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */

        trees._tr_stored_block(s, 0, 0, false);
        /* For a full flush, this empty block will be recognized
         * as a special marker by inflate_sync().
         */
        if (flush === Z_FULL_FLUSH) {
          /*** CLEAR_HASH(s); ***/             /* forget history */
          zero(s.head); // Fill with NIL (= 0);

          if (s.lookahead === 0) {
            s.strstart = 0;
            s.block_start = 0;
            s.insert = 0;
          }
        }
      }
      flush_pending(strm);
      if (strm.avail_out === 0) {
        s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
        return Z_OK;
      }
    }
  }
  //Assert(strm->avail_out > 0, "bug2");
  //if (strm.avail_out <= 0) { throw new Error("bug2");}

  if (flush !== Z_FINISH) { return Z_OK; }
  if (s.wrap <= 0) { return Z_STREAM_END; }

  /* Write the trailer */
  if (s.wrap === 2) {
    put_byte(s, strm.adler & 0xff);
    put_byte(s, (strm.adler >> 8) & 0xff);
    put_byte(s, (strm.adler >> 16) & 0xff);
    put_byte(s, (strm.adler >> 24) & 0xff);
    put_byte(s, strm.total_in & 0xff);
    put_byte(s, (strm.total_in >> 8) & 0xff);
    put_byte(s, (strm.total_in >> 16) & 0xff);
    put_byte(s, (strm.total_in >> 24) & 0xff);
  }
  else
  {
    putShortMSB(s, strm.adler >>> 16);
    putShortMSB(s, strm.adler & 0xffff);
  }

  flush_pending(strm);
  /* If avail_out is zero, the application will call deflate again
   * to flush the rest.
   */
  if (s.wrap > 0) { s.wrap = -s.wrap; }
  /* write the trailer only once! */
  return s.pending !== 0 ? Z_OK : Z_STREAM_END;
}

function deflateEnd(strm) {
  var status;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  status = strm.state.status;
  if (status !== INIT_STATE &&
    status !== EXTRA_STATE &&
    status !== NAME_STATE &&
    status !== COMMENT_STATE &&
    status !== HCRC_STATE &&
    status !== BUSY_STATE &&
    status !== FINISH_STATE
  ) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.state = null;

  return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
}


/* =========================================================================
 * Initializes the compression dictionary from the given byte
 * sequence without producing any compressed output.
 */
function deflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var s;
  var str, n;
  var wrap;
  var avail;
  var next;
  var input;
  var tmpDict;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  s = strm.state;
  wrap = s.wrap;

  if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
    return Z_STREAM_ERROR;
  }

  /* when using zlib wrappers, compute Adler-32 for provided dictionary */
  if (wrap === 1) {
    /* adler32(strm->adler, dictionary, dictLength); */
    strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
  }

  s.wrap = 0;   /* avoid computing Adler-32 in read_buf */

  /* if dictionary would fill window, just replace the history */
  if (dictLength >= s.w_size) {
    if (wrap === 0) {            /* already empty otherwise */
      /*** CLEAR_HASH(s); ***/
      zero(s.head); // Fill with NIL (= 0);
      s.strstart = 0;
      s.block_start = 0;
      s.insert = 0;
    }
    /* use the tail */
    // dictionary = dictionary.slice(dictLength - s.w_size);
    tmpDict = new utils.Buf8(s.w_size);
    utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
    dictionary = tmpDict;
    dictLength = s.w_size;
  }
  /* insert dictionary into window and hash */
  avail = strm.avail_in;
  next = strm.next_in;
  input = strm.input;
  strm.avail_in = dictLength;
  strm.next_in = 0;
  strm.input = dictionary;
  fill_window(s);
  while (s.lookahead >= MIN_MATCH) {
    str = s.strstart;
    n = s.lookahead - (MIN_MATCH - 1);
    do {
      /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

      s.prev[str & s.w_mask] = s.head[s.ins_h];

      s.head[s.ins_h] = str;
      str++;
    } while (--n);
    s.strstart = str;
    s.lookahead = MIN_MATCH - 1;
    fill_window(s);
  }
  s.strstart += s.lookahead;
  s.block_start = s.strstart;
  s.insert = s.lookahead;
  s.lookahead = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  strm.next_in = next;
  strm.input = input;
  strm.avail_in = avail;
  s.wrap = wrap;
  return Z_OK;
}


exports.deflateInit = deflateInit;
exports.deflateInit2 = deflateInit2;
exports.deflateReset = deflateReset;
exports.deflateResetKeep = deflateResetKeep;
exports.deflateSetHeader = deflateSetHeader;
exports.deflate = deflate;
exports.deflateEnd = deflateEnd;
exports.deflateSetDictionary = deflateSetDictionary;
exports.deflateInfo = 'pako deflate (from Nodeca project)';

/* Not implemented
exports.deflateBound = deflateBound;
exports.deflateCopy = deflateCopy;
exports.deflateParams = deflateParams;
exports.deflatePending = deflatePending;
exports.deflatePrime = deflatePrime;
exports.deflateTune = deflateTune;
*/

},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[function(require,module,exports){
'use strict';

module.exports = {
  2:      'need dictionary',     /* Z_NEED_DICT       2  */
  1:      'stream end',          /* Z_STREAM_END      1  */
  0:      '',                    /* Z_OK              0  */
  '-1':   'file error',          /* Z_ERRNO         (-1) */
  '-2':   'stream error',        /* Z_STREAM_ERROR  (-2) */
  '-3':   'data error',          /* Z_DATA_ERROR    (-3) */
  '-4':   'insufficient memory', /* Z_MEM_ERROR     (-4) */
  '-5':   'buffer error',        /* Z_BUF_ERROR     (-5) */
  '-6':   'incompatible version' /* Z_VERSION_ERROR (-6) */
};

},{}],7:[function(require,module,exports){
'use strict';


var utils = require('../utils/common');

/* Public constants ==========================================================*/
/* ===========================================================================*/


//var Z_FILTERED          = 1;
//var Z_HUFFMAN_ONLY      = 2;
//var Z_RLE               = 3;
var Z_FIXED               = 4;
//var Z_DEFAULT_STRATEGY  = 0;

/* Possible values of the data_type field (though see inflate()) */
var Z_BINARY              = 0;
var Z_TEXT                = 1;
//var Z_ASCII             = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;

/*============================================================================*/


function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }

// From zutil.h

var STORED_BLOCK = 0;
var STATIC_TREES = 1;
var DYN_TREES    = 2;
/* The three kinds of block type */

var MIN_MATCH    = 3;
var MAX_MATCH    = 258;
/* The minimum and maximum match lengths */

// From deflate.h
/* ===========================================================================
 * Internal compression state.
 */

var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */

var LITERALS      = 256;
/* number of literal bytes 0..255 */

var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */

var D_CODES       = 30;
/* number of distance codes */

var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */

var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */

var MAX_BITS      = 15;
/* All codes must not exceed MAX_BITS bits */

var Buf_size      = 16;
/* size of bit buffer in bi_buf */


/* ===========================================================================
 * Constants
 */

var MAX_BL_BITS = 7;
/* Bit length codes must not exceed MAX_BL_BITS bits */

var END_BLOCK   = 256;
/* end of block literal code */

var REP_3_6     = 16;
/* repeat previous bit length 3-6 times (2 bits of repeat count) */

var REPZ_3_10   = 17;
/* repeat a zero length 3-10 times  (3 bits of repeat count) */

var REPZ_11_138 = 18;
/* repeat a zero length 11-138 times  (7 bits of repeat count) */

/* eslint-disable comma-spacing,array-bracket-spacing */
var extra_lbits =   /* extra bits for each length code */
  [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];

var extra_dbits =   /* extra bits for each distance code */
  [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];

var extra_blbits =  /* extra bits for each bit length code */
  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];

var bl_order =
  [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
/* eslint-enable comma-spacing,array-bracket-spacing */

/* The lengths of the bit length codes are sent in order of decreasing
 * probability, to avoid transmitting the lengths for unused bit length codes.
 */

/* ===========================================================================
 * Local data. These are initialized only once.
 */

// We pre-fill arrays with 0 to avoid uninitialized gaps

var DIST_CODE_LEN = 512; /* see definition of array dist_code below */

// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
var static_ltree  = new Array((L_CODES + 2) * 2);
zero(static_ltree);
/* The static literal tree. Since the bit lengths are imposed, there is no
 * need for the L_CODES extra codes used during heap construction. However
 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
 * below).
 */

var static_dtree  = new Array(D_CODES * 2);
zero(static_dtree);
/* The static distance tree. (Actually a trivial tree since all codes use
 * 5 bits.)
 */

var _dist_code    = new Array(DIST_CODE_LEN);
zero(_dist_code);
/* Distance codes. The first 256 values correspond to the distances
 * 3 .. 258, the last 256 values correspond to the top 8 bits of
 * the 15 bit distances.
 */

var _length_code  = new Array(MAX_MATCH - MIN_MATCH + 1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */

var base_length   = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */

var base_dist     = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */


function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {

  this.static_tree  = static_tree;  /* static tree or NULL */
  this.extra_bits   = extra_bits;   /* extra bits for each code or NULL */
  this.extra_base   = extra_base;   /* base index for extra_bits */
  this.elems        = elems;        /* max number of elements in the tree */
  this.max_length   = max_length;   /* max bit length for the codes */

  // show if `static_tree` has data or dummy - needed for monomorphic objects
  this.has_stree    = static_tree && static_tree.length;
}


var static_l_desc;
var static_d_desc;
var static_bl_desc;


function TreeDesc(dyn_tree, stat_desc) {
  this.dyn_tree = dyn_tree;     /* the dynamic tree */
  this.max_code = 0;            /* largest code with non zero frequency */
  this.stat_desc = stat_desc;   /* the corresponding static tree */
}



function d_code(dist) {
  return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
}


/* ===========================================================================
 * Output a short LSB first on the stream.
 * IN assertion: there is enough room in pendingBuf.
 */
function put_short(s, w) {
//    put_byte(s, (uch)((w) & 0xff));
//    put_byte(s, (uch)((ush)(w) >> 8));
  s.pending_buf[s.pending++] = (w) & 0xff;
  s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
}


/* ===========================================================================
 * Send a value on a given number of bits.
 * IN assertion: length <= 16 and value fits in length bits.
 */
function send_bits(s, value, length) {
  if (s.bi_valid > (Buf_size - length)) {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    put_short(s, s.bi_buf);
    s.bi_buf = value >> (Buf_size - s.bi_valid);
    s.bi_valid += length - Buf_size;
  } else {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    s.bi_valid += length;
  }
}


function send_code(s, c, tree) {
  send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
}


/* ===========================================================================
 * Reverse the first len bits of a code, using straightforward code (a faster
 * method would use a table)
 * IN assertion: 1 <= len <= 15
 */
function bi_reverse(code, len) {
  var res = 0;
  do {
    res |= code & 1;
    code >>>= 1;
    res <<= 1;
  } while (--len > 0);
  return res >>> 1;
}


/* ===========================================================================
 * Flush the bit buffer, keeping at most 7 bits in it.
 */
function bi_flush(s) {
  if (s.bi_valid === 16) {
    put_short(s, s.bi_buf);
    s.bi_buf = 0;
    s.bi_valid = 0;

  } else if (s.bi_valid >= 8) {
    s.pending_buf[s.pending++] = s.bi_buf & 0xff;
    s.bi_buf >>= 8;
    s.bi_valid -= 8;
  }
}


/* ===========================================================================
 * Compute the optimal bit lengths for a tree and update the total bit length
 * for the current block.
 * IN assertion: the fields freq and dad are set, heap[heap_max] and
 *    above are the tree nodes sorted by increasing frequency.
 * OUT assertions: the field len is set to the optimal bit length, the
 *     array bl_count contains the frequencies for each bit length.
 *     The length opt_len is updated; static_len is also updated if stree is
 *     not null.
 */
function gen_bitlen(s, desc)
//    deflate_state *s;
//    tree_desc *desc;    /* the tree descriptor */
{
  var tree            = desc.dyn_tree;
  var max_code        = desc.max_code;
  var stree           = desc.stat_desc.static_tree;
  var has_stree       = desc.stat_desc.has_stree;
  var extra           = desc.stat_desc.extra_bits;
  var base            = desc.stat_desc.extra_base;
  var max_length      = desc.stat_desc.max_length;
  var h;              /* heap index */
  var n, m;           /* iterate over the tree elements */
  var bits;           /* bit length */
  var xbits;          /* extra bits */
  var f;              /* frequency */
  var overflow = 0;   /* number of elements with bit length too large */

  for (bits = 0; bits <= MAX_BITS; bits++) {
    s.bl_count[bits] = 0;
  }

  /* In a first pass, compute the optimal bit lengths (which may
   * overflow in the case of the bit length tree).
   */
  tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */

  for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
    n = s.heap[h];
    bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
    if (bits > max_length) {
      bits = max_length;
      overflow++;
    }
    tree[n * 2 + 1]/*.Len*/ = bits;
    /* We overwrite tree[n].Dad which is no longer needed */

    if (n > max_code) { continue; } /* not a leaf node */

    s.bl_count[bits]++;
    xbits = 0;
    if (n >= base) {
      xbits = extra[n - base];
    }
    f = tree[n * 2]/*.Freq*/;
    s.opt_len += f * (bits + xbits);
    if (has_stree) {
      s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
    }
  }
  if (overflow === 0) { return; }

  // Trace((stderr,"\nbit length overflow\n"));
  /* This happens for example on obj2 and pic of the Calgary corpus */

  /* Find the first bit length which could increase: */
  do {
    bits = max_length - 1;
    while (s.bl_count[bits] === 0) { bits--; }
    s.bl_count[bits]--;      /* move one leaf down the tree */
    s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
    s.bl_count[max_length]--;
    /* The brother of the overflow item also moves one step up,
     * but this does not affect bl_count[max_length]
     */
    overflow -= 2;
  } while (overflow > 0);

  /* Now recompute all bit lengths, scanning in increasing frequency.
   * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
   * lengths instead of fixing only the wrong ones. This idea is taken
   * from 'ar' written by Haruhiko Okumura.)
   */
  for (bits = max_length; bits !== 0; bits--) {
    n = s.bl_count[bits];
    while (n !== 0) {
      m = s.heap[--h];
      if (m > max_code) { continue; }
      if (tree[m * 2 + 1]/*.Len*/ !== bits) {
        // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
        s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
        tree[m * 2 + 1]/*.Len*/ = bits;
      }
      n--;
    }
  }
}


/* ===========================================================================
 * Generate the codes for a given tree and bit counts (which need not be
 * optimal).
 * IN assertion: the array bl_count contains the bit length statistics for
 * the given tree and the field len is set for all tree elements.
 * OUT assertion: the field code is set for all tree elements of non
 *     zero code length.
 */
function gen_codes(tree, max_code, bl_count)
//    ct_data *tree;             /* the tree to decorate */
//    int max_code;              /* largest code with non zero frequency */
//    ushf *bl_count;            /* number of codes at each bit length */
{
  var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
  var code = 0;              /* running code value */
  var bits;                  /* bit index */
  var n;                     /* code index */

  /* The distribution counts are first used to generate the code values
   * without bit reversal.
   */
  for (bits = 1; bits <= MAX_BITS; bits++) {
    next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
  }
  /* Check that the bit counts in bl_count are consistent. The last code
   * must be all ones.
   */
  //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
  //        "inconsistent bit counts");
  //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));

  for (n = 0;  n <= max_code; n++) {
    var len = tree[n * 2 + 1]/*.Len*/;
    if (len === 0) { continue; }
    /* Now reverse the bits */
    tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);

    //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
    //     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
  }
}


/* ===========================================================================
 * Initialize the various 'constant' tables.
 */
function tr_static_init() {
  var n;        /* iterates over tree elements */
  var bits;     /* bit counter */
  var length;   /* length value */
  var code;     /* code value */
  var dist;     /* distance index */
  var bl_count = new Array(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  // do check in _tr_init()
  //if (static_init_done) return;

  /* For some embedded targets, global variables are not initialized: */
/*#ifdef NO_INIT_GLOBAL_POINTERS
  static_l_desc.static_tree = static_ltree;
  static_l_desc.extra_bits = extra_lbits;
  static_d_desc.static_tree = static_dtree;
  static_d_desc.extra_bits = extra_dbits;
  static_bl_desc.extra_bits = extra_blbits;
#endif*/

  /* Initialize the mapping length (0..255) -> length code (0..28) */
  length = 0;
  for (code = 0; code < LENGTH_CODES - 1; code++) {
    base_length[code] = length;
    for (n = 0; n < (1 << extra_lbits[code]); n++) {
      _length_code[length++] = code;
    }
  }
  //Assert (length == 256, "tr_static_init: length != 256");
  /* Note that the length 255 (match length 258) can be represented
   * in two different ways: code 284 + 5 bits or code 285, so we
   * overwrite length_code[255] to use the best encoding:
   */
  _length_code[length - 1] = code;

  /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  dist = 0;
  for (code = 0; code < 16; code++) {
    base_dist[code] = dist;
    for (n = 0; n < (1 << extra_dbits[code]); n++) {
      _dist_code[dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: dist != 256");
  dist >>= 7; /* from now on, all distances are divided by 128 */
  for (; code < D_CODES; code++) {
    base_dist[code] = dist << 7;
    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
      _dist_code[256 + dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: 256+dist != 512");

  /* Construct the codes of the static literal tree */
  for (bits = 0; bits <= MAX_BITS; bits++) {
    bl_count[bits] = 0;
  }

  n = 0;
  while (n <= 143) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  while (n <= 255) {
    static_ltree[n * 2 + 1]/*.Len*/ = 9;
    n++;
    bl_count[9]++;
  }
  while (n <= 279) {
    static_ltree[n * 2 + 1]/*.Len*/ = 7;
    n++;
    bl_count[7]++;
  }
  while (n <= 287) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  /* Codes 286 and 287 do not exist, but we must include them in the
   * tree construction to get a canonical Huffman tree (longest code
   * all ones)
   */
  gen_codes(static_ltree, L_CODES + 1, bl_count);

  /* The static distance tree is trivial: */
  for (n = 0; n < D_CODES; n++) {
    static_dtree[n * 2 + 1]/*.Len*/ = 5;
    static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
  }

  // Now data ready and we can init static trees
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS);
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0,         BL_CODES, MAX_BL_BITS);

  //static_init_done = true;
}


/* ===========================================================================
 * Initialize a new block.
 */
function init_block(s) {
  var n; /* iterates over tree elements */

  /* Initialize the trees. */
  for (n = 0; n < L_CODES;  n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < D_CODES;  n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }

  s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
  s.opt_len = s.static_len = 0;
  s.last_lit = s.matches = 0;
}


/* ===========================================================================
 * Flush the bit buffer and align the output on a byte boundary
 */
function bi_windup(s)
{
  if (s.bi_valid > 8) {
    put_short(s, s.bi_buf);
  } else if (s.bi_valid > 0) {
    //put_byte(s, (Byte)s->bi_buf);
    s.pending_buf[s.pending++] = s.bi_buf;
  }
  s.bi_buf = 0;
  s.bi_valid = 0;
}

/* ===========================================================================
 * Copy a stored block, storing first the length and its
 * one's complement if requested.
 */
function copy_block(s, buf, len, header)
//DeflateState *s;
//charf    *buf;    /* the input data */
//unsigned len;     /* its length */
//int      header;  /* true if block header must be written */
{
  bi_windup(s);        /* align on byte boundary */

  if (header) {
    put_short(s, len);
    put_short(s, ~len);
  }
//  while (len--) {
//    put_byte(s, *buf++);
//  }
  utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  s.pending += len;
}

/* ===========================================================================
 * Compares to subtrees, using the tree depth as tie breaker when
 * the subtrees have equal frequency. This minimizes the worst case length.
 */
function smaller(tree, n, m, depth) {
  var _n2 = n * 2;
  var _m2 = m * 2;
  return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
         (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
}

/* ===========================================================================
 * Restore the heap property by moving down the tree starting at node k,
 * exchanging a node with the smallest of its two sons if necessary, stopping
 * when the heap property is re-established (each father smaller than its
 * two sons).
 */
function pqdownheap(s, tree, k)
//    deflate_state *s;
//    ct_data *tree;  /* the tree to restore */
//    int k;               /* node to move down */
{
  var v = s.heap[k];
  var j = k << 1;  /* left son of k */
  while (j <= s.heap_len) {
    /* Set j to the smallest of the two sons: */
    if (j < s.heap_len &&
      smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
      j++;
    }
    /* Exit if v is smaller than both sons */
    if (smaller(tree, v, s.heap[j], s.depth)) { break; }

    /* Exchange v with the smallest son */
    s.heap[k] = s.heap[j];
    k = j;

    /* And continue down the tree, setting j to the left son of k */
    j <<= 1;
  }
  s.heap[k] = v;
}


// inlined manually
// var SMALLEST = 1;

/* ===========================================================================
 * Send the block data compressed using the given Huffman trees
 */
function compress_block(s, ltree, dtree)
//    deflate_state *s;
//    const ct_data *ltree; /* literal tree */
//    const ct_data *dtree; /* distance tree */
{
  var dist;           /* distance of matched string */
  var lc;             /* match length or unmatched char (if dist == 0) */
  var lx = 0;         /* running index in l_buf */
  var code;           /* the code to send */
  var extra;          /* number of extra bits to send */

  if (s.last_lit !== 0) {
    do {
      dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
      lc = s.pending_buf[s.l_buf + lx];
      lx++;

      if (dist === 0) {
        send_code(s, lc, ltree); /* send a literal byte */
        //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
      } else {
        /* Here, lc is the match length - MIN_MATCH */
        code = _length_code[lc];
        send_code(s, code + LITERALS + 1, ltree); /* send the length code */
        extra = extra_lbits[code];
        if (extra !== 0) {
          lc -= base_length[code];
          send_bits(s, lc, extra);       /* send the extra length bits */
        }
        dist--; /* dist is now the match distance - 1 */
        code = d_code(dist);
        //Assert (code < D_CODES, "bad d_code");

        send_code(s, code, dtree);       /* send the distance code */
        extra = extra_dbits[code];
        if (extra !== 0) {
          dist -= base_dist[code];
          send_bits(s, dist, extra);   /* send the extra distance bits */
        }
      } /* literal or match pair ? */

      /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
      //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
      //       "pendingBuf overflow");

    } while (lx < s.last_lit);
  }

  send_code(s, END_BLOCK, ltree);
}


/* ===========================================================================
 * Construct one Huffman tree and assigns the code bit strings and lengths.
 * Update the total bit length for the current block.
 * IN assertion: the field freq is set for all tree elements.
 * OUT assertions: the fields len and code are set to the optimal bit length
 *     and corresponding code. The length opt_len is updated; static_len is
 *     also updated if stree is not null. The field max_code is set.
 */
function build_tree(s, desc)
//    deflate_state *s;
//    tree_desc *desc; /* the tree descriptor */
{
  var tree     = desc.dyn_tree;
  var stree    = desc.stat_desc.static_tree;
  var has_stree = desc.stat_desc.has_stree;
  var elems    = desc.stat_desc.elems;
  var n, m;          /* iterate over heap elements */
  var max_code = -1; /* largest code with non zero frequency */
  var node;          /* new node being created */

  /* Construct the initial heap, with least frequent element in
   * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
   * heap[0] is not used.
   */
  s.heap_len = 0;
  s.heap_max = HEAP_SIZE;

  for (n = 0; n < elems; n++) {
    if (tree[n * 2]/*.Freq*/ !== 0) {
      s.heap[++s.heap_len] = max_code = n;
      s.depth[n] = 0;

    } else {
      tree[n * 2 + 1]/*.Len*/ = 0;
    }
  }

  /* The pkzip format requires that at least one distance code exists,
   * and that at least one bit should be sent even if there is only one
   * possible code. So to avoid special checks later on we force at least
   * two codes of non zero frequency.
   */
  while (s.heap_len < 2) {
    node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
    tree[node * 2]/*.Freq*/ = 1;
    s.depth[node] = 0;
    s.opt_len--;

    if (has_stree) {
      s.static_len -= stree[node * 2 + 1]/*.Len*/;
    }
    /* node is 0 or 1 so it does not have extra bits */
  }
  desc.max_code = max_code;

  /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
   * establish sub-heaps of increasing lengths:
   */
  for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }

  /* Construct the Huffman tree by repeatedly combining the least two
   * frequent nodes.
   */
  node = elems;              /* next internal node of the tree */
  do {
    //pqremove(s, tree, n);  /* n = node of least frequency */
    /*** pqremove ***/
    n = s.heap[1/*SMALLEST*/];
    s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
    pqdownheap(s, tree, 1/*SMALLEST*/);
    /***/

    m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */

    s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
    s.heap[--s.heap_max] = m;

    /* Create a new node father of n and m */
    tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
    s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
    tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;

    /* and insert the new node in the heap */
    s.heap[1/*SMALLEST*/] = node++;
    pqdownheap(s, tree, 1/*SMALLEST*/);

  } while (s.heap_len >= 2);

  s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];

  /* At this point, the fields freq and dad are set. We can now
   * generate the bit lengths.
   */
  gen_bitlen(s, desc);

  /* The field len is now set, we can generate the bit codes */
  gen_codes(tree, max_code, s.bl_count);
}


/* ===========================================================================
 * Scan a literal or distance tree to determine the frequencies of the codes
 * in the bit length tree.
 */
function scan_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree;   /* the tree to be scanned */
//    int max_code;    /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }
  tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      s.bl_tree[curlen * 2]/*.Freq*/ += count;

    } else if (curlen !== 0) {

      if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
      s.bl_tree[REP_3_6 * 2]/*.Freq*/++;

    } else if (count <= 10) {
      s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;

    } else {
      s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
    }

    count = 0;
    prevlen = curlen;

    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Send a literal or distance tree in compressed form, using the codes in
 * bl_tree.
 */
function send_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree; /* the tree to be scanned */
//    int max_code;       /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  /* tree[max_code+1].Len = -1; */  /* guard already set */
  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);

    } else if (curlen !== 0) {
      if (curlen !== prevlen) {
        send_code(s, curlen, s.bl_tree);
        count--;
      }
      //Assert(count >= 3 && count <= 6, " 3_6?");
      send_code(s, REP_3_6, s.bl_tree);
      send_bits(s, count - 3, 2);

    } else if (count <= 10) {
      send_code(s, REPZ_3_10, s.bl_tree);
      send_bits(s, count - 3, 3);

    } else {
      send_code(s, REPZ_11_138, s.bl_tree);
      send_bits(s, count - 11, 7);
    }

    count = 0;
    prevlen = curlen;
    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Construct the Huffman tree for the bit lengths and return the index in
 * bl_order of the last bit length code to send.
 */
function build_bl_tree(s) {
  var max_blindex;  /* index of last bit length code of non zero freq */

  /* Determine the bit length frequencies for literal and distance trees */
  scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  scan_tree(s, s.dyn_dtree, s.d_desc.max_code);

  /* Build the bit length tree: */
  build_tree(s, s.bl_desc);
  /* opt_len now includes the length of the tree representations, except
   * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
   */

  /* Determine the number of bit length codes to send. The pkzip format
   * requires that at least 4 bit length codes be sent. (appnote.txt says
   * 3 but the actual value used is 4.)
   */
  for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
    if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
      break;
    }
  }
  /* Update opt_len to include the bit length tree and counts */
  s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
  //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  //        s->opt_len, s->static_len));

  return max_blindex;
}


/* ===========================================================================
 * Send the header for a block using dynamic Huffman trees: the counts, the
 * lengths of the bit length codes, the literal tree and the distance tree.
 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
 */
function send_all_trees(s, lcodes, dcodes, blcodes)
//    deflate_state *s;
//    int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
  var rank;                    /* index in bl_order */

  //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  //        "too many codes");
  //Tracev((stderr, "\nbl counts: "));
  send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
  send_bits(s, dcodes - 1,   5);
  send_bits(s, blcodes - 4,  4); /* not -3 as stated in appnote.txt */
  for (rank = 0; rank < blcodes; rank++) {
    //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
    send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
  }
  //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
  //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
  //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}


/* ===========================================================================
 * Check if the data type is TEXT or BINARY, using the following algorithm:
 * - TEXT if the two conditions below are satisfied:
 *    a) There are no non-portable control characters belonging to the
 *       "black list" (0..6, 14..25, 28..31).
 *    b) There is at least one printable character belonging to the
 *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
 * - BINARY otherwise.
 * - The following partially-portable control characters form a
 *   "gray list" that is ignored in this detection algorithm:
 *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
 * IN assertion: the fields Freq of dyn_ltree are set.
 */
function detect_data_type(s) {
  /* black_mask is the bit mask of black-listed bytes
   * set bits 0..6, 14..25, and 28..31
   * 0xf3ffc07f = binary 11110011111111111100000001111111
   */
  var black_mask = 0xf3ffc07f;
  var n;

  /* Check for non-textual ("black-listed") bytes. */
  for (n = 0; n <= 31; n++, black_mask >>>= 1) {
    if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
      return Z_BINARY;
    }
  }

  /* Check for textual ("white-listed") bytes. */
  if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
      s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
    return Z_TEXT;
  }
  for (n = 32; n < LITERALS; n++) {
    if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
      return Z_TEXT;
    }
  }

  /* There are no "black-listed" or "white-listed" bytes:
   * this stream either is empty or has tolerated ("gray-listed") bytes only.
   */
  return Z_BINARY;
}


var static_init_done = false;

/* ===========================================================================
 * Initialize the tree data structures for a new zlib stream.
 */
function _tr_init(s)
{

  if (!static_init_done) {
    tr_static_init();
    static_init_done = true;
  }

  s.l_desc  = new TreeDesc(s.dyn_ltree, static_l_desc);
  s.d_desc  = new TreeDesc(s.dyn_dtree, static_d_desc);
  s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);

  s.bi_buf = 0;
  s.bi_valid = 0;

  /* Initialize the first block of the first file: */
  init_block(s);
}


/* ===========================================================================
 * Send a stored block
 */
function _tr_stored_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */
  copy_block(s, buf, stored_len, true); /* with header */
}


/* ===========================================================================
 * Send one empty static block to give enough lookahead for inflate.
 * This takes 10 bits, of which 7 may remain in the bit buffer.
 */
function _tr_align(s) {
  send_bits(s, STATIC_TREES << 1, 3);
  send_code(s, END_BLOCK, static_ltree);
  bi_flush(s);
}


/* ===========================================================================
 * Determine the best encoding for the current block: dynamic trees, static
 * trees or store, and output the encoded block to the zip file.
 */
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block, or NULL if too old */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  var opt_lenb, static_lenb;  /* opt_len and static_len in bytes */
  var max_blindex = 0;        /* index of last bit length code of non zero freq */

  /* Build the Huffman trees unless a stored block is forced */
  if (s.level > 0) {

    /* Check if the file is binary or text */
    if (s.strm.data_type === Z_UNKNOWN) {
      s.strm.data_type = detect_data_type(s);
    }

    /* Construct the literal and distance trees */
    build_tree(s, s.l_desc);
    // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));

    build_tree(s, s.d_desc);
    // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));
    /* At this point, opt_len and static_len are the total bit lengths of
     * the compressed block data, excluding the tree representations.
     */

    /* Build the bit length tree for the above two trees, and get the index
     * in bl_order of the last bit length code to send.
     */
    max_blindex = build_bl_tree(s);

    /* Determine the best encoding. Compute the block lengths in bytes. */
    opt_lenb = (s.opt_len + 3 + 7) >>> 3;
    static_lenb = (s.static_len + 3 + 7) >>> 3;

    // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
    //        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
    //        s->last_lit));

    if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }

  } else {
    // Assert(buf != (char*)0, "lost buf");
    opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
  }

  if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
    /* 4: two words for the lengths */

    /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
     * Otherwise we can't have processed more than WSIZE input bytes since
     * the last block flush, because compression would have been
     * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
     * transform a block into a stored block.
     */
    _tr_stored_block(s, buf, stored_len, last);

  } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {

    send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
    compress_block(s, static_ltree, static_dtree);

  } else {
    send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
    send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
    compress_block(s, s.dyn_ltree, s.dyn_dtree);
  }
  // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
  /* The above check is made mod 2^32, for files larger than 512 MB
   * and uLong implemented on 32 bits.
   */
  init_block(s);

  if (last) {
    bi_windup(s);
  }
  // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
  //       s->compressed_len-7*last));
}

/* ===========================================================================
 * Save the match info and tally the frequency counts. Return true if
 * the current block must be flushed.
 */
function _tr_tally(s, dist, lc)
//    deflate_state *s;
//    unsigned dist;  /* distance of matched string */
//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
  //var out_length, in_length, dcode;

  s.pending_buf[s.d_buf + s.last_lit * 2]     = (dist >>> 8) & 0xff;
  s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;

  s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
  s.last_lit++;

  if (dist === 0) {
    /* lc is the unmatched char */
    s.dyn_ltree[lc * 2]/*.Freq*/++;
  } else {
    s.matches++;
    /* Here, lc is the match length - MIN_MATCH */
    dist--;             /* dist = match distance - 1 */
    //Assert((ush)dist < (ush)MAX_DIST(s) &&
    //       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
    //       (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");

    s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
    s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
  }

// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility

//#ifdef TRUNCATE_BLOCK
//  /* Try to guess if it is profitable to stop the current block here */
//  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
//    /* Compute an upper bound for the compressed length */
//    out_length = s.last_lit*8;
//    in_length = s.strstart - s.block_start;
//
//    for (dcode = 0; dcode < D_CODES; dcode++) {
//      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
//    }
//    out_length >>>= 3;
//    //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
//    //       s->last_lit, in_length, out_length,
//    //       100L - out_length*100L/in_length));
//    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
//      return true;
//    }
//  }
//#endif

  return (s.last_lit === s.lit_bufsize - 1);
  /* We avoid equality with lit_bufsize because of wraparound at 64K
   * on 16 bit machines and because stored blocks are restricted to
   * 64K-1 bytes.
   */
}

exports._tr_init  = _tr_init;
exports._tr_stored_block = _tr_stored_block;
exports._tr_flush_block  = _tr_flush_block;
exports._tr_tally = _tr_tally;
exports._tr_align = _tr_align;

},{"../utils/common":1}],8:[function(require,module,exports){
'use strict';


function ZStream() {
  /* next input byte */
  this.input = null; // JS specific, because we have no pointers
  this.next_in = 0;
  /* number of bytes available at input */
  this.avail_in = 0;
  /* total number of input bytes read so far */
  this.total_in = 0;
  /* next output byte should be put there */
  this.output = null; // JS specific, because we have no pointers
  this.next_out = 0;
  /* remaining free space at output */
  this.avail_out = 0;
  /* total number of bytes output so far */
  this.total_out = 0;
  /* last error message, NULL if no error */
  this.msg = ''/*Z_NULL*/;
  /* not visible by applications */
  this.state = null;
  /* best guess about the data type: binary or text */
  this.data_type = 2/*Z_UNKNOWN*/;
  /* adler32 value of the uncompressed data */
  this.adler = 0;
}

module.exports = ZStream;

},{}],"/lib/deflate.js":[function(require,module,exports){
'use strict';


var zlib_deflate = require('./zlib/deflate');
var utils        = require('./utils/common');
var strings      = require('./utils/strings');
var msg          = require('./zlib/messages');
var ZStream      = require('./zlib/zstream');

var toString = Object.prototype.toString;

/* Public constants ==========================================================*/
/* ===========================================================================*/

var Z_NO_FLUSH      = 0;
var Z_FINISH        = 4;

var Z_OK            = 0;
var Z_STREAM_END    = 1;
var Z_SYNC_FLUSH    = 2;

var Z_DEFAULT_COMPRESSION = -1;

var Z_DEFAULT_STRATEGY    = 0;

var Z_DEFLATED  = 8;

/* ===========================================================================*/


/**
 * class Deflate
 *
 * Generic JS-style wrapper for zlib calls. If you don't need
 * streaming behaviour - use more simple functions: [[deflate]],
 * [[deflateRaw]] and [[gzip]].
 **/

/* internal
 * Deflate.chunks -> Array
 *
 * Chunks of output data, if [[Deflate#onData]] not overriden.
 **/

/**
 * Deflate.result -> Uint8Array|Array
 *
 * Compressed result, generated by default [[Deflate#onData]]
 * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
 * (call [[Deflate#push]] with `Z_FINISH` / `true` param)  or if you
 * push a chunk with explicit flush (call [[Deflate#push]] with
 * `Z_SYNC_FLUSH` param).
 **/

/**
 * Deflate.err -> Number
 *
 * Error code after deflate finished. 0 (Z_OK) on success.
 * You will not need it in real life, because deflate errors
 * are possible only on wrong options or bad `onData` / `onEnd`
 * custom handlers.
 **/

/**
 * Deflate.msg -> String
 *
 * Error message, if [[Deflate.err]] != 0
 **/


/**
 * new Deflate(options)
 * - options (Object): zlib deflate options.
 *
 * Creates new deflator instance with specified params. Throws exception
 * on bad params. Supported options:
 *
 * - `level`
 * - `windowBits`
 * - `memLevel`
 * - `strategy`
 * - `dictionary`
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Additional options, for internal needs:
 *
 * - `chunkSize` - size of generated data chunks (16K by default)
 * - `raw` (Boolean) - do raw deflate
 * - `gzip` (Boolean) - create gzip wrapper
 * - `to` (String) - if equal to 'string', then result will be "binary string"
 *    (each char code [0..255])
 * - `header` (Object) - custom header for gzip
 *   - `text` (Boolean) - true if compressed data believed to be text
 *   - `time` (Number) - modification time, unix timestamp
 *   - `os` (Number) - operation system code
 *   - `extra` (Array) - array of bytes with extra data (max 65536)
 *   - `name` (String) - file name (binary string)
 *   - `comment` (String) - comment (binary string)
 *   - `hcrc` (Boolean) - true if header crc should be added
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
 *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
 *
 * var deflate = new pako.Deflate({ level: 3});
 *
 * deflate.push(chunk1, false);
 * deflate.push(chunk2, true);  // true -> last chunk
 *
 * if (deflate.err) { throw new Error(deflate.err); }
 *
 * console.log(deflate.result);
 * ```
 **/
function Deflate(options) {
  if (!(this instanceof Deflate)) return new Deflate(options);

  this.options = utils.assign({
    level: Z_DEFAULT_COMPRESSION,
    method: Z_DEFLATED,
    chunkSize: 16384,
    windowBits: 15,
    memLevel: 8,
    strategy: Z_DEFAULT_STRATEGY,
    to: ''
  }, options || {});

  var opt = this.options;

  if (opt.raw && (opt.windowBits > 0)) {
    opt.windowBits = -opt.windowBits;
  }

  else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
    opt.windowBits += 16;
  }

  this.err    = 0;      // error code, if happens (0 = Z_OK)
  this.msg    = '';     // error message
  this.ended  = false;  // used to avoid multiple onEnd() calls
  this.chunks = [];     // chunks of compressed data

  this.strm = new ZStream();
  this.strm.avail_out = 0;

  var status = zlib_deflate.deflateInit2(
    this.strm,
    opt.level,
    opt.method,
    opt.windowBits,
    opt.memLevel,
    opt.strategy
  );

  if (status !== Z_OK) {
    throw new Error(msg[status]);
  }

  if (opt.header) {
    zlib_deflate.deflateSetHeader(this.strm, opt.header);
  }

  if (opt.dictionary) {
    var dict;
    // Convert data if needed
    if (typeof opt.dictionary === 'string') {
      // If we need to compress text, change encoding to utf8.
      dict = strings.string2buf(opt.dictionary);
    } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
      dict = new Uint8Array(opt.dictionary);
    } else {
      dict = opt.dictionary;
    }

    status = zlib_deflate.deflateSetDictionary(this.strm, dict);

    if (status !== Z_OK) {
      throw new Error(msg[status]);
    }

    this._dict_set = true;
  }
}

/**
 * Deflate#push(data[, mode]) -> Boolean
 * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
 *   converted to utf8 byte sequence.
 * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
 *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
 *
 * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
 * new compressed chunks. Returns `true` on success. The last data block must have
 * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
 * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
 * can use mode Z_SYNC_FLUSH, keeping the compression context.
 *
 * On fail call [[Deflate#onEnd]] with error code and return false.
 *
 * We strongly recommend to use `Uint8Array` on input for best speed (output
 * array format is detected automatically). Also, don't skip last param and always
 * use the same type in your code (boolean or number). That will improve JS speed.
 *
 * For regular `Array`-s make sure all elements are [0..255].
 *
 * ##### Example
 *
 * ```javascript
 * push(chunk, false); // push one of data chunks
 * ...
 * push(chunk, true);  // push last chunk
 * ```
 **/
Deflate.prototype.push = function (data, mode) {
  var strm = this.strm;
  var chunkSize = this.options.chunkSize;
  var status, _mode;

  if (this.ended) { return false; }

  _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);

  // Convert data if needed
  if (typeof data === 'string') {
    // If we need to compress text, change encoding to utf8.
    strm.input = strings.string2buf(data);
  } else if (toString.call(data) === '[object ArrayBuffer]') {
    strm.input = new Uint8Array(data);
  } else {
    strm.input = data;
  }

  strm.next_in = 0;
  strm.avail_in = strm.input.length;

  do {
    if (strm.avail_out === 0) {
      strm.output = new utils.Buf8(chunkSize);
      strm.next_out = 0;
      strm.avail_out = chunkSize;
    }
    status = zlib_deflate.deflate(strm, _mode);    /* no bad return value */

    if (status !== Z_STREAM_END && status !== Z_OK) {
      this.onEnd(status);
      this.ended = true;
      return false;
    }
    if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
      if (this.options.to === 'string') {
        this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
      } else {
        this.onData(utils.shrinkBuf(strm.output, strm.next_out));
      }
    }
  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);

  // Finalize on the last chunk.
  if (_mode === Z_FINISH) {
    status = zlib_deflate.deflateEnd(this.strm);
    this.onEnd(status);
    this.ended = true;
    return status === Z_OK;
  }

  // callback interim results if Z_SYNC_FLUSH.
  if (_mode === Z_SYNC_FLUSH) {
    this.onEnd(Z_OK);
    strm.avail_out = 0;
    return true;
  }

  return true;
};


/**
 * Deflate#onData(chunk) -> Void
 * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
 *   on js engine support. When string output requested, each chunk
 *   will be string.
 *
 * By default, stores data blocks in `chunks[]` property and glue
 * those in `onEnd`. Override this handler, if you need another behaviour.
 **/
Deflate.prototype.onData = function (chunk) {
  this.chunks.push(chunk);
};


/**
 * Deflate#onEnd(status) -> Void
 * - status (Number): deflate status. 0 (Z_OK) on success,
 *   other if not.
 *
 * Called once after you tell deflate that the input stream is
 * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
 * or if an error happened. By default - join collected chunks,
 * free memory and fill `results` / `err` properties.
 **/
Deflate.prototype.onEnd = function (status) {
  // On success - join
  if (status === Z_OK) {
    if (this.options.to === 'string') {
      this.result = this.chunks.join('');
    } else {
      this.result = utils.flattenChunks(this.chunks);
    }
  }
  this.chunks = [];
  this.err = status;
  this.msg = this.strm.msg;
};


/**
 * deflate(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * Compress `data` with deflate algorithm and `options`.
 *
 * Supported options are:
 *
 * - level
 * - windowBits
 * - memLevel
 * - strategy
 * - dictionary
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Sugar (options):
 *
 * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
 *   negative windowBits implicitly.
 * - `to` (String) - if equal to 'string', then result will be "binary string"
 *    (each char code [0..255])
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
 *
 * console.log(pako.deflate(data));
 * ```
 **/
function deflate(input, options) {
  var deflator = new Deflate(options);

  deflator.push(input, true);

  // That will never happens, if you don't cheat with options :)
  if (deflator.err) { throw deflator.msg; }

  return deflator.result;
}


/**
 * deflateRaw(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * The same as [[deflate]], but creates raw data, without wrapper
 * (header and adler32 crc).
 **/
function deflateRaw(input, options) {
  options = options || {};
  options.raw = true;
  return deflate(input, options);
}


/**
 * gzip(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * The same as [[deflate]], but create gzip wrapper instead of
 * deflate one.
 **/
function gzip(input, options) {
  options = options || {};
  options.gzip = true;
  return deflate(input, options);
}


exports.Deflate = Deflate;
exports.deflate = deflate;
exports.deflateRaw = deflateRaw;
exports.gzip = gzip;

},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")
});

/***/ }),
/* 807 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.



// If obj.hasOwnProperty has been overridden, then calling
// obj.hasOwnProperty(prop) will break.
// See: https://github.com/joyent/node/issues/1707
function hasOwnProperty(obj, prop) {
  return Object.prototype.hasOwnProperty.call(obj, prop);
}

module.exports = function(qs, sep, eq, options) {
  sep = sep || '&';
  eq = eq || '=';
  var obj = {};

  if (typeof qs !== 'string' || qs.length === 0) {
    return obj;
  }

  var regexp = /\+/g;
  qs = qs.split(sep);

  var maxKeys = 1000;
  if (options && typeof options.maxKeys === 'number') {
    maxKeys = options.maxKeys;
  }

  var len = qs.length;
  // maxKeys <= 0 means that we should not limit keys count
  if (maxKeys > 0 && len > maxKeys) {
    len = maxKeys;
  }

  for (var i = 0; i < len; ++i) {
    var x = qs[i].replace(regexp, '%20'),
        idx = x.indexOf(eq),
        kstr, vstr, k, v;

    if (idx >= 0) {
      kstr = x.substr(0, idx);
      vstr = x.substr(idx + 1);
    } else {
      kstr = x;
      vstr = '';
    }

    k = decodeURIComponent(kstr);
    v = decodeURIComponent(vstr);

    if (!hasOwnProperty(obj, k)) {
      obj[k] = v;
    } else if (isArray(obj[k])) {
      obj[k].push(v);
    } else {
      obj[k] = [obj[k], v];
    }
  }

  return obj;
};

var isArray = Array.isArray || function (xs) {
  return Object.prototype.toString.call(xs) === '[object Array]';
};


/***/ }),
/* 808 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.



var stringifyPrimitive = function(v) {
  switch (typeof v) {
    case 'string':
      return v;

    case 'boolean':
      return v ? 'true' : 'false';

    case 'number':
      return isFinite(v) ? v : '';

    default:
      return '';
  }
};

module.exports = function(obj, sep, eq, name) {
  sep = sep || '&';
  eq = eq || '=';
  if (obj === null) {
    obj = undefined;
  }

  if (typeof obj === 'object') {
    return map(objectKeys(obj), function(k) {
      var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
      if (isArray(obj[k])) {
        return map(obj[k], function(v) {
          return ks + encodeURIComponent(stringifyPrimitive(v));
        }).join(sep);
      } else {
        return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
      }
    }).join(sep);

  }

  if (!name) return '';
  return encodeURIComponent(stringifyPrimitive(name)) + eq +
         encodeURIComponent(stringifyPrimitive(obj));
};

var isArray = Array.isArray || function (xs) {
  return Object.prototype.toString.call(xs) === '[object Array]';
};

function map (xs, f) {
  if (xs.map) return xs.map(f);
  var res = [];
  for (var i = 0; i < xs.length; i++) {
    res.push(f(xs[i], i));
  }
  return res;
}

var objectKeys = Object.keys || function (obj) {
  var res = [];
  for (var key in obj) {
    if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
  }
  return res;
};


/***/ }),
/* 809 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


exports.decode = exports.parse = __webpack_require__(807);
exports.encode = exports.stringify = __webpack_require__(808);


/***/ }),
/* 810 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(process, global) {/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var Reflect;
(function (Reflect) {
    "use strict";
    var hasOwn = Object.prototype.hasOwnProperty;
    // feature test for Symbol support
    var supportsSymbol = typeof Symbol === "function";
    var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
    var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
    var HashMap;
    (function (HashMap) {
        var supportsCreate = typeof Object.create === "function"; // feature test for Object.create support
        var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support
        var downLevel = !supportsCreate && !supportsProto;
        // create an object in dictionary mode (a.k.a. "slow" mode in v8)
        HashMap.create = supportsCreate
            ? function () { return MakeDictionary(Object.create(null)); }
            : supportsProto
                ? function () { return MakeDictionary({ __proto__: null }); }
                : function () { return MakeDictionary({}); };
        HashMap.has = downLevel
            ? function (map, key) { return hasOwn.call(map, key); }
            : function (map, key) { return key in map; };
        HashMap.get = downLevel
            ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }
            : function (map, key) { return map[key]; };
    })(HashMap || (HashMap = {}));
    // Load global or shim versions of Map, Set, and WeakMap
    var functionPrototype = Object.getPrototypeOf(Function);
    var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
    var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
    var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
    var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
    // [[Metadata]] internal slot
    // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots
    var Metadata = new _WeakMap();
    /**
      * Applies a set of decorators to a property of a target object.
      * @param decorators An array of decorators.
      * @param target The target object.
      * @param propertyKey (Optional) The property key to decorate.
      * @param attributes (Optional) The property descriptor for the target key.
      * @remarks Decorators are applied in reverse order.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     Example = Reflect.decorate(decoratorsArray, Example);
      *
      *     // property (on constructor)
      *     Reflect.decorate(decoratorsArray, Example, "staticProperty");
      *
      *     // property (on prototype)
      *     Reflect.decorate(decoratorsArray, Example.prototype, "property");
      *
      *     // method (on constructor)
      *     Object.defineProperty(Example, "staticMethod",
      *         Reflect.decorate(decoratorsArray, Example, "staticMethod",
      *             Object.getOwnPropertyDescriptor(Example, "staticMethod")));
      *
      *     // method (on prototype)
      *     Object.defineProperty(Example.prototype, "method",
      *         Reflect.decorate(decoratorsArray, Example.prototype, "method",
      *             Object.getOwnPropertyDescriptor(Example.prototype, "method")));
      *
      */
    function decorate(decorators, target, propertyKey, attributes) {
        if (!IsUndefined(propertyKey)) {
            if (!IsArray(decorators))
                throw new TypeError();
            if (!IsObject(target))
                throw new TypeError();
            if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
                throw new TypeError();
            if (IsNull(attributes))
                attributes = undefined;
            propertyKey = ToPropertyKey(propertyKey);
            return DecorateProperty(decorators, target, propertyKey, attributes);
        }
        else {
            if (!IsArray(decorators))
                throw new TypeError();
            if (!IsConstructor(target))
                throw new TypeError();
            return DecorateConstructor(decorators, target);
        }
    }
    Reflect.decorate = decorate;
    // 4.1.2 Reflect.metadata(metadataKey, metadataValue)
    // https://rbuckton.github.io/reflect-metadata/#reflect.metadata
    /**
      * A default metadata decorator factory that can be used on a class, class member, or parameter.
      * @param metadataKey The key for the metadata entry.
      * @param metadataValue The value for the metadata entry.
      * @returns A decorator function.
      * @remarks
      * If `metadataKey` is already defined for the target and target key, the
      * metadataValue for that key will be overwritten.
      * @example
      *
      *     // constructor
      *     @Reflect.metadata(key, value)
      *     class Example {
      *     }
      *
      *     // property (on constructor, TypeScript only)
      *     class Example {
      *         @Reflect.metadata(key, value)
      *         static staticProperty;
      *     }
      *
      *     // property (on prototype, TypeScript only)
      *     class Example {
      *         @Reflect.metadata(key, value)
      *         property;
      *     }
      *
      *     // method (on constructor)
      *     class Example {
      *         @Reflect.metadata(key, value)
      *         static staticMethod() { }
      *     }
      *
      *     // method (on prototype)
      *     class Example {
      *         @Reflect.metadata(key, value)
      *         method() { }
      *     }
      *
      */
    function metadata(metadataKey, metadataValue) {
        function decorator(target, propertyKey) {
            if (!IsObject(target))
                throw new TypeError();
            if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
                throw new TypeError();
            OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
        }
        return decorator;
    }
    Reflect.metadata = metadata;
    /**
      * Define a unique metadata entry on the target.
      * @param metadataKey A key used to store and retrieve metadata.
      * @param metadataValue A value that contains attached metadata.
      * @param target The target object on which to define metadata.
      * @param propertyKey (Optional) The property key for the target.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     Reflect.defineMetadata("custom:annotation", options, Example);
      *
      *     // property (on constructor)
      *     Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty");
      *
      *     // property (on prototype)
      *     Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property");
      *
      *     // method (on constructor)
      *     Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod");
      *
      *     // method (on prototype)
      *     Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method");
      *
      *     // decorator factory as metadata-producing annotation.
      *     function MyAnnotation(options): Decorator {
      *         return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key);
      *     }
      *
      */
    function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
    }
    Reflect.defineMetadata = defineMetadata;
    /**
      * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
      * @param metadataKey A key used to store and retrieve metadata.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.hasMetadata("custom:annotation", Example);
      *
      *     // property (on constructor)
      *     result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
      *
      */
    function hasMetadata(metadataKey, target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryHasMetadata(metadataKey, target, propertyKey);
    }
    Reflect.hasMetadata = hasMetadata;
    /**
      * Gets a value indicating whether the target object has the provided metadata key defined.
      * @param metadataKey A key used to store and retrieve metadata.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.hasOwnMetadata("custom:annotation", Example);
      *
      *     // property (on constructor)
      *     result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
      *
      */
    function hasOwnMetadata(metadataKey, target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
    }
    Reflect.hasOwnMetadata = hasOwnMetadata;
    /**
      * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
      * @param metadataKey A key used to store and retrieve metadata.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.getMetadata("custom:annotation", Example);
      *
      *     // property (on constructor)
      *     result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
      *
      */
    function getMetadata(metadataKey, target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryGetMetadata(metadataKey, target, propertyKey);
    }
    Reflect.getMetadata = getMetadata;
    /**
      * Gets the metadata value for the provided metadata key on the target object.
      * @param metadataKey A key used to store and retrieve metadata.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.getOwnMetadata("custom:annotation", Example);
      *
      *     // property (on constructor)
      *     result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
      *
      */
    function getOwnMetadata(metadataKey, target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
    }
    Reflect.getOwnMetadata = getOwnMetadata;
    /**
      * Gets the metadata keys defined on the target object or its prototype chain.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns An array of unique metadata keys.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.getMetadataKeys(Example);
      *
      *     // property (on constructor)
      *     result = Reflect.getMetadataKeys(Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.getMetadataKeys(Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.getMetadataKeys(Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.getMetadataKeys(Example.prototype, "method");
      *
      */
    function getMetadataKeys(target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryMetadataKeys(target, propertyKey);
    }
    Reflect.getMetadataKeys = getMetadataKeys;
    /**
      * Gets the unique metadata keys defined on the target object.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns An array of unique metadata keys.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.getOwnMetadataKeys(Example);
      *
      *     // property (on constructor)
      *     result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
      *
      */
    function getOwnMetadataKeys(target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        return OrdinaryOwnMetadataKeys(target, propertyKey);
    }
    Reflect.getOwnMetadataKeys = getOwnMetadataKeys;
    /**
      * Deletes the metadata entry from the target object with the provided key.
      * @param metadataKey A key used to store and retrieve metadata.
      * @param target The target object on which the metadata is defined.
      * @param propertyKey (Optional) The property key for the target.
      * @returns `true` if the metadata entry was found and deleted; otherwise, false.
      * @example
      *
      *     class Example {
      *         // property declarations are not part of ES6, though they are valid in TypeScript:
      *         // static staticProperty;
      *         // property;
      *
      *         constructor(p) { }
      *         static staticMethod(p) { }
      *         method(p) { }
      *     }
      *
      *     // constructor
      *     result = Reflect.deleteMetadata("custom:annotation", Example);
      *
      *     // property (on constructor)
      *     result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
      *
      *     // property (on prototype)
      *     result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
      *
      *     // method (on constructor)
      *     result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
      *
      *     // method (on prototype)
      *     result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
      *
      */
    function deleteMetadata(metadataKey, target, propertyKey) {
        if (!IsObject(target))
            throw new TypeError();
        if (!IsUndefined(propertyKey))
            propertyKey = ToPropertyKey(propertyKey);
        var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false);
        if (IsUndefined(metadataMap))
            return false;
        if (!metadataMap.delete(metadataKey))
            return false;
        if (metadataMap.size > 0)
            return true;
        var targetMetadata = Metadata.get(target);
        targetMetadata.delete(propertyKey);
        if (targetMetadata.size > 0)
            return true;
        Metadata.delete(target);
        return true;
    }
    Reflect.deleteMetadata = deleteMetadata;
    function DecorateConstructor(decorators, target) {
        for (var i = decorators.length - 1; i >= 0; --i) {
            var decorator = decorators[i];
            var decorated = decorator(target);
            if (!IsUndefined(decorated) && !IsNull(decorated)) {
                if (!IsConstructor(decorated))
                    throw new TypeError();
                target = decorated;
            }
        }
        return target;
    }
    function DecorateProperty(decorators, target, propertyKey, descriptor) {
        for (var i = decorators.length - 1; i >= 0; --i) {
            var decorator = decorators[i];
            var decorated = decorator(target, propertyKey, descriptor);
            if (!IsUndefined(decorated) && !IsNull(decorated)) {
                if (!IsObject(decorated))
                    throw new TypeError();
                descriptor = decorated;
            }
        }
        return descriptor;
    }
    function GetOrCreateMetadataMap(O, P, Create) {
        var targetMetadata = Metadata.get(O);
        if (IsUndefined(targetMetadata)) {
            if (!Create)
                return undefined;
            targetMetadata = new _Map();
            Metadata.set(O, targetMetadata);
        }
        var metadataMap = targetMetadata.get(P);
        if (IsUndefined(metadataMap)) {
            if (!Create)
                return undefined;
            metadataMap = new _Map();
            targetMetadata.set(P, metadataMap);
        }
        return metadataMap;
    }
    // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata
    function OrdinaryHasMetadata(MetadataKey, O, P) {
        var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
        if (hasOwn)
            return true;
        var parent = OrdinaryGetPrototypeOf(O);
        if (!IsNull(parent))
            return OrdinaryHasMetadata(MetadataKey, parent, P);
        return false;
    }
    // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata
    function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
        if (IsUndefined(metadataMap))
            return false;
        return ToBoolean(metadataMap.has(MetadataKey));
    }
    // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata
    function OrdinaryGetMetadata(MetadataKey, O, P) {
        var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
        if (hasOwn)
            return OrdinaryGetOwnMetadata(MetadataKey, O, P);
        var parent = OrdinaryGetPrototypeOf(O);
        if (!IsNull(parent))
            return OrdinaryGetMetadata(MetadataKey, parent, P);
        return undefined;
    }
    // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata
    function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
        if (IsUndefined(metadataMap))
            return undefined;
        return metadataMap.get(MetadataKey);
    }
    // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata
    function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);
        metadataMap.set(MetadataKey, MetadataValue);
    }
    // 3.1.6.1 OrdinaryMetadataKeys(O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys
    function OrdinaryMetadataKeys(O, P) {
        var ownKeys = OrdinaryOwnMetadataKeys(O, P);
        var parent = OrdinaryGetPrototypeOf(O);
        if (parent === null)
            return ownKeys;
        var parentKeys = OrdinaryMetadataKeys(parent, P);
        if (parentKeys.length <= 0)
            return ownKeys;
        if (ownKeys.length <= 0)
            return parentKeys;
        var set = new _Set();
        var keys = [];
        for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
            var key = ownKeys_1[_i];
            var hasKey = set.has(key);
            if (!hasKey) {
                set.add(key);
                keys.push(key);
            }
        }
        for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
            var key = parentKeys_1[_a];
            var hasKey = set.has(key);
            if (!hasKey) {
                set.add(key);
                keys.push(key);
            }
        }
        return keys;
    }
    // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)
    // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys
    function OrdinaryOwnMetadataKeys(O, P) {
        var keys = [];
        var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
        if (IsUndefined(metadataMap))
            return keys;
        var keysObj = metadataMap.keys();
        var iterator = GetIterator(keysObj);
        var k = 0;
        while (true) {
            var next = IteratorStep(iterator);
            if (!next) {
                keys.length = k;
                return keys;
            }
            var nextValue = IteratorValue(next);
            try {
                keys[k] = nextValue;
            }
            catch (e) {
                try {
                    IteratorClose(iterator);
                }
                finally {
                    throw e;
                }
            }
            k++;
        }
    }
    // 6 ECMAScript Data Typ0es and Values
    // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values
    function Type(x) {
        if (x === null)
            return 1 /* Null */;
        switch (typeof x) {
            case "undefined": return 0 /* Undefined */;
            case "boolean": return 2 /* Boolean */;
            case "string": return 3 /* String */;
            case "symbol": return 4 /* Symbol */;
            case "number": return 5 /* Number */;
            case "object": return x === null ? 1 /* Null */ : 6 /* Object */;
            default: return 6 /* Object */;
        }
    }
    // 6.1.1 The Undefined Type
    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type
    function IsUndefined(x) {
        return x === undefined;
    }
    // 6.1.2 The Null Type
    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type
    function IsNull(x) {
        return x === null;
    }
    // 6.1.5 The Symbol Type
    // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type
    function IsSymbol(x) {
        return typeof x === "symbol";
    }
    // 6.1.7 The Object Type
    // https://tc39.github.io/ecma262/#sec-object-type
    function IsObject(x) {
        return typeof x === "object" ? x !== null : typeof x === "function";
    }
    // 7.1 Type Conversion
    // https://tc39.github.io/ecma262/#sec-type-conversion
    // 7.1.1 ToPrimitive(input [, PreferredType])
    // https://tc39.github.io/ecma262/#sec-toprimitive
    function ToPrimitive(input, PreferredType) {
        switch (Type(input)) {
            case 0 /* Undefined */: return input;
            case 1 /* Null */: return input;
            case 2 /* Boolean */: return input;
            case 3 /* String */: return input;
            case 4 /* Symbol */: return input;
            case 5 /* Number */: return input;
        }
        var hint = PreferredType === 3 /* String */ ? "string" : PreferredType === 5 /* Number */ ? "number" : "default";
        var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
        if (exoticToPrim !== undefined) {
            var result = exoticToPrim.call(input, hint);
            if (IsObject(result))
                throw new TypeError();
            return result;
        }
        return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
    }
    // 7.1.1.1 OrdinaryToPrimitive(O, hint)
    // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive
    function OrdinaryToPrimitive(O, hint) {
        if (hint === "string") {
            var toString_1 = O.toString;
            if (IsCallable(toString_1)) {
                var result = toString_1.call(O);
                if (!IsObject(result))
                    return result;
            }
            var valueOf = O.valueOf;
            if (IsCallable(valueOf)) {
                var result = valueOf.call(O);
                if (!IsObject(result))
                    return result;
            }
        }
        else {
            var valueOf = O.valueOf;
            if (IsCallable(valueOf)) {
                var result = valueOf.call(O);
                if (!IsObject(result))
                    return result;
            }
            var toString_2 = O.toString;
            if (IsCallable(toString_2)) {
                var result = toString_2.call(O);
                if (!IsObject(result))
                    return result;
            }
        }
        throw new TypeError();
    }
    // 7.1.2 ToBoolean(argument)
    // https://tc39.github.io/ecma262/2016/#sec-toboolean
    function ToBoolean(argument) {
        return !!argument;
    }
    // 7.1.12 ToString(argument)
    // https://tc39.github.io/ecma262/#sec-tostring
    function ToString(argument) {
        return "" + argument;
    }
    // 7.1.14 ToPropertyKey(argument)
    // https://tc39.github.io/ecma262/#sec-topropertykey
    function ToPropertyKey(argument) {
        var key = ToPrimitive(argument, 3 /* String */);
        if (IsSymbol(key))
            return key;
        return ToString(key);
    }
    // 7.2 Testing and Comparison Operations
    // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations
    // 7.2.2 IsArray(argument)
    // https://tc39.github.io/ecma262/#sec-isarray
    function IsArray(argument) {
        return Array.isArray
            ? Array.isArray(argument)
            : argument instanceof Object
                ? argument instanceof Array
                : Object.prototype.toString.call(argument) === "[object Array]";
    }
    // 7.2.3 IsCallable(argument)
    // https://tc39.github.io/ecma262/#sec-iscallable
    function IsCallable(argument) {
        // NOTE: This is an approximation as we cannot check for [[Call]] internal method.
        return typeof argument === "function";
    }
    // 7.2.4 IsConstructor(argument)
    // https://tc39.github.io/ecma262/#sec-isconstructor
    function IsConstructor(argument) {
        // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.
        return typeof argument === "function";
    }
    // 7.2.7 IsPropertyKey(argument)
    // https://tc39.github.io/ecma262/#sec-ispropertykey
    function IsPropertyKey(argument) {
        switch (Type(argument)) {
            case 3 /* String */: return true;
            case 4 /* Symbol */: return true;
            default: return false;
        }
    }
    // 7.3 Operations on Objects
    // https://tc39.github.io/ecma262/#sec-operations-on-objects
    // 7.3.9 GetMethod(V, P)
    // https://tc39.github.io/ecma262/#sec-getmethod
    function GetMethod(V, P) {
        var func = V[P];
        if (func === undefined || func === null)
            return undefined;
        if (!IsCallable(func))
            throw new TypeError();
        return func;
    }
    // 7.4 Operations on Iterator Objects
    // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects
    function GetIterator(obj) {
        var method = GetMethod(obj, iteratorSymbol);
        if (!IsCallable(method))
            throw new TypeError(); // from Call
        var iterator = method.call(obj);
        if (!IsObject(iterator))
            throw new TypeError();
        return iterator;
    }
    // 7.4.4 IteratorValue(iterResult)
    // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue
    function IteratorValue(iterResult) {
        return iterResult.value;
    }
    // 7.4.5 IteratorStep(iterator)
    // https://tc39.github.io/ecma262/#sec-iteratorstep
    function IteratorStep(iterator) {
        var result = iterator.next();
        return result.done ? false : result;
    }
    // 7.4.6 IteratorClose(iterator, completion)
    // https://tc39.github.io/ecma262/#sec-iteratorclose
    function IteratorClose(iterator) {
        var f = iterator["return"];
        if (f)
            f.call(iterator);
    }
    // 9.1 Ordinary Object Internal Methods and Internal Slots
    // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots
    // 9.1.1.1 OrdinaryGetPrototypeOf(O)
    // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof
    function OrdinaryGetPrototypeOf(O) {
        var proto = Object.getPrototypeOf(O);
        if (typeof O !== "function" || O === functionPrototype)
            return proto;
        // TypeScript doesn't set __proto__ in ES5, as it's non-standard.
        // Try to determine the superclass constructor. Compatible implementations
        // must either set __proto__ on a subclass constructor to the superclass constructor,
        // or ensure each class has a valid `constructor` property on its prototype that
        // points back to the constructor.
        // If this is not the same as Function.[[Prototype]], then this is definately inherited.
        // This is the case when in ES6 or when using __proto__ in a compatible browser.
        if (proto !== functionPrototype)
            return proto;
        // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.
        var prototype = O.prototype;
        var prototypeProto = prototype && Object.getPrototypeOf(prototype);
        if (prototypeProto == null || prototypeProto === Object.prototype)
            return proto;
        // If the constructor was not a function, then we cannot determine the heritage.
        var constructor = prototypeProto.constructor;
        if (typeof constructor !== "function")
            return proto;
        // If we have some kind of self-reference, then we cannot determine the heritage.
        if (constructor === O)
            return proto;
        // we have a pretty good guess at the heritage.
        return constructor;
    }
    // naive Map shim
    function CreateMapPolyfill() {
        var cacheSentinel = {};
        var arraySentinel = [];
        var MapIterator = (function () {
            function MapIterator(keys, values, selector) {
                this._index = 0;
                this._keys = keys;
                this._values = values;
                this._selector = selector;
            }
            MapIterator.prototype["@@iterator"] = function () { return this; };
            MapIterator.prototype[iteratorSymbol] = function () { return this; };
            MapIterator.prototype.next = function () {
                var index = this._index;
                if (index >= 0 && index < this._keys.length) {
                    var result = this._selector(this._keys[index], this._values[index]);
                    if (index + 1 >= this._keys.length) {
                        this._index = -1;
                        this._keys = arraySentinel;
                        this._values = arraySentinel;
                    }
                    else {
                        this._index++;
                    }
                    return { value: result, done: false };
                }
                return { value: undefined, done: true };
            };
            MapIterator.prototype.throw = function (error) {
                if (this._index >= 0) {
                    this._index = -1;
                    this._keys = arraySentinel;
                    this._values = arraySentinel;
                }
                throw error;
            };
            MapIterator.prototype.return = function (value) {
                if (this._index >= 0) {
                    this._index = -1;
                    this._keys = arraySentinel;
                    this._values = arraySentinel;
                }
                return { value: value, done: true };
            };
            return MapIterator;
        }());
        return (function () {
            function Map() {
                this._keys = [];
                this._values = [];
                this._cacheKey = cacheSentinel;
                this._cacheIndex = -2;
            }
            Object.defineProperty(Map.prototype, "size", {
                get: function () { return this._keys.length; },
                enumerable: true,
                configurable: true
            });
            Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };
            Map.prototype.get = function (key) {
                var index = this._find(key, /*insert*/ false);
                return index >= 0 ? this._values[index] : undefined;
            };
            Map.prototype.set = function (key, value) {
                var index = this._find(key, /*insert*/ true);
                this._values[index] = value;
                return this;
            };
            Map.prototype.delete = function (key) {
                var index = this._find(key, /*insert*/ false);
                if (index >= 0) {
                    var size = this._keys.length;
                    for (var i = index + 1; i < size; i++) {
                        this._keys[i - 1] = this._keys[i];
                        this._values[i - 1] = this._values[i];
                    }
                    this._keys.length--;
                    this._values.length--;
                    if (key === this._cacheKey) {
                        this._cacheKey = cacheSentinel;
                        this._cacheIndex = -2;
                    }
                    return true;
                }
                return false;
            };
            Map.prototype.clear = function () {
                this._keys.length = 0;
                this._values.length = 0;
                this._cacheKey = cacheSentinel;
                this._cacheIndex = -2;
            };
            Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };
            Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };
            Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };
            Map.prototype["@@iterator"] = function () { return this.entries(); };
            Map.prototype[iteratorSymbol] = function () { return this.entries(); };
            Map.prototype._find = function (key, insert) {
                if (this._cacheKey !== key) {
                    this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
                }
                if (this._cacheIndex < 0 && insert) {
                    this._cacheIndex = this._keys.length;
                    this._keys.push(key);
                    this._values.push(undefined);
                }
                return this._cacheIndex;
            };
            return Map;
        }());
        function getKey(key, _) {
            return key;
        }
        function getValue(_, value) {
            return value;
        }
        function getEntry(key, value) {
            return [key, value];
        }
    }
    // naive Set shim
    function CreateSetPolyfill() {
        return (function () {
            function Set() {
                this._map = new _Map();
            }
            Object.defineProperty(Set.prototype, "size", {
                get: function () { return this._map.size; },
                enumerable: true,
                configurable: true
            });
            Set.prototype.has = function (value) { return this._map.has(value); };
            Set.prototype.add = function (value) { return this._map.set(value, value), this; };
            Set.prototype.delete = function (value) { return this._map.delete(value); };
            Set.prototype.clear = function () { this._map.clear(); };
            Set.prototype.keys = function () { return this._map.keys(); };
            Set.prototype.values = function () { return this._map.values(); };
            Set.prototype.entries = function () { return this._map.entries(); };
            Set.prototype["@@iterator"] = function () { return this.keys(); };
            Set.prototype[iteratorSymbol] = function () { return this.keys(); };
            return Set;
        }());
    }
    // naive WeakMap shim
    function CreateWeakMapPolyfill() {
        var UUID_SIZE = 16;
        var keys = HashMap.create();
        var rootKey = CreateUniqueKey();
        return (function () {
            function WeakMap() {
                this._key = CreateUniqueKey();
            }
            WeakMap.prototype.has = function (target) {
                var table = GetOrCreateWeakMapTable(target, /*create*/ false);
                return table !== undefined ? HashMap.has(table, this._key) : false;
            };
            WeakMap.prototype.get = function (target) {
                var table = GetOrCreateWeakMapTable(target, /*create*/ false);
                return table !== undefined ? HashMap.get(table, this._key) : undefined;
            };
            WeakMap.prototype.set = function (target, value) {
                var table = GetOrCreateWeakMapTable(target, /*create*/ true);
                table[this._key] = value;
                return this;
            };
            WeakMap.prototype.delete = function (target) {
                var table = GetOrCreateWeakMapTable(target, /*create*/ false);
                return table !== undefined ? delete table[this._key] : false;
            };
            WeakMap.prototype.clear = function () {
                // NOTE: not a real clear, just makes the previous data unreachable
                this._key = CreateUniqueKey();
            };
            return WeakMap;
        }());
        function CreateUniqueKey() {
            var key;
            do
                key = "@@WeakMap@@" + CreateUUID();
            while (HashMap.has(keys, key));
            keys[key] = true;
            return key;
        }
        function GetOrCreateWeakMapTable(target, create) {
            if (!hasOwn.call(target, rootKey)) {
                if (!create)
                    return undefined;
                Object.defineProperty(target, rootKey, { value: HashMap.create() });
            }
            return target[rootKey];
        }
        function FillRandomBytes(buffer, size) {
            for (var i = 0; i < size; ++i)
                buffer[i] = Math.random() * 0xff | 0;
            return buffer;
        }
        function GenRandomBytes(size) {
            if (typeof Uint8Array === "function") {
                if (typeof crypto !== "undefined")
                    return crypto.getRandomValues(new Uint8Array(size));
                if (typeof msCrypto !== "undefined")
                    return msCrypto.getRandomValues(new Uint8Array(size));
                return FillRandomBytes(new Uint8Array(size), size);
            }
            return FillRandomBytes(new Array(size), size);
        }
        function CreateUUID() {
            var data = GenRandomBytes(UUID_SIZE);
            // mark as random - RFC 4122 § 4.4
            data[6] = data[6] & 0x4f | 0x40;
            data[8] = data[8] & 0xbf | 0x80;
            var result = "";
            for (var offset = 0; offset < UUID_SIZE; ++offset) {
                var byte = data[offset];
                if (offset === 4 || offset === 6 || offset === 8)
                    result += "-";
                if (byte < 16)
                    result += "0";
                result += byte.toString(16).toLowerCase();
            }
            return result;
        }
    }
    // uses a heuristic used by v8 and chakra to force an object into dictionary mode.
    function MakeDictionary(obj) {
        obj.__ = undefined;
        delete obj.__;
        return obj;
    }
    // patch global Reflect
    (function (__global) {
        if (typeof __global.Reflect !== "undefined") {
            if (__global.Reflect !== Reflect) {
                for (var p in Reflect) {
                    if (hasOwn.call(Reflect, p)) {
                        __global.Reflect[p] = Reflect[p];
                    }
                }
            }
        }
        else {
            __global.Reflect = Reflect;
        }
    })(typeof global !== "undefined" ? global :
        typeof self !== "undefined" ? self :
            Function("return this;")());
})(Reflect || (Reflect = {}));
//# sourceMappingURL=Reflect.js.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(523), __webpack_require__(152)))

/***/ }),
/* 811 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

/* tslint:disable:no-unused-variable */
// Subject imported before Observable to bypass circular dependency issue since
// Subject extends Observable and Observable references Subject in it's
// definition
var Subject_1 = __webpack_require__(11);
exports.Subject = Subject_1.Subject;
exports.AnonymousSubject = Subject_1.AnonymousSubject;
/* tslint:enable:no-unused-variable */
var Observable_1 = __webpack_require__(1);
exports.Observable = Observable_1.Observable;
// statics
/* tslint:disable:no-use-before-declare */
__webpack_require__(813);
__webpack_require__(814);
__webpack_require__(815);
__webpack_require__(816);
__webpack_require__(817);
__webpack_require__(489);
__webpack_require__(820);
__webpack_require__(240);
__webpack_require__(47);
__webpack_require__(821);
__webpack_require__(822);
__webpack_require__(823);
__webpack_require__(824);
__webpack_require__(145);
__webpack_require__(104);
__webpack_require__(828);
__webpack_require__(825);
__webpack_require__(241);
__webpack_require__(826);
__webpack_require__(827);
__webpack_require__(829);
__webpack_require__(831);
__webpack_require__(830);
__webpack_require__(490);
__webpack_require__(491);
//dom
__webpack_require__(818);
__webpack_require__(819);
//operators
__webpack_require__(833);
__webpack_require__(242);
__webpack_require__(834);
__webpack_require__(835);
__webpack_require__(836);
__webpack_require__(492);
__webpack_require__(837);
__webpack_require__(493);
__webpack_require__(838);
__webpack_require__(839);
__webpack_require__(243);
__webpack_require__(840);
__webpack_require__(841);
__webpack_require__(845);
__webpack_require__(842);
__webpack_require__(244);
__webpack_require__(843);
__webpack_require__(146);
__webpack_require__(844);
__webpack_require__(846);
__webpack_require__(147);
__webpack_require__(847);
__webpack_require__(56);
__webpack_require__(850);
__webpack_require__(851);
__webpack_require__(852);
__webpack_require__(848);
__webpack_require__(31);
__webpack_require__(853);
__webpack_require__(854);
__webpack_require__(855);
__webpack_require__(856);
__webpack_require__(494);
__webpack_require__(857);
__webpack_require__(858);
__webpack_require__(832);
__webpack_require__(105);
__webpack_require__(859);
__webpack_require__(495);
__webpack_require__(849);
__webpack_require__(32);
__webpack_require__(860);
__webpack_require__(861);
__webpack_require__(862);
__webpack_require__(80);
__webpack_require__(863);
__webpack_require__(864);
__webpack_require__(865);
__webpack_require__(866);
__webpack_require__(867);
__webpack_require__(868);
__webpack_require__(869);
__webpack_require__(870);
__webpack_require__(871);
__webpack_require__(496);
__webpack_require__(872);
__webpack_require__(873);
__webpack_require__(874);
__webpack_require__(876);
__webpack_require__(875);
__webpack_require__(877);
__webpack_require__(878);
__webpack_require__(879);
__webpack_require__(880);
__webpack_require__(881);
__webpack_require__(882);
__webpack_require__(883);
__webpack_require__(884);
__webpack_require__(497);
__webpack_require__(885);
__webpack_require__(886);
__webpack_require__(887);
__webpack_require__(888);
__webpack_require__(889);
__webpack_require__(890);
__webpack_require__(891);
__webpack_require__(498);
__webpack_require__(499);
__webpack_require__(892);
__webpack_require__(893);
__webpack_require__(106);
__webpack_require__(500);
__webpack_require__(81);
__webpack_require__(894);
__webpack_require__(107);
__webpack_require__(501);
__webpack_require__(895);
__webpack_require__(245);
__webpack_require__(896);
__webpack_require__(897);
__webpack_require__(898);
__webpack_require__(899);
__webpack_require__(900);
__webpack_require__(901);
__webpack_require__(902);
__webpack_require__(903);
__webpack_require__(904);
__webpack_require__(905);
__webpack_require__(906);
__webpack_require__(907);
__webpack_require__(908);
__webpack_require__(909);
/* tslint:disable:no-unused-variable */
var Subscription_1 = __webpack_require__(16);
exports.Subscription = Subscription_1.Subscription;
var Subscriber_1 = __webpack_require__(6);
exports.Subscriber = Subscriber_1.Subscriber;
var AsyncSubject_1 = __webpack_require__(144);
exports.AsyncSubject = AsyncSubject_1.AsyncSubject;
var ReplaySubject_1 = __webpack_require__(103);
exports.ReplaySubject = ReplaySubject_1.ReplaySubject;
var BehaviorSubject_1 = __webpack_require__(150);
exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject;
var ConnectableObservable_1 = __webpack_require__(1056);
exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable;
var Notification_1 = __webpack_require__(151);
exports.Notification = Notification_1.Notification;
var EmptyError_1 = __webpack_require__(522);
exports.EmptyError = EmptyError_1.EmptyError;
var ArgumentOutOfRangeError_1 = __webpack_require__(110);
exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
var ObjectUnsubscribedError_1 = __webpack_require__(524);
exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError;
var TimeoutError_1 = __webpack_require__(517);
exports.TimeoutError = TimeoutError_1.TimeoutError;
var UnsubscriptionError_1 = __webpack_require__(1070);
exports.UnsubscriptionError = UnsubscriptionError_1.UnsubscriptionError;
var timeInterval_1 = __webpack_require__(509);
exports.TimeInterval = timeInterval_1.TimeInterval;
var timestamp_1 = __webpack_require__(510);
exports.Timestamp = timestamp_1.Timestamp;
var TestScheduler_1 = __webpack_require__(1030);
exports.TestScheduler = TestScheduler_1.TestScheduler;
var VirtualTimeScheduler_1 = __webpack_require__(511);
exports.VirtualTimeScheduler = VirtualTimeScheduler_1.VirtualTimeScheduler;
var AjaxObservable_1 = __webpack_require__(502);
exports.AjaxResponse = AjaxObservable_1.AjaxResponse;
exports.AjaxError = AjaxObservable_1.AjaxError;
exports.AjaxTimeoutError = AjaxObservable_1.AjaxTimeoutError;
var asap_1 = __webpack_require__(513);
var async_1 = __webpack_require__(23);
var queue_1 = __webpack_require__(514);
var animationFrame_1 = __webpack_require__(512);
var rxSubscriber_1 = __webpack_require__(1047);
var iterator_1 = __webpack_require__(112);
var observable_1 = __webpack_require__(1046);
/* tslint:enable:no-unused-variable */
/**
 * @typedef {Object} Rx.Scheduler
 * @property {Scheduler} queue Schedules on a queue in the current event frame
 * (trampoline scheduler). Use this for iteration operations.
 * @property {Scheduler} asap Schedules on the micro task queue, which uses the
 * fastest transport mechanism available, either Node.js' `process.nextTick()`
 * or Web Worker MessageChannel or setTimeout or others. Use this for
 * asynchronous conversions.
 * @property {Scheduler} async Schedules work with `setInterval`. Use this for
 * time-based operations.
 * @property {Scheduler} animationFrame Schedules work with `requestAnimationFrame`.
 * Use this for synchronizing with the platform's painting
 */
var Scheduler = {
    asap: asap_1.asap,
    queue: queue_1.queue,
    animationFrame: animationFrame_1.animationFrame,
    async: async_1.async
};
exports.Scheduler = Scheduler;
/**
 * @typedef {Object} Rx.Symbol
 * @property {Symbol|string} rxSubscriber A symbol to use as a property name to
 * retrieve an "Rx safe" Observer from an object. "Rx safety" can be defined as
 * an object that has all of the traits of an Rx Subscriber, including the
 * ability to add and remove subscriptions to the subscription chain and
 * guarantees involving event triggering (can't "next" after unsubscription,
 * etc).
 * @property {Symbol|string} observable A symbol to use as a property name to
 * retrieve an Observable as defined by the [ECMAScript "Observable" spec](https://github.com/zenparsing/es-observable).
 * @property {Symbol|string} iterator The ES6 symbol to use as a property name
 * to retrieve an iterator from an object.
 */
var Symbol = {
    rxSubscriber: rxSubscriber_1.rxSubscriber,
    observable: observable_1.observable,
    iterator: iterator_1.iterator
};
exports.Symbol = Symbol;
//# sourceMappingURL=Rx.js.map

/***/ }),
/* 812 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

/**
 * An execution context and a data structure to order tasks and schedule their
 * execution. Provides a notion of (potentially virtual) time, through the
 * `now()` getter method.
 *
 * Each unit of work in a Scheduler is called an {@link Action}.
 *
 * ```ts
 * class Scheduler {
 *   now(): number;
 *   schedule(work, delay?, state?): Subscription;
 * }
 * ```
 *
 * @class Scheduler
 */
var Scheduler = (function () {
    function Scheduler(SchedulerAction, now) {
        if (now === void 0) { now = Scheduler.now; }
        this.SchedulerAction = SchedulerAction;
        this.now = now;
    }
    /**
     * Schedules a function, `work`, for execution. May happen at some point in
     * the future, according to the `delay` parameter, if specified. May be passed
     * some context object, `state`, which will be passed to the `work` function.
     *
     * The given arguments will be processed an stored as an Action object in a
     * queue of actions.
     *
     * @param {function(state: ?T): ?Subscription} work A function representing a
     * task, or some unit of work to be executed by the Scheduler.
     * @param {number} [delay] Time to wait before executing the work, where the
     * time unit is implicit and defined by the Scheduler itself.
     * @param {T} [state] Some contextual data that the `work` function uses when
     * called by the Scheduler.
     * @return {Subscription} A subscription in order to be able to unsubscribe
     * the scheduled work.
     */
    Scheduler.prototype.schedule = function (work, delay, state) {
        if (delay === void 0) { delay = 0; }
        return new this.SchedulerAction(this, work).schedule(state, delay);
    };
    Scheduler.now = Date.now ? Date.now : function () { return +new Date(); };
    return Scheduler;
}());
exports.Scheduler = Scheduler;
//# sourceMappingURL=Scheduler.js.map

/***/ }),
/* 813 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var bindCallback_1 = __webpack_require__(925);
Observable_1.Observable.bindCallback = bindCallback_1.bindCallback;
//# sourceMappingURL=bindCallback.js.map

/***/ }),
/* 814 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var bindNodeCallback_1 = __webpack_require__(926);
Observable_1.Observable.bindNodeCallback = bindNodeCallback_1.bindNodeCallback;
//# sourceMappingURL=bindNodeCallback.js.map

/***/ }),
/* 815 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var combineLatest_1 = __webpack_require__(927);
Observable_1.Observable.combineLatest = combineLatest_1.combineLatest;
//# sourceMappingURL=combineLatest.js.map

/***/ }),
/* 816 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var concat_1 = __webpack_require__(928);
Observable_1.Observable.concat = concat_1.concat;
//# sourceMappingURL=concat.js.map

/***/ }),
/* 817 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var defer_1 = __webpack_require__(929);
Observable_1.Observable.defer = defer_1.defer;
//# sourceMappingURL=defer.js.map

/***/ }),
/* 818 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var ajax_1 = __webpack_require__(931);
Observable_1.Observable.ajax = ajax_1.ajax;
//# sourceMappingURL=ajax.js.map

/***/ }),
/* 819 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var webSocket_1 = __webpack_require__(932);
Observable_1.Observable.webSocket = webSocket_1.webSocket;
//# sourceMappingURL=webSocket.js.map

/***/ }),
/* 820 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var forkJoin_1 = __webpack_require__(1058);
Observable_1.Observable.forkJoin = forkJoin_1.forkJoin;
//# sourceMappingURL=forkJoin.js.map

/***/ }),
/* 821 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var fromEventPattern_1 = __webpack_require__(935);
Observable_1.Observable.fromEventPattern = fromEventPattern_1.fromEventPattern;
//# sourceMappingURL=fromEventPattern.js.map

/***/ }),
/* 822 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var fromPromise_1 = __webpack_require__(1049);
Observable_1.Observable.fromPromise = fromPromise_1.fromPromise;
//# sourceMappingURL=fromPromise.js.map

/***/ }),
/* 823 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var GenerateObservable_1 = __webpack_require__(916);
Observable_1.Observable.generate = GenerateObservable_1.GenerateObservable.create;
//# sourceMappingURL=generate.js.map

/***/ }),
/* 824 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var if_1 = __webpack_require__(936);
Observable_1.Observable.if = if_1._if;
//# sourceMappingURL=if.js.map

/***/ }),
/* 825 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var never_1 = __webpack_require__(938);
Observable_1.Observable.never = never_1.never;
//# sourceMappingURL=never.js.map

/***/ }),
/* 826 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var onErrorResumeNext_1 = __webpack_require__(506);
Observable_1.Observable.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNextStatic;
//# sourceMappingURL=onErrorResumeNext.js.map

/***/ }),
/* 827 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var pairs_1 = __webpack_require__(939);
Observable_1.Observable.pairs = pairs_1.pairs;
//# sourceMappingURL=pairs.js.map

/***/ }),
/* 828 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var race_1 = __webpack_require__(507);
Observable_1.Observable.race = race_1.raceStatic;
//# sourceMappingURL=race.js.map

/***/ }),
/* 829 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var range_1 = __webpack_require__(940);
Observable_1.Observable.range = range_1.range;
//# sourceMappingURL=range.js.map

/***/ }),
/* 830 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var throw_1 = __webpack_require__(941);
Observable_1.Observable.throw = throw_1._throw;
//# sourceMappingURL=throw.js.map

/***/ }),
/* 831 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var using_1 = __webpack_require__(943);
Observable_1.Observable.using = using_1.using;
//# sourceMappingURL=using.js.map

/***/ }),
/* 832 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var audit_1 = __webpack_require__(945);
Observable_1.Observable.prototype.audit = audit_1.audit;
//# sourceMappingURL=audit.js.map

/***/ }),
/* 833 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var buffer_1 = __webpack_require__(947);
Observable_1.Observable.prototype.buffer = buffer_1.buffer;
//# sourceMappingURL=buffer.js.map

/***/ }),
/* 834 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var bufferTime_1 = __webpack_require__(949);
Observable_1.Observable.prototype.bufferTime = bufferTime_1.bufferTime;
//# sourceMappingURL=bufferTime.js.map

/***/ }),
/* 835 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var bufferToggle_1 = __webpack_require__(950);
Observable_1.Observable.prototype.bufferToggle = bufferToggle_1.bufferToggle;
//# sourceMappingURL=bufferToggle.js.map

/***/ }),
/* 836 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var bufferWhen_1 = __webpack_require__(951);
Observable_1.Observable.prototype.bufferWhen = bufferWhen_1.bufferWhen;
//# sourceMappingURL=bufferWhen.js.map

/***/ }),
/* 837 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var combineAll_1 = __webpack_require__(952);
Observable_1.Observable.prototype.combineAll = combineAll_1.combineAll;
//# sourceMappingURL=combineAll.js.map

/***/ }),
/* 838 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var concat_1 = __webpack_require__(247);
Observable_1.Observable.prototype.concat = concat_1.concat;
//# sourceMappingURL=concat.js.map

/***/ }),
/* 839 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var concatAll_1 = __webpack_require__(1063);
Observable_1.Observable.prototype.concatAll = concatAll_1.concatAll;
//# sourceMappingURL=concatAll.js.map

/***/ }),
/* 840 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var concatMapTo_1 = __webpack_require__(953);
Observable_1.Observable.prototype.concatMapTo = concatMapTo_1.concatMapTo;
//# sourceMappingURL=concatMapTo.js.map

/***/ }),
/* 841 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var count_1 = __webpack_require__(954);
Observable_1.Observable.prototype.count = count_1.count;
//# sourceMappingURL=count.js.map

/***/ }),
/* 842 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var debounce_1 = __webpack_require__(955);
Observable_1.Observable.prototype.debounce = debounce_1.debounce;
//# sourceMappingURL=debounce.js.map

/***/ }),
/* 843 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var defaultIfEmpty_1 = __webpack_require__(957);
Observable_1.Observable.prototype.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty;
//# sourceMappingURL=defaultIfEmpty.js.map

/***/ }),
/* 844 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var delayWhen_1 = __webpack_require__(959);
Observable_1.Observable.prototype.delayWhen = delayWhen_1.delayWhen;
//# sourceMappingURL=delayWhen.js.map

/***/ }),
/* 845 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var dematerialize_1 = __webpack_require__(960);
Observable_1.Observable.prototype.dematerialize = dematerialize_1.dematerialize;
//# sourceMappingURL=dematerialize.js.map

/***/ }),
/* 846 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var distinct_1 = __webpack_require__(961);
Observable_1.Observable.prototype.distinct = distinct_1.distinct;
//# sourceMappingURL=distinct.js.map

/***/ }),
/* 847 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var distinctUntilKeyChanged_1 = __webpack_require__(962);
Observable_1.Observable.prototype.distinctUntilKeyChanged = distinctUntilKeyChanged_1.distinctUntilKeyChanged;
//# sourceMappingURL=distinctUntilKeyChanged.js.map

/***/ }),
/* 848 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var elementAt_1 = __webpack_require__(964);
Observable_1.Observable.prototype.elementAt = elementAt_1.elementAt;
//# sourceMappingURL=elementAt.js.map

/***/ }),
/* 849 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var every_1 = __webpack_require__(1065);
Observable_1.Observable.prototype.every = every_1.every;
//# sourceMappingURL=every.js.map

/***/ }),
/* 850 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var exhaust_1 = __webpack_require__(965);
Observable_1.Observable.prototype.exhaust = exhaust_1.exhaust;
//# sourceMappingURL=exhaust.js.map

/***/ }),
/* 851 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var exhaustMap_1 = __webpack_require__(966);
Observable_1.Observable.prototype.exhaustMap = exhaustMap_1.exhaustMap;
//# sourceMappingURL=exhaustMap.js.map

/***/ }),
/* 852 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var expand_1 = __webpack_require__(967);
Observable_1.Observable.prototype.expand = expand_1.expand;
//# sourceMappingURL=expand.js.map

/***/ }),
/* 853 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var finally_1 = __webpack_require__(968);
Observable_1.Observable.prototype.finally = finally_1._finally;
Observable_1.Observable.prototype._finally = finally_1._finally;
//# sourceMappingURL=finally.js.map

/***/ }),
/* 854 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var find_1 = __webpack_require__(504);
Observable_1.Observable.prototype.find = find_1.find;
//# sourceMappingURL=find.js.map

/***/ }),
/* 855 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var findIndex_1 = __webpack_require__(969);
Observable_1.Observable.prototype.findIndex = findIndex_1.findIndex;
//# sourceMappingURL=findIndex.js.map

/***/ }),
/* 856 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var first_1 = __webpack_require__(1066);
Observable_1.Observable.prototype.first = first_1.first;
//# sourceMappingURL=first.js.map

/***/ }),
/* 857 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var ignoreElements_1 = __webpack_require__(971);
Observable_1.Observable.prototype.ignoreElements = ignoreElements_1.ignoreElements;
//# sourceMappingURL=ignoreElements.js.map

/***/ }),
/* 858 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var isEmpty_1 = __webpack_require__(972);
Observable_1.Observable.prototype.isEmpty = isEmpty_1.isEmpty;
//# sourceMappingURL=isEmpty.js.map

/***/ }),
/* 859 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var last_1 = __webpack_require__(1067);
Observable_1.Observable.prototype.last = last_1.last;
//# sourceMappingURL=last.js.map

/***/ }),
/* 860 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var mapTo_1 = __webpack_require__(974);
Observable_1.Observable.prototype.mapTo = mapTo_1.mapTo;
//# sourceMappingURL=mapTo.js.map

/***/ }),
/* 861 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var materialize_1 = __webpack_require__(975);
Observable_1.Observable.prototype.materialize = materialize_1.materialize;
//# sourceMappingURL=materialize.js.map

/***/ }),
/* 862 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var max_1 = __webpack_require__(976);
Observable_1.Observable.prototype.max = max_1.max;
//# sourceMappingURL=max.js.map

/***/ }),
/* 863 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var mergeAll_1 = __webpack_require__(521);
Observable_1.Observable.prototype.mergeAll = mergeAll_1.mergeAll;
//# sourceMappingURL=mergeAll.js.map

/***/ }),
/* 864 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var mergeMap_1 = __webpack_require__(1050);
Observable_1.Observable.prototype.mergeMap = mergeMap_1.mergeMap;
Observable_1.Observable.prototype.flatMap = mergeMap_1.mergeMap;
//# sourceMappingURL=mergeMap.js.map

/***/ }),
/* 865 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var mergeMapTo_1 = __webpack_require__(505);
Observable_1.Observable.prototype.flatMapTo = mergeMapTo_1.mergeMapTo;
Observable_1.Observable.prototype.mergeMapTo = mergeMapTo_1.mergeMapTo;
//# sourceMappingURL=mergeMapTo.js.map

/***/ }),
/* 866 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var mergeScan_1 = __webpack_require__(977);
Observable_1.Observable.prototype.mergeScan = mergeScan_1.mergeScan;
//# sourceMappingURL=mergeScan.js.map

/***/ }),
/* 867 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var min_1 = __webpack_require__(978);
Observable_1.Observable.prototype.min = min_1.min;
//# sourceMappingURL=min.js.map

/***/ }),
/* 868 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var multicast_1 = __webpack_require__(84);
Observable_1.Observable.prototype.multicast = multicast_1.multicast;
//# sourceMappingURL=multicast.js.map

/***/ }),
/* 869 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var observeOn_1 = __webpack_require__(528);
Observable_1.Observable.prototype.observeOn = observeOn_1.observeOn;
//# sourceMappingURL=observeOn.js.map

/***/ }),
/* 870 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var onErrorResumeNext_1 = __webpack_require__(506);
Observable_1.Observable.prototype.onErrorResumeNext = onErrorResumeNext_1.onErrorResumeNext;
//# sourceMappingURL=onErrorResumeNext.js.map

/***/ }),
/* 871 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var pairwise_1 = __webpack_require__(979);
Observable_1.Observable.prototype.pairwise = pairwise_1.pairwise;
//# sourceMappingURL=pairwise.js.map

/***/ }),
/* 872 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var pluck_1 = __webpack_require__(981);
Observable_1.Observable.prototype.pluck = pluck_1.pluck;
//# sourceMappingURL=pluck.js.map

/***/ }),
/* 873 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var publish_1 = __webpack_require__(982);
Observable_1.Observable.prototype.publish = publish_1.publish;
//# sourceMappingURL=publish.js.map

/***/ }),
/* 874 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var publishBehavior_1 = __webpack_require__(983);
Observable_1.Observable.prototype.publishBehavior = publishBehavior_1.publishBehavior;
//# sourceMappingURL=publishBehavior.js.map

/***/ }),
/* 875 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var publishLast_1 = __webpack_require__(984);
Observable_1.Observable.prototype.publishLast = publishLast_1.publishLast;
//# sourceMappingURL=publishLast.js.map

/***/ }),
/* 876 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var publishReplay_1 = __webpack_require__(985);
Observable_1.Observable.prototype.publishReplay = publishReplay_1.publishReplay;
//# sourceMappingURL=publishReplay.js.map

/***/ }),
/* 877 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var race_1 = __webpack_require__(507);
Observable_1.Observable.prototype.race = race_1.race;
//# sourceMappingURL=race.js.map

/***/ }),
/* 878 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var reduce_1 = __webpack_require__(252);
Observable_1.Observable.prototype.reduce = reduce_1.reduce;
//# sourceMappingURL=reduce.js.map

/***/ }),
/* 879 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var repeat_1 = __webpack_require__(986);
Observable_1.Observable.prototype.repeat = repeat_1.repeat;
//# sourceMappingURL=repeat.js.map

/***/ }),
/* 880 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var repeatWhen_1 = __webpack_require__(987);
Observable_1.Observable.prototype.repeatWhen = repeatWhen_1.repeatWhen;
//# sourceMappingURL=repeatWhen.js.map

/***/ }),
/* 881 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var retry_1 = __webpack_require__(988);
Observable_1.Observable.prototype.retry = retry_1.retry;
//# sourceMappingURL=retry.js.map

/***/ }),
/* 882 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var retryWhen_1 = __webpack_require__(989);
Observable_1.Observable.prototype.retryWhen = retryWhen_1.retryWhen;
//# sourceMappingURL=retryWhen.js.map

/***/ }),
/* 883 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var sample_1 = __webpack_require__(990);
Observable_1.Observable.prototype.sample = sample_1.sample;
//# sourceMappingURL=sample.js.map

/***/ }),
/* 884 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var sampleTime_1 = __webpack_require__(991);
Observable_1.Observable.prototype.sampleTime = sampleTime_1.sampleTime;
//# sourceMappingURL=sampleTime.js.map

/***/ }),
/* 885 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var sequenceEqual_1 = __webpack_require__(993);
Observable_1.Observable.prototype.sequenceEqual = sequenceEqual_1.sequenceEqual;
//# sourceMappingURL=sequenceEqual.js.map

/***/ }),
/* 886 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var share_1 = __webpack_require__(1069);
Observable_1.Observable.prototype.share = share_1.share;
//# sourceMappingURL=share.js.map

/***/ }),
/* 887 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var shareReplay_1 = __webpack_require__(994);
Observable_1.Observable.prototype.shareReplay = shareReplay_1.shareReplay;
//# sourceMappingURL=shareReplay.js.map

/***/ }),
/* 888 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var single_1 = __webpack_require__(995);
Observable_1.Observable.prototype.single = single_1.single;
//# sourceMappingURL=single.js.map

/***/ }),
/* 889 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var skip_1 = __webpack_require__(996);
Observable_1.Observable.prototype.skip = skip_1.skip;
//# sourceMappingURL=skip.js.map

/***/ }),
/* 890 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var skipLast_1 = __webpack_require__(997);
Observable_1.Observable.prototype.skipLast = skipLast_1.skipLast;
//# sourceMappingURL=skipLast.js.map

/***/ }),
/* 891 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var skipUntil_1 = __webpack_require__(998);
Observable_1.Observable.prototype.skipUntil = skipUntil_1.skipUntil;
//# sourceMappingURL=skipUntil.js.map

/***/ }),
/* 892 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var subscribeOn_1 = __webpack_require__(1001);
Observable_1.Observable.prototype.subscribeOn = subscribeOn_1.subscribeOn;
//# sourceMappingURL=subscribeOn.js.map

/***/ }),
/* 893 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var switch_1 = __webpack_require__(1002);
Observable_1.Observable.prototype.switch = switch_1._switch;
Observable_1.Observable.prototype._switch = switch_1._switch;
//# sourceMappingURL=switch.js.map

/***/ }),
/* 894 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var takeLast_1 = __webpack_require__(1006);
Observable_1.Observable.prototype.takeLast = takeLast_1.takeLast;
//# sourceMappingURL=takeLast.js.map

/***/ }),
/* 895 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var throttle_1 = __webpack_require__(508);
Observable_1.Observable.prototype.throttle = throttle_1.throttle;
//# sourceMappingURL=throttle.js.map

/***/ }),
/* 896 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var timeInterval_1 = __webpack_require__(509);
Observable_1.Observable.prototype.timeInterval = timeInterval_1.timeInterval;
//# sourceMappingURL=timeInterval.js.map

/***/ }),
/* 897 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var timeout_1 = __webpack_require__(1010);
Observable_1.Observable.prototype.timeout = timeout_1.timeout;
//# sourceMappingURL=timeout.js.map

/***/ }),
/* 898 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var timeoutWith_1 = __webpack_require__(1011);
Observable_1.Observable.prototype.timeoutWith = timeoutWith_1.timeoutWith;
//# sourceMappingURL=timeoutWith.js.map

/***/ }),
/* 899 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var timestamp_1 = __webpack_require__(510);
Observable_1.Observable.prototype.timestamp = timestamp_1.timestamp;
//# sourceMappingURL=timestamp.js.map

/***/ }),
/* 900 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var toArray_1 = __webpack_require__(1012);
Observable_1.Observable.prototype.toArray = toArray_1.toArray;
//# sourceMappingURL=toArray.js.map

/***/ }),
/* 901 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var toPromise_1 = __webpack_require__(1013);
Observable_1.Observable.prototype.toPromise = toPromise_1.toPromise;
//# sourceMappingURL=toPromise.js.map

/***/ }),
/* 902 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var window_1 = __webpack_require__(1014);
Observable_1.Observable.prototype.window = window_1.window;
//# sourceMappingURL=window.js.map

/***/ }),
/* 903 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var windowCount_1 = __webpack_require__(1015);
Observable_1.Observable.prototype.windowCount = windowCount_1.windowCount;
//# sourceMappingURL=windowCount.js.map

/***/ }),
/* 904 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var windowTime_1 = __webpack_require__(1016);
Observable_1.Observable.prototype.windowTime = windowTime_1.windowTime;
//# sourceMappingURL=windowTime.js.map

/***/ }),
/* 905 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var windowToggle_1 = __webpack_require__(1017);
Observable_1.Observable.prototype.windowToggle = windowToggle_1.windowToggle;
//# sourceMappingURL=windowToggle.js.map

/***/ }),
/* 906 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var windowWhen_1 = __webpack_require__(1018);
Observable_1.Observable.prototype.windowWhen = windowWhen_1.windowWhen;
//# sourceMappingURL=windowWhen.js.map

/***/ }),
/* 907 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var withLatestFrom_1 = __webpack_require__(1019);
Observable_1.Observable.prototype.withLatestFrom = withLatestFrom_1.withLatestFrom;
//# sourceMappingURL=withLatestFrom.js.map

/***/ }),
/* 908 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var zip_1 = __webpack_require__(248);
Observable_1.Observable.prototype.zip = zip_1.zipProto;
//# sourceMappingURL=zip.js.map

/***/ }),
/* 909 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Observable_1 = __webpack_require__(1);
var zipAll_1 = __webpack_require__(1020);
Observable_1.Observable.prototype.zipAll = zipAll_1.zipAll;
//# sourceMappingURL=zipAll.js.map

/***/ }),
/* 910 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var AsyncSubject_1 = __webpack_require__(144);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var BoundCallbackObservable = (function (_super) {
    __extends(BoundCallbackObservable, _super);
    function BoundCallbackObservable(callbackFunc, selector, args, context, scheduler) {
        _super.call(this);
        this.callbackFunc = callbackFunc;
        this.selector = selector;
        this.args = args;
        this.context = context;
        this.scheduler = scheduler;
    }
    /* tslint:enable:max-line-length */
    /**
     * Converts a callback API to a function that returns an Observable.
     *
     * <span class="informal">Give it a function `f` of type `f(x, callback)` and
     * it will return a function `g` that when called as `g(x)` will output an
     * Observable.</span>
     *
     * `bindCallback` is not an operator because its input and output are not
     * Observables. The input is a function `func` with some parameters, but the
     * last parameter must be a callback function that `func` calls when it is
     * done.
     *
     * The output of `bindCallback` is a function that takes the same parameters
     * as `func`, except the last one (the callback). When the output function
     * is called with arguments, it will return an Observable. If `func` function
     * calls its callback with one argument, the Observable will emit that value.
     * If on the other hand callback is called with multiple values, resulting
     * Observable will emit an array with these arguments.
     *
     * It is very important to remember, that input function `func` is not called
     * when output function is, but rather when Observable returned by output
     * function is subscribed. This means if `func` makes AJAX request, that request
     * will be made every time someone subscribes to resulting Observable, but not before.
     *
     * Optionally, selector function can be passed to `bindObservable`. That function
     * takes the same arguments as callback, and returns value
     * that will be emitted by Observable instead of callback parameters themselves.
     * Even though by default multiple arguments passed to callback appear in the stream as array,
     * selector function will be called with arguments directly, just as callback would.
     * This means you can imagine default selector (when one is not provided explicitly)
     * as function that aggregates all its arguments into array, or simply returns first argument,
     * if there is only one.
     *
     * Last optional parameter - {@link Scheduler} - can be used to control when call
     * to `func` happens after someone subscribes to Observable, as well as when results
     * passed to callback will be emitted. By default subscription to Observable calls `func`
     * synchronously, but using `Scheduler.async` as last parameter will defer call to input function,
     * just like wrapping that call in `setTimeout` with time `0` would. So if you use async Scheduler
     * and call `subscribe` on output Observable, all function calls that are currently executing,
     * will end before `func` is invoked.
     *
     * When it comes to emitting results passed to callback, by default they are emitted
     * immediately after `func` invokes callback. In particular, if callback is called synchronously,
     * then subscription to resulting Observable will call `next` function synchronously as well.
     * If you want to defer that call, using `Scheduler.async` will, again, do the job.
     * This means that by using `Scheduler.async` you can, in a sense, ensure that `func`
     * always calls its callback asynchronously, thus avoiding terrifying Zalgo.
     *
     * Note that Observable created by output function will always emit only one value
     * and then complete right after. Even if `func` calls callback multiple times, values from
     * second and following calls will never appear in the stream. If you need to
     * listen for multiple calls, you probably want to use {@link fromEvent} or
     * {@link fromEventPattern} instead.
     *
     * If `func` depends on some context (`this` property), that context will be set
     * to the same context that output function has at call time. In particular, if `func`
     * is called as method of some object, in order to preserve proper behaviour,
     * it is recommended to set context of output function to that object as well,
     * provided `func` is not already bound.
     *
     * If input function calls its callback in "node style" (i.e. first argument to callback is
     * optional error parameter signaling whether call failed or not), {@link bindNodeCallback}
     * provides convenient error handling and probably is a better choice.
     * `bindCallback` will treat such functions without any difference and error parameter
     * (whether passed or not) will always be interpreted as regular callback argument.
     *
     *
     * @example <caption>Convert jQuery's getJSON to an Observable API</caption>
     * // Suppose we have jQuery.getJSON('/my/url', callback)
     * var getJSONAsObservable = Rx.Observable.bindCallback(jQuery.getJSON);
     * var result = getJSONAsObservable('/my/url');
     * result.subscribe(x => console.log(x), e => console.error(e));
     *
     *
     * @example <caption>Receive array of arguments passed to callback</caption>
     * someFunction((a, b, c) => {
     *   console.log(a); // 5
     *   console.log(b); // 'some string'
     *   console.log(c); // {someProperty: 'someValue'}
     * });
     *
     * const boundSomeFunction = Rx.Observable.bindCallback(someFunction);
     * boundSomeFunction().subscribe(values => {
     *   console.log(values) // [5, 'some string', {someProperty: 'someValue'}]
     * });
     *
     *
     * @example <caption>Use bindCallback with selector function</caption>
     * someFunction((a, b, c) => {
     *   console.log(a); // 'a'
     *   console.log(b); // 'b'
     *   console.log(c); // 'c'
     * });
     *
     * const boundSomeFunction = Rx.Observable.bindCallback(someFunction, (a, b, c) => a + b + c);
     * boundSomeFunction().subscribe(value => {
     *   console.log(value) // 'abc'
     * });
     *
     *
     * @example <caption>Compare behaviour with and without async Scheduler</caption>
     * function iCallMyCallbackSynchronously(cb) {
     *   cb();
     * }
     *
     * const boundSyncFn = Rx.Observable.bindCallback(iCallMyCallbackSynchronously);
     * const boundAsyncFn = Rx.Observable.bindCallback(iCallMyCallbackSynchronously, null, Rx.Scheduler.async);
     *
     * boundSyncFn().subscribe(() => console.log('I was sync!'));
     * boundAsyncFn().subscribe(() => console.log('I was async!'));
     * console.log('This happened...');
     *
     * // Logs:
     * // I was sync!
     * // This happened...
     * // I was async!
     *
     *
     * @example <caption>Use bindCallback on object method</caption>
     * const boundMethod = Rx.Observable.bindCallback(someObject.methodWithCallback);
     * boundMethod.call(someObject) // make sure methodWithCallback has access to someObject
     * .subscribe(subscriber);
     *
     *
     * @see {@link bindNodeCallback}
     * @see {@link from}
     * @see {@link fromPromise}
     *
     * @param {function} func Function with a callback as the last parameter.
     * @param {function} [selector] A function which takes the arguments from the
     * callback and maps those to a value to emit on the output Observable.
     * @param {Scheduler} [scheduler] The scheduler on which to schedule the
     * callbacks.
     * @return {function(...params: *): Observable} A function which returns the
     * Observable that delivers the same values the callback would deliver.
     * @static true
     * @name bindCallback
     * @owner Observable
     */
    BoundCallbackObservable.create = function (func, selector, scheduler) {
        if (selector === void 0) { selector = undefined; }
        return function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i - 0] = arguments[_i];
            }
            return new BoundCallbackObservable(func, selector, args, this, scheduler);
        };
    };
    BoundCallbackObservable.prototype._subscribe = function (subscriber) {
        var callbackFunc = this.callbackFunc;
        var args = this.args;
        var scheduler = this.scheduler;
        var subject = this.subject;
        if (!scheduler) {
            if (!subject) {
                subject = this.subject = new AsyncSubject_1.AsyncSubject();
                var handler = function handlerFn() {
                    var innerArgs = [];
                    for (var _i = 0; _i < arguments.length; _i++) {
                        innerArgs[_i - 0] = arguments[_i];
                    }
                    var source = handlerFn.source;
                    var selector = source.selector, subject = source.subject;
                    if (selector) {
                        var result_1 = tryCatch_1.tryCatch(selector).apply(this, innerArgs);
                        if (result_1 === errorObject_1.errorObject) {
                            subject.error(errorObject_1.errorObject.e);
                        }
                        else {
                            subject.next(result_1);
                            subject.complete();
                        }
                    }
                    else {
                        subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
                        subject.complete();
                    }
                };
                // use named function instance to avoid closure.
                handler.source = this;
                var result = tryCatch_1.tryCatch(callbackFunc).apply(this.context, args.concat(handler));
                if (result === errorObject_1.errorObject) {
                    subject.error(errorObject_1.errorObject.e);
                }
            }
            return subject.subscribe(subscriber);
        }
        else {
            return scheduler.schedule(BoundCallbackObservable.dispatch, 0, { source: this, subscriber: subscriber, context: this.context });
        }
    };
    BoundCallbackObservable.dispatch = function (state) {
        var self = this;
        var source = state.source, subscriber = state.subscriber, context = state.context;
        var callbackFunc = source.callbackFunc, args = source.args, scheduler = source.scheduler;
        var subject = source.subject;
        if (!subject) {
            subject = source.subject = new AsyncSubject_1.AsyncSubject();
            var handler = function handlerFn() {
                var innerArgs = [];
                for (var _i = 0; _i < arguments.length; _i++) {
                    innerArgs[_i - 0] = arguments[_i];
                }
                var source = handlerFn.source;
                var selector = source.selector, subject = source.subject;
                if (selector) {
                    var result_2 = tryCatch_1.tryCatch(selector).apply(this, innerArgs);
                    if (result_2 === errorObject_1.errorObject) {
                        self.add(scheduler.schedule(dispatchError, 0, { err: errorObject_1.errorObject.e, subject: subject }));
                    }
                    else {
                        self.add(scheduler.schedule(dispatchNext, 0, { value: result_2, subject: subject }));
                    }
                }
                else {
                    var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
                    self.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
                }
            };
            // use named function to pass values in without closure
            handler.source = source;
            var result = tryCatch_1.tryCatch(callbackFunc).apply(context, args.concat(handler));
            if (result === errorObject_1.errorObject) {
                subject.error(errorObject_1.errorObject.e);
            }
        }
        self.add(subject.subscribe(subscriber));
    };
    return BoundCallbackObservable;
}(Observable_1.Observable));
exports.BoundCallbackObservable = BoundCallbackObservable;
function dispatchNext(arg) {
    var value = arg.value, subject = arg.subject;
    subject.next(value);
    subject.complete();
}
function dispatchError(arg) {
    var err = arg.err, subject = arg.subject;
    subject.error(err);
}
//# sourceMappingURL=BoundCallbackObservable.js.map

/***/ }),
/* 911 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var AsyncSubject_1 = __webpack_require__(144);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var BoundNodeCallbackObservable = (function (_super) {
    __extends(BoundNodeCallbackObservable, _super);
    function BoundNodeCallbackObservable(callbackFunc, selector, args, context, scheduler) {
        _super.call(this);
        this.callbackFunc = callbackFunc;
        this.selector = selector;
        this.args = args;
        this.context = context;
        this.scheduler = scheduler;
    }
    /* tslint:enable:max-line-length */
    /**
     * Converts a Node.js-style callback API to a function that returns an
     * Observable.
     *
     * <span class="informal">It's just like {@link bindCallback}, but the
     * callback is expected to be of type `callback(error, result)`.</span>
     *
     * `bindNodeCallback` is not an operator because its input and output are not
     * Observables. The input is a function `func` with some parameters, but the
     * last parameter must be a callback function that `func` calls when it is
     * done. The callback function is expected to follow Node.js conventions,
     * where the first argument to the callback is an error object, signaling
     * whether call was successful. If that object is passed to callback, it means
     * something went wrong.
     *
     * The output of `bindNodeCallback` is a function that takes the same
     * parameters as `func`, except the last one (the callback). When the output
     * function is called with arguments, it will return an Observable.
     * If `func` calls its callback with error parameter present, Observable will
     * error with that value as well. If error parameter is not passed, Observable will emit
     * second parameter. If there are more parameters (third and so on),
     * Observable will emit an array with all arguments, except first error argument.
     *
     * Optionally `bindNodeCallback` accepts selector function, which allows you to
     * make resulting Observable emit value computed by selector, instead of regular
     * callback arguments. It works similarly to {@link bindCallback} selector, but
     * Node.js-style error argument will never be passed to that function.
     *
     * Note that `func` will not be called at the same time output function is,
     * but rather whenever resulting Observable is subscribed. By default call to
     * `func` will happen synchronously after subscription, but that can be changed
     * with proper {@link Scheduler} provided as optional third parameter. Scheduler
     * can also control when values from callback will be emitted by Observable.
     * To find out more, check out documentation for {@link bindCallback}, where
     * Scheduler works exactly the same.
     *
     * As in {@link bindCallback}, context (`this` property) of input function will be set to context
     * of returned function, when it is called.
     *
     * After Observable emits value, it will complete immediately. This means
     * even if `func` calls callback again, values from second and consecutive
     * calls will never appear on the stream. If you need to handle functions
     * that call callbacks multiple times, check out {@link fromEvent} or
     * {@link fromEventPattern} instead.
     *
     * Note that `bindNodeCallback` can be used in non-Node.js environments as well.
     * "Node.js-style" callbacks are just a convention, so if you write for
     * browsers or any other environment and API you use implements that callback style,
     * `bindNodeCallback` can be safely used on that API functions as well.
     *
     * Remember that Error object passed to callback does not have to be an instance
     * of JavaScript built-in `Error` object. In fact, it does not even have to an object.
     * Error parameter of callback function is interpreted as "present", when value
     * of that parameter is truthy. It could be, for example, non-zero number, non-empty
     * string or boolean `true`. In all of these cases resulting Observable would error
     * with that value. This means usually regular style callbacks will fail very often when
     * `bindNodeCallback` is used. If your Observable errors much more often then you
     * would expect, check if callback really is called in Node.js-style and, if not,
     * switch to {@link bindCallback} instead.
     *
     * Note that even if error parameter is technically present in callback, but its value
     * is falsy, it still won't appear in array emitted by Observable or in selector function.
     *
     *
     * @example <caption>Read a file from the filesystem and get the data as an Observable</caption>
     * import * as fs from 'fs';
     * var readFileAsObservable = Rx.Observable.bindNodeCallback(fs.readFile);
     * var result = readFileAsObservable('./roadNames.txt', 'utf8');
     * result.subscribe(x => console.log(x), e => console.error(e));
     *
     *
     * @example <caption>Use on function calling callback with multiple arguments</caption>
     * someFunction((err, a, b) => {
     *   console.log(err); // null
     *   console.log(a); // 5
     *   console.log(b); // "some string"
     * });
     * var boundSomeFunction = Rx.Observable.bindNodeCallback(someFunction);
     * boundSomeFunction()
     * .subscribe(value => {
     *   console.log(value); // [5, "some string"]
     * });
     *
     *
     * @example <caption>Use with selector function</caption>
     * someFunction((err, a, b) => {
     *   console.log(err); // undefined
     *   console.log(a); // "abc"
     *   console.log(b); // "DEF"
     * });
     * var boundSomeFunction = Rx.Observable.bindNodeCallback(someFunction, (a, b) => a + b);
     * boundSomeFunction()
     * .subscribe(value => {
     *   console.log(value); // "abcDEF"
     * });
     *
     *
     * @example <caption>Use on function calling callback in regular style</caption>
     * someFunction(a => {
     *   console.log(a); // 5
     * });
     * var boundSomeFunction = Rx.Observable.bindNodeCallback(someFunction);
     * boundSomeFunction()
     * .subscribe(
     *   value => {}             // never gets called
     *   err => console.log(err) // 5
     *);
     *
     *
     * @see {@link bindCallback}
     * @see {@link from}
     * @see {@link fromPromise}
     *
     * @param {function} func Function with a Node.js-style callback as the last parameter.
     * @param {function} [selector] A function which takes the arguments from the
     * callback and maps those to a value to emit on the output Observable.
     * @param {Scheduler} [scheduler] The scheduler on which to schedule the
     * callbacks.
     * @return {function(...params: *): Observable} A function which returns the
     * Observable that delivers the same values the Node.js callback would
     * deliver.
     * @static true
     * @name bindNodeCallback
     * @owner Observable
     */
    BoundNodeCallbackObservable.create = function (func, selector, scheduler) {
        if (selector === void 0) { selector = undefined; }
        return function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i - 0] = arguments[_i];
            }
            return new BoundNodeCallbackObservable(func, selector, args, this, scheduler);
        };
    };
    BoundNodeCallbackObservable.prototype._subscribe = function (subscriber) {
        var callbackFunc = this.callbackFunc;
        var args = this.args;
        var scheduler = this.scheduler;
        var subject = this.subject;
        if (!scheduler) {
            if (!subject) {
                subject = this.subject = new AsyncSubject_1.AsyncSubject();
                var handler = function handlerFn() {
                    var innerArgs = [];
                    for (var _i = 0; _i < arguments.length; _i++) {
                        innerArgs[_i - 0] = arguments[_i];
                    }
                    var source = handlerFn.source;
                    var selector = source.selector, subject = source.subject;
                    var err = innerArgs.shift();
                    if (err) {
                        subject.error(err);
                    }
                    else if (selector) {
                        var result_1 = tryCatch_1.tryCatch(selector).apply(this, innerArgs);
                        if (result_1 === errorObject_1.errorObject) {
                            subject.error(errorObject_1.errorObject.e);
                        }
                        else {
                            subject.next(result_1);
                            subject.complete();
                        }
                    }
                    else {
                        subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
                        subject.complete();
                    }
                };
                // use named function instance to avoid closure.
                handler.source = this;
                var result = tryCatch_1.tryCatch(callbackFunc).apply(this.context, args.concat(handler));
                if (result === errorObject_1.errorObject) {
                    subject.error(errorObject_1.errorObject.e);
                }
            }
            return subject.subscribe(subscriber);
        }
        else {
            return scheduler.schedule(dispatch, 0, { source: this, subscriber: subscriber, context: this.context });
        }
    };
    return BoundNodeCallbackObservable;
}(Observable_1.Observable));
exports.BoundNodeCallbackObservable = BoundNodeCallbackObservable;
function dispatch(state) {
    var self = this;
    var source = state.source, subscriber = state.subscriber, context = state.context;
    // XXX: cast to `any` to access to the private field in `source`.
    var _a = source, callbackFunc = _a.callbackFunc, args = _a.args, scheduler = _a.scheduler;
    var subject = source.subject;
    if (!subject) {
        subject = source.subject = new AsyncSubject_1.AsyncSubject();
        var handler = function handlerFn() {
            var innerArgs = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                innerArgs[_i - 0] = arguments[_i];
            }
            var source = handlerFn.source;
            var selector = source.selector, subject = source.subject;
            var err = innerArgs.shift();
            if (err) {
                self.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
            }
            else if (selector) {
                var result_2 = tryCatch_1.tryCatch(selector).apply(this, innerArgs);
                if (result_2 === errorObject_1.errorObject) {
                    self.add(scheduler.schedule(dispatchError, 0, { err: errorObject_1.errorObject.e, subject: subject }));
                }
                else {
                    self.add(scheduler.schedule(dispatchNext, 0, { value: result_2, subject: subject }));
                }
            }
            else {
                var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
                self.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
            }
        };
        // use named function to pass values in without closure
        handler.source = source;
        var result = tryCatch_1.tryCatch(callbackFunc).apply(context, args.concat(handler));
        if (result === errorObject_1.errorObject) {
            self.add(scheduler.schedule(dispatchError, 0, { err: errorObject_1.errorObject.e, subject: subject }));
        }
    }
    self.add(subject.subscribe(subscriber));
}
function dispatchNext(arg) {
    var value = arg.value, subject = arg.subject;
    subject.next(value);
    subject.complete();
}
function dispatchError(arg) {
    var err = arg.err, subject = arg.subject;
    subject.error(err);
}
//# sourceMappingURL=BoundNodeCallbackObservable.js.map

/***/ }),
/* 912 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var subscribeToResult_1 = __webpack_require__(10);
var OuterSubscriber_1 = __webpack_require__(9);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var DeferObservable = (function (_super) {
    __extends(DeferObservable, _super);
    function DeferObservable(observableFactory) {
        _super.call(this);
        this.observableFactory = observableFactory;
    }
    /**
     * Creates an Observable that, on subscribe, calls an Observable factory to
     * make an Observable for each new Observer.
     *
     * <span class="informal">Creates the Observable lazily, that is, only when it
     * is subscribed.
     * </span>
     *
     * <img src="./img/defer.png" width="100%">
     *
     * `defer` allows you to create the Observable only when the Observer
     * subscribes, and create a fresh Observable for each Observer. It waits until
     * an Observer subscribes to it, and then it generates an Observable,
     * typically with an Observable factory function. It does this afresh for each
     * subscriber, so although each subscriber may think it is subscribing to the
     * same Observable, in fact each subscriber gets its own individual
     * Observable.
     *
     * @example <caption>Subscribe to either an Observable of clicks or an Observable of interval, at random</caption>
     * var clicksOrInterval = Rx.Observable.defer(function () {
     *   if (Math.random() > 0.5) {
     *     return Rx.Observable.fromEvent(document, 'click');
     *   } else {
     *     return Rx.Observable.interval(1000);
     *   }
     * });
     * clicksOrInterval.subscribe(x => console.log(x));
     *
     * // Results in the following behavior:
     * // If the result of Math.random() is greater than 0.5 it will listen
     * // for clicks anywhere on the "document"; when document is clicked it
     * // will log a MouseEvent object to the console. If the result is less
     * // than 0.5 it will emit ascending numbers, one every second(1000ms).
     *
     * @see {@link create}
     *
     * @param {function(): SubscribableOrPromise} observableFactory The Observable
     * factory function to invoke for each Observer that subscribes to the output
     * Observable. May also return a Promise, which will be converted on the fly
     * to an Observable.
     * @return {Observable} An Observable whose Observers' subscriptions trigger
     * an invocation of the given Observable factory function.
     * @static true
     * @name defer
     * @owner Observable
     */
    DeferObservable.create = function (observableFactory) {
        return new DeferObservable(observableFactory);
    };
    DeferObservable.prototype._subscribe = function (subscriber) {
        return new DeferSubscriber(subscriber, this.observableFactory);
    };
    return DeferObservable;
}(Observable_1.Observable));
exports.DeferObservable = DeferObservable;
var DeferSubscriber = (function (_super) {
    __extends(DeferSubscriber, _super);
    function DeferSubscriber(destination, factory) {
        _super.call(this, destination);
        this.factory = factory;
        this.tryDefer();
    }
    DeferSubscriber.prototype.tryDefer = function () {
        try {
            this._callFactory();
        }
        catch (err) {
            this._error(err);
        }
    };
    DeferSubscriber.prototype._callFactory = function () {
        var result = this.factory();
        if (result) {
            this.add(subscribeToResult_1.subscribeToResult(this, result));
        }
    };
    return DeferSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=DeferObservable.js.map

/***/ }),
/* 913 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var ErrorObservable = (function (_super) {
    __extends(ErrorObservable, _super);
    function ErrorObservable(error, scheduler) {
        _super.call(this);
        this.error = error;
        this.scheduler = scheduler;
    }
    /**
     * Creates an Observable that emits no items to the Observer and immediately
     * emits an error notification.
     *
     * <span class="informal">Just emits 'error', and nothing else.
     * </span>
     *
     * <img src="./img/throw.png" width="100%">
     *
     * This static operator is useful for creating a simple Observable that only
     * emits the error notification. It can be used for composing with other
     * Observables, such as in a {@link mergeMap}.
     *
     * @example <caption>Emit the number 7, then emit an error.</caption>
     * var result = Rx.Observable.throw(new Error('oops!')).startWith(7);
     * result.subscribe(x => console.log(x), e => console.error(e));
     *
     * @example <caption>Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>
     * var interval = Rx.Observable.interval(1000);
     * var result = interval.mergeMap(x =>
     *   x === 13 ?
     *     Rx.Observable.throw('Thirteens are bad') :
     *     Rx.Observable.of('a', 'b', 'c')
     * );
     * result.subscribe(x => console.log(x), e => console.error(e));
     *
     * @see {@link create}
     * @see {@link empty}
     * @see {@link never}
     * @see {@link of}
     *
     * @param {any} error The particular Error to pass to the error notification.
     * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
     * the emission of the error notification.
     * @return {Observable} An error Observable: emits only the error notification
     * using the given error argument.
     * @static true
     * @name throw
     * @owner Observable
     */
    ErrorObservable.create = function (error, scheduler) {
        return new ErrorObservable(error, scheduler);
    };
    ErrorObservable.dispatch = function (arg) {
        var error = arg.error, subscriber = arg.subscriber;
        subscriber.error(error);
    };
    ErrorObservable.prototype._subscribe = function (subscriber) {
        var error = this.error;
        var scheduler = this.scheduler;
        subscriber.syncErrorThrowable = true;
        if (scheduler) {
            return scheduler.schedule(ErrorObservable.dispatch, 0, {
                error: error, subscriber: subscriber
            });
        }
        else {
            subscriber.error(error);
        }
    };
    return ErrorObservable;
}(Observable_1.Observable));
exports.ErrorObservable = ErrorObservable;
//# sourceMappingURL=ErrorObservable.js.map

/***/ }),
/* 914 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var tryCatch_1 = __webpack_require__(21);
var isFunction_1 = __webpack_require__(525);
var errorObject_1 = __webpack_require__(20);
var Subscription_1 = __webpack_require__(16);
var toString = Object.prototype.toString;
function isNodeStyleEventEmitter(sourceObj) {
    return !!sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
}
function isJQueryStyleEventEmitter(sourceObj) {
    return !!sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
}
function isNodeList(sourceObj) {
    return !!sourceObj && toString.call(sourceObj) === '[object NodeList]';
}
function isHTMLCollection(sourceObj) {
    return !!sourceObj && toString.call(sourceObj) === '[object HTMLCollection]';
}
function isEventTarget(sourceObj) {
    return !!sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
}
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var FromEventObservable = (function (_super) {
    __extends(FromEventObservable, _super);
    function FromEventObservable(sourceObj, eventName, selector, options) {
        _super.call(this);
        this.sourceObj = sourceObj;
        this.eventName = eventName;
        this.selector = selector;
        this.options = options;
    }
    /* tslint:enable:max-line-length */
    /**
     * Creates an Observable that emits events of a specific type coming from the
     * given event target.
     *
     * <span class="informal">Creates an Observable from DOM events, or Node
     * EventEmitter events or others.</span>
     *
     * <img src="./img/fromEvent.png" width="100%">
     *
     * Creates an Observable by attaching an event listener to an "event target",
     * which may be an object with `addEventListener` and `removeEventListener`,
     * a Node.js EventEmitter, a jQuery style EventEmitter, a NodeList from the
     * DOM, or an HTMLCollection from the DOM. The event handler is attached when
     * the output Observable is subscribed, and removed when the Subscription is
     * unsubscribed.
     *
     * @example <caption>Emits clicks happening on the DOM document</caption>
     * var clicks = Rx.Observable.fromEvent(document, 'click');
     * clicks.subscribe(x => console.log(x));
     *
     * // Results in:
     * // MouseEvent object logged to console everytime a click
     * // occurs on the document.
     *
     * @see {@link from}
     * @see {@link fromEventPattern}
     *
     * @param {EventTargetLike} target The DOMElement, event target, Node.js
     * EventEmitter, NodeList or HTMLCollection to attach the event handler to.
     * @param {string} eventName The event name of interest, being emitted by the
     * `target`.
     * @param {EventListenerOptions} [options] Options to pass through to addEventListener
     * @param {SelectorMethodSignature<T>} [selector] An optional function to
     * post-process results. It takes the arguments from the event handler and
     * should return a single value.
     * @return {Observable<T>}
     * @static true
     * @name fromEvent
     * @owner Observable
     */
    FromEventObservable.create = function (target, eventName, options, selector) {
        if (isFunction_1.isFunction(options)) {
            selector = options;
            options = undefined;
        }
        return new FromEventObservable(target, eventName, selector, options);
    };
    FromEventObservable.setupSubscription = function (sourceObj, eventName, handler, subscriber, options) {
        var unsubscribe;
        if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) {
            for (var i = 0, len = sourceObj.length; i < len; i++) {
                FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
            }
        }
        else if (isEventTarget(sourceObj)) {
            var source_1 = sourceObj;
            sourceObj.addEventListener(eventName, handler, options);
            unsubscribe = function () { return source_1.removeEventListener(eventName, handler); };
        }
        else if (isJQueryStyleEventEmitter(sourceObj)) {
            var source_2 = sourceObj;
            sourceObj.on(eventName, handler);
            unsubscribe = function () { return source_2.off(eventName, handler); };
        }
        else if (isNodeStyleEventEmitter(sourceObj)) {
            var source_3 = sourceObj;
            sourceObj.addListener(eventName, handler);
            unsubscribe = function () { return source_3.removeListener(eventName, handler); };
        }
        else {
            throw new TypeError('Invalid event target');
        }
        subscriber.add(new Subscription_1.Subscription(unsubscribe));
    };
    FromEventObservable.prototype._subscribe = function (subscriber) {
        var sourceObj = this.sourceObj;
        var eventName = this.eventName;
        var options = this.options;
        var selector = this.selector;
        var handler = selector ? function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i - 0] = arguments[_i];
            }
            var result = tryCatch_1.tryCatch(selector).apply(void 0, args);
            if (result === errorObject_1.errorObject) {
                subscriber.error(errorObject_1.errorObject.e);
            }
            else {
                subscriber.next(result);
            }
        } : function (e) { return subscriber.next(e); };
        FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber, options);
    };
    return FromEventObservable;
}(Observable_1.Observable));
exports.FromEventObservable = FromEventObservable;
//# sourceMappingURL=FromEventObservable.js.map

/***/ }),
/* 915 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 isFunction_1 = __webpack_require__(525);
var Observable_1 = __webpack_require__(1);
var Subscription_1 = __webpack_require__(16);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var FromEventPatternObservable = (function (_super) {
    __extends(FromEventPatternObservable, _super);
    function FromEventPatternObservable(addHandler, removeHandler, selector) {
        _super.call(this);
        this.addHandler = addHandler;
        this.removeHandler = removeHandler;
        this.selector = selector;
    }
    /**
     * Creates an Observable from an API based on addHandler/removeHandler
     * functions.
     *
     * <span class="informal">Converts any addHandler/removeHandler API to an
     * Observable.</span>
     *
     * <img src="./img/fromEventPattern.png" width="100%">
     *
     * Creates an Observable by using the `addHandler` and `removeHandler`
     * functions to add and remove the handlers, with an optional selector
     * function to project the event arguments to a result. The `addHandler` is
     * called when the output Observable is subscribed, and `removeHandler` is
     * called when the Subscription is unsubscribed.
     *
     * @example <caption>Emits clicks happening on the DOM document</caption>
     * function addClickHandler(handler) {
     *   document.addEventListener('click', handler);
     * }
     *
     * function removeClickHandler(handler) {
     *   document.removeEventListener('click', handler);
     * }
     *
     * var clicks = Rx.Observable.fromEventPattern(
     *   addClickHandler,
     *   removeClickHandler
     * );
     * clicks.subscribe(x => console.log(x));
     *
     * @see {@link from}
     * @see {@link fromEvent}
     *
     * @param {function(handler: Function): any} addHandler A function that takes
     * a `handler` function as argument and attaches it somehow to the actual
     * source of events.
     * @param {function(handler: Function, signal?: any): void} [removeHandler] An optional function that
     * takes a `handler` function as argument and removes it in case it was
     * previously attached using `addHandler`. if addHandler returns signal to teardown when remove,
     * removeHandler function will forward it.
     * @param {function(...args: any): T} [selector] An optional function to
     * post-process results. It takes the arguments from the event handler and
     * should return a single value.
     * @return {Observable<T>}
     * @static true
     * @name fromEventPattern
     * @owner Observable
     */
    FromEventPatternObservable.create = function (addHandler, removeHandler, selector) {
        return new FromEventPatternObservable(addHandler, removeHandler, selector);
    };
    FromEventPatternObservable.prototype._subscribe = function (subscriber) {
        var _this = this;
        var removeHandler = this.removeHandler;
        var handler = !!this.selector ? function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i - 0] = arguments[_i];
            }
            _this._callSelector(subscriber, args);
        } : function (e) { subscriber.next(e); };
        var retValue = this._callAddHandler(handler, subscriber);
        if (!isFunction_1.isFunction(removeHandler)) {
            return;
        }
        subscriber.add(new Subscription_1.Subscription(function () {
            //TODO: determine whether or not to forward to error handler
            removeHandler(handler, retValue);
        }));
    };
    FromEventPatternObservable.prototype._callSelector = function (subscriber, args) {
        try {
            var result = this.selector.apply(this, args);
            subscriber.next(result);
        }
        catch (e) {
            subscriber.error(e);
        }
    };
    FromEventPatternObservable.prototype._callAddHandler = function (handler, errorSubscriber) {
        try {
            return this.addHandler(handler) || null;
        }
        catch (e) {
            errorSubscriber.error(e);
        }
    };
    return FromEventPatternObservable;
}(Observable_1.Observable));
exports.FromEventPatternObservable = FromEventPatternObservable;
//# sourceMappingURL=FromEventPatternObservable.js.map

/***/ }),
/* 916 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var isScheduler_1 = __webpack_require__(57);
var selfSelector = function (value) { return value; };
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var GenerateObservable = (function (_super) {
    __extends(GenerateObservable, _super);
    function GenerateObservable(initialState, condition, iterate, resultSelector, scheduler) {
        _super.call(this);
        this.initialState = initialState;
        this.condition = condition;
        this.iterate = iterate;
        this.resultSelector = resultSelector;
        this.scheduler = scheduler;
    }
    GenerateObservable.create = function (initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
        if (arguments.length == 1) {
            return new GenerateObservable(initialStateOrOptions.initialState, initialStateOrOptions.condition, initialStateOrOptions.iterate, initialStateOrOptions.resultSelector || selfSelector, initialStateOrOptions.scheduler);
        }
        if (resultSelectorOrObservable === undefined || isScheduler_1.isScheduler(resultSelectorOrObservable)) {
            return new GenerateObservable(initialStateOrOptions, condition, iterate, selfSelector, resultSelectorOrObservable);
        }
        return new GenerateObservable(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler);
    };
    GenerateObservable.prototype._subscribe = function (subscriber) {
        var state = this.initialState;
        if (this.scheduler) {
            return this.scheduler.schedule(GenerateObservable.dispatch, 0, {
                subscriber: subscriber,
                iterate: this.iterate,
                condition: this.condition,
                resultSelector: this.resultSelector,
                state: state });
        }
        var _a = this, condition = _a.condition, resultSelector = _a.resultSelector, iterate = _a.iterate;
        do {
            if (condition) {
                var conditionResult = void 0;
                try {
                    conditionResult = condition(state);
                }
                catch (err) {
                    subscriber.error(err);
                    return;
                }
                if (!conditionResult) {
                    subscriber.complete();
                    break;
                }
            }
            var value = void 0;
            try {
                value = resultSelector(state);
            }
            catch (err) {
                subscriber.error(err);
                return;
            }
            subscriber.next(value);
            if (subscriber.closed) {
                break;
            }
            try {
                state = iterate(state);
            }
            catch (err) {
                subscriber.error(err);
                return;
            }
        } while (true);
    };
    GenerateObservable.dispatch = function (state) {
        var subscriber = state.subscriber, condition = state.condition;
        if (subscriber.closed) {
            return;
        }
        if (state.needIterate) {
            try {
                state.state = state.iterate(state.state);
            }
            catch (err) {
                subscriber.error(err);
                return;
            }
        }
        else {
            state.needIterate = true;
        }
        if (condition) {
            var conditionResult = void 0;
            try {
                conditionResult = condition(state.state);
            }
            catch (err) {
                subscriber.error(err);
                return;
            }
            if (!conditionResult) {
                subscriber.complete();
                return;
            }
            if (subscriber.closed) {
                return;
            }
        }
        var value;
        try {
            value = state.resultSelector(state.state);
        }
        catch (err) {
            subscriber.error(err);
            return;
        }
        if (subscriber.closed) {
            return;
        }
        subscriber.next(value);
        if (subscriber.closed) {
            return;
        }
        return this.schedule(state);
    };
    return GenerateObservable;
}(Observable_1.Observable));
exports.GenerateObservable = GenerateObservable;
//# sourceMappingURL=GenerateObservable.js.map

/***/ }),
/* 917 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var subscribeToResult_1 = __webpack_require__(10);
var OuterSubscriber_1 = __webpack_require__(9);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var IfObservable = (function (_super) {
    __extends(IfObservable, _super);
    function IfObservable(condition, thenSource, elseSource) {
        _super.call(this);
        this.condition = condition;
        this.thenSource = thenSource;
        this.elseSource = elseSource;
    }
    IfObservable.create = function (condition, thenSource, elseSource) {
        return new IfObservable(condition, thenSource, elseSource);
    };
    IfObservable.prototype._subscribe = function (subscriber) {
        var _a = this, condition = _a.condition, thenSource = _a.thenSource, elseSource = _a.elseSource;
        return new IfSubscriber(subscriber, condition, thenSource, elseSource);
    };
    return IfObservable;
}(Observable_1.Observable));
exports.IfObservable = IfObservable;
var IfSubscriber = (function (_super) {
    __extends(IfSubscriber, _super);
    function IfSubscriber(destination, condition, thenSource, elseSource) {
        _super.call(this, destination);
        this.condition = condition;
        this.thenSource = thenSource;
        this.elseSource = elseSource;
        this.tryIf();
    }
    IfSubscriber.prototype.tryIf = function () {
        var _a = this, condition = _a.condition, thenSource = _a.thenSource, elseSource = _a.elseSource;
        var result;
        try {
            result = condition();
            var source = result ? thenSource : elseSource;
            if (source) {
                this.add(subscribeToResult_1.subscribeToResult(this, source));
            }
            else {
                this._complete();
            }
        }
        catch (err) {
            this._error(err);
        }
    };
    return IfSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=IfObservable.js.map

/***/ }),
/* 918 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 isNumeric_1 = __webpack_require__(149);
var Observable_1 = __webpack_require__(1);
var async_1 = __webpack_require__(23);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var IntervalObservable = (function (_super) {
    __extends(IntervalObservable, _super);
    function IntervalObservable(period, scheduler) {
        if (period === void 0) { period = 0; }
        if (scheduler === void 0) { scheduler = async_1.async; }
        _super.call(this);
        this.period = period;
        this.scheduler = scheduler;
        if (!isNumeric_1.isNumeric(period) || period < 0) {
            this.period = 0;
        }
        if (!scheduler || typeof scheduler.schedule !== 'function') {
            this.scheduler = async_1.async;
        }
    }
    /**
     * Creates an Observable that emits sequential numbers every specified
     * interval of time, on a specified IScheduler.
     *
     * <span class="informal">Emits incremental numbers periodically in time.
     * </span>
     *
     * <img src="./img/interval.png" width="100%">
     *
     * `interval` returns an Observable that emits an infinite sequence of
     * ascending integers, with a constant interval of time of your choosing
     * between those emissions. The first emission is not sent immediately, but
     * only after the first period has passed. By default, this operator uses the
     * `async` IScheduler to provide a notion of time, but you may pass any
     * IScheduler to it.
     *
     * @example <caption>Emits ascending numbers, one every second (1000ms)</caption>
     * var numbers = Rx.Observable.interval(1000);
     * numbers.subscribe(x => console.log(x));
     *
     * @see {@link timer}
     * @see {@link delay}
     *
     * @param {number} [period=0] The interval size in milliseconds (by default)
     * or the time unit determined by the scheduler's clock.
     * @param {Scheduler} [scheduler=async] The IScheduler to use for scheduling
     * the emission of values, and providing a notion of "time".
     * @return {Observable} An Observable that emits a sequential number each time
     * interval.
     * @static true
     * @name interval
     * @owner Observable
     */
    IntervalObservable.create = function (period, scheduler) {
        if (period === void 0) { period = 0; }
        if (scheduler === void 0) { scheduler = async_1.async; }
        return new IntervalObservable(period, scheduler);
    };
    IntervalObservable.dispatch = function (state) {
        var index = state.index, subscriber = state.subscriber, period = state.period;
        subscriber.next(index);
        if (subscriber.closed) {
            return;
        }
        state.index += 1;
        this.schedule(state, period);
    };
    IntervalObservable.prototype._subscribe = function (subscriber) {
        var index = 0;
        var period = this.period;
        var scheduler = this.scheduler;
        subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, {
            index: index, subscriber: subscriber, period: period
        }));
    };
    return IntervalObservable;
}(Observable_1.Observable));
exports.IntervalObservable = IntervalObservable;
//# sourceMappingURL=IntervalObservable.js.map

/***/ }),
/* 919 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var noop_1 = __webpack_require__(519);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var NeverObservable = (function (_super) {
    __extends(NeverObservable, _super);
    function NeverObservable() {
        _super.call(this);
    }
    /**
     * Creates an Observable that emits no items to the Observer.
     *
     * <span class="informal">An Observable that never emits anything.</span>
     *
     * <img src="./img/never.png" width="100%">
     *
     * This static operator is useful for creating a simple Observable that emits
     * neither values nor errors nor the completion notification. It can be used
     * for testing purposes or for composing with other Observables. Please note
     * that by never emitting a complete notification, this Observable keeps the
     * subscription from being disposed automatically. Subscriptions need to be
     * manually disposed.
     *
     * @example <caption>Emit the number 7, then never emit anything else (not even complete).</caption>
     * function info() {
     *   console.log('Will not be called');
     * }
     * var result = Rx.Observable.never().startWith(7);
     * result.subscribe(x => console.log(x), info, info);
     *
     * @see {@link create}
     * @see {@link empty}
     * @see {@link of}
     * @see {@link throw}
     *
     * @return {Observable} A "never" Observable: never emits anything.
     * @static true
     * @name never
     * @owner Observable
     */
    NeverObservable.create = function () {
        return new NeverObservable();
    };
    NeverObservable.prototype._subscribe = function (subscriber) {
        noop_1.noop();
    };
    return NeverObservable;
}(Observable_1.Observable));
exports.NeverObservable = NeverObservable;
//# sourceMappingURL=NeverObservable.js.map

/***/ }),
/* 920 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
function dispatch(state) {
    var obj = state.obj, keys = state.keys, length = state.length, index = state.index, subscriber = state.subscriber;
    if (index === length) {
        subscriber.complete();
        return;
    }
    var key = keys[index];
    subscriber.next([key, obj[key]]);
    state.index = index + 1;
    this.schedule(state);
}
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var PairsObservable = (function (_super) {
    __extends(PairsObservable, _super);
    function PairsObservable(obj, scheduler) {
        _super.call(this);
        this.obj = obj;
        this.scheduler = scheduler;
        this.keys = Object.keys(obj);
    }
    /**
     * Convert an object into an observable sequence of [key, value] pairs
     * using an optional IScheduler to enumerate the object.
     *
     * @example <caption>Converts a javascript object to an Observable</caption>
     * var obj = {
     *   foo: 42,
     *   bar: 56,
     *   baz: 78
     * };
     *
     * var source = Rx.Observable.pairs(obj);
     *
     * var subscription = source.subscribe(
     *   function (x) {
     *     console.log('Next: %s', x);
     *   },
     *   function (err) {
     *     console.log('Error: %s', err);
     *   },
     *   function () {
     *     console.log('Completed');
     *   });
     *
     * @param {Object} obj The object to inspect and turn into an
     * Observable sequence.
     * @param {Scheduler} [scheduler] An optional IScheduler to run the
     * enumeration of the input sequence on.
     * @returns {(Observable<Array<string | T>>)} An observable sequence of
     * [key, value] pairs from the object.
     */
    PairsObservable.create = function (obj, scheduler) {
        return new PairsObservable(obj, scheduler);
    };
    PairsObservable.prototype._subscribe = function (subscriber) {
        var _a = this, keys = _a.keys, scheduler = _a.scheduler;
        var length = keys.length;
        if (scheduler) {
            return scheduler.schedule(dispatch, 0, {
                obj: this.obj, keys: keys, length: length, index: 0, subscriber: subscriber
            });
        }
        else {
            for (var idx = 0; idx < length; idx++) {
                var key = keys[idx];
                subscriber.next([key, this.obj[key]]);
            }
            subscriber.complete();
        }
    };
    return PairsObservable;
}(Observable_1.Observable));
exports.PairsObservable = PairsObservable;
//# sourceMappingURL=PairsObservable.js.map

/***/ }),
/* 921 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var RangeObservable = (function (_super) {
    __extends(RangeObservable, _super);
    function RangeObservable(start, count, scheduler) {
        _super.call(this);
        this.start = start;
        this._count = count;
        this.scheduler = scheduler;
    }
    /**
     * Creates an Observable that emits a sequence of numbers within a specified
     * range.
     *
     * <span class="informal">Emits a sequence of numbers in a range.</span>
     *
     * <img src="./img/range.png" width="100%">
     *
     * `range` operator emits a range of sequential integers, in order, where you
     * select the `start` of the range and its `length`. By default, uses no
     * IScheduler and just delivers the notifications synchronously, but may use
     * an optional IScheduler to regulate those deliveries.
     *
     * @example <caption>Emits the numbers 1 to 10</caption>
     * var numbers = Rx.Observable.range(1, 10);
     * numbers.subscribe(x => console.log(x));
     *
     * @see {@link timer}
     * @see {@link interval}
     *
     * @param {number} [start=0] The value of the first integer in the sequence.
     * @param {number} [count=0] The number of sequential integers to generate.
     * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
     * the emissions of the notifications.
     * @return {Observable} An Observable of numbers that emits a finite range of
     * sequential integers.
     * @static true
     * @name range
     * @owner Observable
     */
    RangeObservable.create = function (start, count, scheduler) {
        if (start === void 0) { start = 0; }
        if (count === void 0) { count = 0; }
        return new RangeObservable(start, count, scheduler);
    };
    RangeObservable.dispatch = function (state) {
        var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
        if (index >= count) {
            subscriber.complete();
            return;
        }
        subscriber.next(start);
        if (subscriber.closed) {
            return;
        }
        state.index = index + 1;
        state.start = start + 1;
        this.schedule(state);
    };
    RangeObservable.prototype._subscribe = function (subscriber) {
        var index = 0;
        var start = this.start;
        var count = this._count;
        var scheduler = this.scheduler;
        if (scheduler) {
            return scheduler.schedule(RangeObservable.dispatch, 0, {
                index: index, count: count, start: start, subscriber: subscriber
            });
        }
        else {
            do {
                if (index++ >= count) {
                    subscriber.complete();
                    break;
                }
                subscriber.next(start++);
                if (subscriber.closed) {
                    break;
                }
            } while (true);
        }
    };
    return RangeObservable;
}(Observable_1.Observable));
exports.RangeObservable = RangeObservable;
//# sourceMappingURL=RangeObservable.js.map

/***/ }),
/* 922 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var asap_1 = __webpack_require__(513);
var isNumeric_1 = __webpack_require__(149);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var SubscribeOnObservable = (function (_super) {
    __extends(SubscribeOnObservable, _super);
    function SubscribeOnObservable(source, delayTime, scheduler) {
        if (delayTime === void 0) { delayTime = 0; }
        if (scheduler === void 0) { scheduler = asap_1.asap; }
        _super.call(this);
        this.source = source;
        this.delayTime = delayTime;
        this.scheduler = scheduler;
        if (!isNumeric_1.isNumeric(delayTime) || delayTime < 0) {
            this.delayTime = 0;
        }
        if (!scheduler || typeof scheduler.schedule !== 'function') {
            this.scheduler = asap_1.asap;
        }
    }
    SubscribeOnObservable.create = function (source, delay, scheduler) {
        if (delay === void 0) { delay = 0; }
        if (scheduler === void 0) { scheduler = asap_1.asap; }
        return new SubscribeOnObservable(source, delay, scheduler);
    };
    SubscribeOnObservable.dispatch = function (arg) {
        var source = arg.source, subscriber = arg.subscriber;
        return this.add(source.subscribe(subscriber));
    };
    SubscribeOnObservable.prototype._subscribe = function (subscriber) {
        var delay = this.delayTime;
        var source = this.source;
        var scheduler = this.scheduler;
        return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
            source: source, subscriber: subscriber
        });
    };
    return SubscribeOnObservable;
}(Observable_1.Observable));
exports.SubscribeOnObservable = SubscribeOnObservable;
//# sourceMappingURL=SubscribeOnObservable.js.map

/***/ }),
/* 923 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 isNumeric_1 = __webpack_require__(149);
var Observable_1 = __webpack_require__(1);
var async_1 = __webpack_require__(23);
var isScheduler_1 = __webpack_require__(57);
var isDate_1 = __webpack_require__(148);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var TimerObservable = (function (_super) {
    __extends(TimerObservable, _super);
    function TimerObservable(dueTime, period, scheduler) {
        if (dueTime === void 0) { dueTime = 0; }
        _super.call(this);
        this.period = -1;
        this.dueTime = 0;
        if (isNumeric_1.isNumeric(period)) {
            this.period = Number(period) < 1 && 1 || Number(period);
        }
        else if (isScheduler_1.isScheduler(period)) {
            scheduler = period;
        }
        if (!isScheduler_1.isScheduler(scheduler)) {
            scheduler = async_1.async;
        }
        this.scheduler = scheduler;
        this.dueTime = isDate_1.isDate(dueTime) ?
            (+dueTime - this.scheduler.now()) :
            dueTime;
    }
    /**
     * Creates an Observable that starts emitting after an `initialDelay` and
     * emits ever increasing numbers after each `period` of time thereafter.
     *
     * <span class="informal">Its like {@link interval}, but you can specify when
     * should the emissions start.</span>
     *
     * <img src="./img/timer.png" width="100%">
     *
     * `timer` returns an Observable that emits an infinite sequence of ascending
     * integers, with a constant interval of time, `period` of your choosing
     * between those emissions. The first emission happens after the specified
     * `initialDelay`. The initial delay may be a {@link Date}. By default, this
     * operator uses the `async` IScheduler to provide a notion of time, but you
     * may pass any IScheduler to it. If `period` is not specified, the output
     * Observable emits only one value, `0`. Otherwise, it emits an infinite
     * sequence.
     *
     * @example <caption>Emits ascending numbers, one every second (1000ms), starting after 3 seconds</caption>
     * var numbers = Rx.Observable.timer(3000, 1000);
     * numbers.subscribe(x => console.log(x));
     *
     * @example <caption>Emits one number after five seconds</caption>
     * var numbers = Rx.Observable.timer(5000);
     * numbers.subscribe(x => console.log(x));
     *
     * @see {@link interval}
     * @see {@link delay}
     *
     * @param {number|Date} initialDelay The initial delay time to wait before
     * emitting the first value of `0`.
     * @param {number} [period] The period of time between emissions of the
     * subsequent numbers.
     * @param {Scheduler} [scheduler=async] The IScheduler to use for scheduling
     * the emission of values, and providing a notion of "time".
     * @return {Observable} An Observable that emits a `0` after the
     * `initialDelay` and ever increasing numbers after each `period` of time
     * thereafter.
     * @static true
     * @name timer
     * @owner Observable
     */
    TimerObservable.create = function (initialDelay, period, scheduler) {
        if (initialDelay === void 0) { initialDelay = 0; }
        return new TimerObservable(initialDelay, period, scheduler);
    };
    TimerObservable.dispatch = function (state) {
        var index = state.index, period = state.period, subscriber = state.subscriber;
        var action = this;
        subscriber.next(index);
        if (subscriber.closed) {
            return;
        }
        else if (period === -1) {
            return subscriber.complete();
        }
        state.index = index + 1;
        action.schedule(state, period);
    };
    TimerObservable.prototype._subscribe = function (subscriber) {
        var index = 0;
        var _a = this, period = _a.period, dueTime = _a.dueTime, scheduler = _a.scheduler;
        return scheduler.schedule(TimerObservable.dispatch, dueTime, {
            index: index, period: period, subscriber: subscriber
        });
    };
    return TimerObservable;
}(Observable_1.Observable));
exports.TimerObservable = TimerObservable;
//# sourceMappingURL=TimerObservable.js.map

/***/ }),
/* 924 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var subscribeToResult_1 = __webpack_require__(10);
var OuterSubscriber_1 = __webpack_require__(9);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var UsingObservable = (function (_super) {
    __extends(UsingObservable, _super);
    function UsingObservable(resourceFactory, observableFactory) {
        _super.call(this);
        this.resourceFactory = resourceFactory;
        this.observableFactory = observableFactory;
    }
    UsingObservable.create = function (resourceFactory, observableFactory) {
        return new UsingObservable(resourceFactory, observableFactory);
    };
    UsingObservable.prototype._subscribe = function (subscriber) {
        var _a = this, resourceFactory = _a.resourceFactory, observableFactory = _a.observableFactory;
        var resource;
        try {
            resource = resourceFactory();
            return new UsingSubscriber(subscriber, resource, observableFactory);
        }
        catch (err) {
            subscriber.error(err);
        }
    };
    return UsingObservable;
}(Observable_1.Observable));
exports.UsingObservable = UsingObservable;
var UsingSubscriber = (function (_super) {
    __extends(UsingSubscriber, _super);
    function UsingSubscriber(destination, resource, observableFactory) {
        _super.call(this, destination);
        this.resource = resource;
        this.observableFactory = observableFactory;
        destination.add(resource);
        this.tryUse();
    }
    UsingSubscriber.prototype.tryUse = function () {
        try {
            var source = this.observableFactory.call(this, this.resource);
            if (source) {
                this.add(subscribeToResult_1.subscribeToResult(this, source));
            }
        }
        catch (err) {
            this._error(err);
        }
    };
    return UsingSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=UsingObservable.js.map

/***/ }),
/* 925 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var BoundCallbackObservable_1 = __webpack_require__(910);
exports.bindCallback = BoundCallbackObservable_1.BoundCallbackObservable.create;
//# sourceMappingURL=bindCallback.js.map

/***/ }),
/* 926 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var BoundNodeCallbackObservable_1 = __webpack_require__(911);
exports.bindNodeCallback = BoundNodeCallbackObservable_1.BoundNodeCallbackObservable.create;
//# sourceMappingURL=bindNodeCallback.js.map

/***/ }),
/* 927 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var isScheduler_1 = __webpack_require__(57);
var isArray_1 = __webpack_require__(83);
var ArrayObservable_1 = __webpack_require__(82);
var combineLatest_1 = __webpack_require__(246);
/* tslint:enable:max-line-length */
/**
 * Combines multiple Observables to create an Observable whose values are
 * calculated from the latest values of each of its input Observables.
 *
 * <span class="informal">Whenever any input Observable emits a value, it
 * computes a formula using the latest values from all the inputs, then emits
 * the output of that formula.</span>
 *
 * <img src="./img/combineLatest.png" width="100%">
 *
 * `combineLatest` combines the values from all the Observables passed as
 * arguments. This is done by subscribing to each Observable in order and,
 * whenever any Observable emits, collecting an array of the most recent
 * values from each Observable. So if you pass `n` Observables to operator,
 * returned Observable will always emit an array of `n` values, in order
 * corresponding to order of passed Observables (value from the first Observable
 * on the first place and so on).
 *
 * Static version of `combineLatest` accepts either an array of Observables
 * or each Observable can be put directly as an argument. Note that array of
 * Observables is good choice, if you don't know beforehand how many Observables
 * you will combine. Passing empty array will result in Observable that
 * completes immediately.
 *
 * To ensure output array has always the same length, `combineLatest` will
 * actually wait for all input Observables to emit at least once,
 * before it starts emitting results. This means if some Observable emits
 * values before other Observables started emitting, all that values but last
 * will be lost. On the other hand, is some Observable does not emit value but
 * completes, resulting Observable will complete at the same moment without
 * emitting anything, since it will be now impossible to include value from
 * completed Observable in resulting array. Also, if some input Observable does
 * not emit any value and never completes, `combineLatest` will also never emit
 * and never complete, since, again, it will wait for all streams to emit some
 * value.
 *
 * If at least one Observable was passed to `combineLatest` and all passed Observables
 * emitted something, resulting Observable will complete when all combined
 * streams complete. So even if some Observable completes, result of
 * `combineLatest` will still emit values when other Observables do. In case
 * of completed Observable, its value from now on will always be the last
 * emitted value. On the other hand, if any Observable errors, `combineLatest`
 * will error immediately as well, and all other Observables will be unsubscribed.
 *
 * `combineLatest` accepts as optional parameter `project` function, which takes
 * as arguments all values that would normally be emitted by resulting Observable.
 * `project` can return any kind of value, which will be then emitted by Observable
 * instead of default array. Note that `project` does not take as argument that array
 * of values, but values themselves. That means default `project` can be imagined
 * as function that takes all its arguments and puts them into an array.
 *
 *
 * @example <caption>Combine two timer Observables</caption>
 * const firstTimer = Rx.Observable.timer(0, 1000); // emit 0, 1, 2... after every second, starting from now
 * const secondTimer = Rx.Observable.timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now
 * const combinedTimers = Rx.Observable.combineLatest(firstTimer, secondTimer);
 * combinedTimers.subscribe(value => console.log(value));
 * // Logs
 * // [0, 0] after 0.5s
 * // [1, 0] after 1s
 * // [1, 1] after 1.5s
 * // [2, 1] after 2s
 *
 *
 * @example <caption>Combine an array of Observables</caption>
 * const observables = [1, 5, 10].map(
 *   n => Rx.Observable.of(n).delay(n * 1000).startWith(0) // emit 0 and then emit n after n seconds
 * );
 * const combined = Rx.Observable.combineLatest(observables);
 * combined.subscribe(value => console.log(value));
 * // Logs
 * // [0, 0, 0] immediately
 * // [1, 0, 0] after 1s
 * // [1, 5, 0] after 5s
 * // [1, 5, 10] after 10s
 *
 *
 * @example <caption>Use project function to dynamically calculate the Body-Mass Index</caption>
 * var weight = Rx.Observable.of(70, 72, 76, 79, 75);
 * var height = Rx.Observable.of(1.76, 1.77, 1.78);
 * var bmi = Rx.Observable.combineLatest(weight, height, (w, h) => w / (h * h));
 * bmi.subscribe(x => console.log('BMI is ' + x));
 *
 * // With output to console:
 * // BMI is 24.212293388429753
 * // BMI is 23.93948099205209
 * // BMI is 23.671253629592222
 *
 *
 * @see {@link combineAll}
 * @see {@link merge}
 * @see {@link withLatestFrom}
 *
 * @param {ObservableInput} observable1 An input Observable to combine with other Observables.
 * @param {ObservableInput} observable2 An input Observable to combine with other Observables.
 * More than one input Observables may be given as arguments
 * or an array of Observables may be given as the first argument.
 * @param {function} [project] An optional function to project the values from
 * the combined latest values into a new value on the output Observable.
 * @param {Scheduler} [scheduler=null] The IScheduler to use for subscribing to
 * each input Observable.
 * @return {Observable} An Observable of projected values from the most recent
 * values from each input Observable, or an array of the most recent values from
 * each input Observable.
 * @static true
 * @name combineLatest
 * @owner Observable
 */
function combineLatest() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i - 0] = arguments[_i];
    }
    var project = null;
    var scheduler = null;
    if (isScheduler_1.isScheduler(observables[observables.length - 1])) {
        scheduler = observables.pop();
    }
    if (typeof observables[observables.length - 1] === 'function') {
        project = observables.pop();
    }
    // if the first and only other argument besides the resultSelector is an array
    // assume it's been called with `combineLatest([obs1, obs2, obs3], project)`
    if (observables.length === 1 && isArray_1.isArray(observables[0])) {
        observables = observables[0];
    }
    return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new combineLatest_1.CombineLatestOperator(project));
}
exports.combineLatest = combineLatest;
//# sourceMappingURL=combineLatest.js.map

/***/ }),
/* 928 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var concat_1 = __webpack_require__(247);
exports.concat = concat_1.concatStatic;
//# sourceMappingURL=concat.js.map

/***/ }),
/* 929 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var DeferObservable_1 = __webpack_require__(912);
exports.defer = DeferObservable_1.DeferObservable.create;
//# sourceMappingURL=defer.js.map

/***/ }),
/* 930 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var Subscriber_1 = __webpack_require__(6);
var Observable_1 = __webpack_require__(1);
var Subscription_1 = __webpack_require__(16);
var root_1 = __webpack_require__(42);
var ReplaySubject_1 = __webpack_require__(103);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var assign_1 = __webpack_require__(1037);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
var WebSocketSubject = (function (_super) {
    __extends(WebSocketSubject, _super);
    function WebSocketSubject(urlConfigOrSource, destination) {
        if (urlConfigOrSource instanceof Observable_1.Observable) {
            _super.call(this, destination, urlConfigOrSource);
        }
        else {
            _super.call(this);
            this.WebSocketCtor = root_1.root.WebSocket;
            this._output = new Subject_1.Subject();
            if (typeof urlConfigOrSource === 'string') {
                this.url = urlConfigOrSource;
            }
            else {
                // WARNING: config object could override important members here.
                assign_1.assign(this, urlConfigOrSource);
            }
            if (!this.WebSocketCtor) {
                throw new Error('no WebSocket constructor can be found');
            }
            this.destination = new ReplaySubject_1.ReplaySubject();
        }
    }
    WebSocketSubject.prototype.resultSelector = function (e) {
        return JSON.parse(e.data);
    };
    /**
     * Wrapper around the w3c-compatible WebSocket object provided by the browser.
     *
     * @example <caption>Wraps browser WebSocket</caption>
     *
     * let socket$ = Observable.webSocket('ws://localhost:8081');
     *
     * socket$.subscribe(
     *    (msg) => console.log('message received: ' + msg),
     *    (err) => console.log(err),
     *    () => console.log('complete')
     *  );
     *
     * socket$.next(JSON.stringify({ op: 'hello' }));
     *
     * @example <caption>Wraps WebSocket from nodejs-websocket (using node.js)</caption>
     *
     * import { w3cwebsocket } from 'websocket';
     *
     * let socket$ = Observable.webSocket({
     *   url: 'ws://localhost:8081',
     *   WebSocketCtor: w3cwebsocket
     * });
     *
     * socket$.subscribe(
     *    (msg) => console.log('message received: ' + msg),
     *    (err) => console.log(err),
     *    () => console.log('complete')
     *  );
     *
     * socket$.next(JSON.stringify({ op: 'hello' }));
     *
     * @param {string | WebSocketSubjectConfig} urlConfigOrSource the source of the websocket as an url or a structure defining the websocket object
     * @return {WebSocketSubject}
     * @static true
     * @name webSocket
     * @owner Observable
     */
    WebSocketSubject.create = function (urlConfigOrSource) {
        return new WebSocketSubject(urlConfigOrSource);
    };
    WebSocketSubject.prototype.lift = function (operator) {
        var sock = new WebSocketSubject(this, this.destination);
        sock.operator = operator;
        return sock;
    };
    WebSocketSubject.prototype._resetState = function () {
        this.socket = null;
        if (!this.source) {
            this.destination = new ReplaySubject_1.ReplaySubject();
        }
        this._output = new Subject_1.Subject();
    };
    // TODO: factor this out to be a proper Operator/Subscriber implementation and eliminate closures
    WebSocketSubject.prototype.multiplex = function (subMsg, unsubMsg, messageFilter) {
        var self = this;
        return new Observable_1.Observable(function (observer) {
            var result = tryCatch_1.tryCatch(subMsg)();
            if (result === errorObject_1.errorObject) {
                observer.error(errorObject_1.errorObject.e);
            }
            else {
                self.next(result);
            }
            var subscription = self.subscribe(function (x) {
                var result = tryCatch_1.tryCatch(messageFilter)(x);
                if (result === errorObject_1.errorObject) {
                    observer.error(errorObject_1.errorObject.e);
                }
                else if (result) {
                    observer.next(x);
                }
            }, function (err) { return observer.error(err); }, function () { return observer.complete(); });
            return function () {
                var result = tryCatch_1.tryCatch(unsubMsg)();
                if (result === errorObject_1.errorObject) {
                    observer.error(errorObject_1.errorObject.e);
                }
                else {
                    self.next(result);
                }
                subscription.unsubscribe();
            };
        });
    };
    WebSocketSubject.prototype._connectSocket = function () {
        var _this = this;
        var WebSocketCtor = this.WebSocketCtor;
        var observer = this._output;
        var socket = null;
        try {
            socket = this.protocol ?
                new WebSocketCtor(this.url, this.protocol) :
                new WebSocketCtor(this.url);
            this.socket = socket;
            if (this.binaryType) {
                this.socket.binaryType = this.binaryType;
            }
        }
        catch (e) {
            observer.error(e);
            return;
        }
        var subscription = new Subscription_1.Subscription(function () {
            _this.socket = null;
            if (socket && socket.readyState === 1) {
                socket.close();
            }
        });
        socket.onopen = function (e) {
            var openObserver = _this.openObserver;
            if (openObserver) {
                openObserver.next(e);
            }
            var queue = _this.destination;
            _this.destination = Subscriber_1.Subscriber.create(function (x) { return socket.readyState === 1 && socket.send(x); }, function (e) {
                var closingObserver = _this.closingObserver;
                if (closingObserver) {
                    closingObserver.next(undefined);
                }
                if (e && e.code) {
                    socket.close(e.code, e.reason);
                }
                else {
                    observer.error(new TypeError('WebSocketSubject.error must be called with an object with an error code, ' +
                        'and an optional reason: { code: number, reason: string }'));
                }
                _this._resetState();
            }, function () {
                var closingObserver = _this.closingObserver;
                if (closingObserver) {
                    closingObserver.next(undefined);
                }
                socket.close();
                _this._resetState();
            });
            if (queue && queue instanceof ReplaySubject_1.ReplaySubject) {
                subscription.add(queue.subscribe(_this.destination));
            }
        };
        socket.onerror = function (e) {
            _this._resetState();
            observer.error(e);
        };
        socket.onclose = function (e) {
            _this._resetState();
            var closeObserver = _this.closeObserver;
            if (closeObserver) {
                closeObserver.next(e);
            }
            if (e.wasClean) {
                observer.complete();
            }
            else {
                observer.error(e);
            }
        };
        socket.onmessage = function (e) {
            var result = tryCatch_1.tryCatch(_this.resultSelector)(e);
            if (result === errorObject_1.errorObject) {
                observer.error(errorObject_1.errorObject.e);
            }
            else {
                observer.next(result);
            }
        };
    };
    WebSocketSubject.prototype._subscribe = function (subscriber) {
        var _this = this;
        var source = this.source;
        if (source) {
            return source.subscribe(subscriber);
        }
        if (!this.socket) {
            this._connectSocket();
        }
        var subscription = new Subscription_1.Subscription();
        subscription.add(this._output.subscribe(subscriber));
        subscription.add(function () {
            var socket = _this.socket;
            if (_this._output.observers.length === 0) {
                if (socket && socket.readyState === 1) {
                    socket.close();
                }
                _this._resetState();
            }
        });
        return subscription;
    };
    WebSocketSubject.prototype.unsubscribe = function () {
        var _a = this, source = _a.source, socket = _a.socket;
        if (socket && socket.readyState === 1) {
            socket.close();
            this._resetState();
        }
        _super.prototype.unsubscribe.call(this);
        if (!source) {
            this.destination = new ReplaySubject_1.ReplaySubject();
        }
    };
    return WebSocketSubject;
}(Subject_1.AnonymousSubject));
exports.WebSocketSubject = WebSocketSubject;
//# sourceMappingURL=WebSocketSubject.js.map

/***/ }),
/* 931 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var AjaxObservable_1 = __webpack_require__(502);
exports.ajax = AjaxObservable_1.AjaxObservable.create;
//# sourceMappingURL=ajax.js.map

/***/ }),
/* 932 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var WebSocketSubject_1 = __webpack_require__(930);
exports.webSocket = WebSocketSubject_1.WebSocketSubject.create;
//# sourceMappingURL=webSocket.js.map

/***/ }),
/* 933 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var EmptyObservable_1 = __webpack_require__(111);
exports.empty = EmptyObservable_1.EmptyObservable.create;
//# sourceMappingURL=empty.js.map

/***/ }),
/* 934 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var FromEventObservable_1 = __webpack_require__(914);
exports.fromEvent = FromEventObservable_1.FromEventObservable.create;
//# sourceMappingURL=fromEvent.js.map

/***/ }),
/* 935 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var FromEventPatternObservable_1 = __webpack_require__(915);
exports.fromEventPattern = FromEventPatternObservable_1.FromEventPatternObservable.create;
//# sourceMappingURL=fromEventPattern.js.map

/***/ }),
/* 936 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var IfObservable_1 = __webpack_require__(917);
exports._if = IfObservable_1.IfObservable.create;
//# sourceMappingURL=if.js.map

/***/ }),
/* 937 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var IntervalObservable_1 = __webpack_require__(918);
exports.interval = IntervalObservable_1.IntervalObservable.create;
//# sourceMappingURL=interval.js.map

/***/ }),
/* 938 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var NeverObservable_1 = __webpack_require__(919);
exports.never = NeverObservable_1.NeverObservable.create;
//# sourceMappingURL=never.js.map

/***/ }),
/* 939 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var PairsObservable_1 = __webpack_require__(920);
exports.pairs = PairsObservable_1.PairsObservable.create;
//# sourceMappingURL=pairs.js.map

/***/ }),
/* 940 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var RangeObservable_1 = __webpack_require__(921);
exports.range = RangeObservable_1.RangeObservable.create;
//# sourceMappingURL=range.js.map

/***/ }),
/* 941 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var ErrorObservable_1 = __webpack_require__(913);
exports._throw = ErrorObservable_1.ErrorObservable.create;
//# sourceMappingURL=throw.js.map

/***/ }),
/* 942 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var TimerObservable_1 = __webpack_require__(923);
exports.timer = TimerObservable_1.TimerObservable.create;
//# sourceMappingURL=timer.js.map

/***/ }),
/* 943 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var UsingObservable_1 = __webpack_require__(924);
exports.using = UsingObservable_1.UsingObservable.create;
//# sourceMappingURL=using.js.map

/***/ }),
/* 944 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var zip_1 = __webpack_require__(248);
exports.zip = zip_1.zipStatic;
//# sourceMappingURL=zip.js.map

/***/ }),
/* 945 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Ignores source values for a duration determined by another Observable, then
 * emits the most recent value from the source Observable, then repeats this
 * process.
 *
 * <span class="informal">It's like {@link auditTime}, but the silencing
 * duration is determined by a second Observable.</span>
 *
 * <img src="./img/audit.png" width="100%">
 *
 * `audit` is similar to `throttle`, but emits the last value from the silenced
 * time window, instead of the first value. `audit` emits the most recent value
 * from the source Observable on the output Observable as soon as its internal
 * timer becomes disabled, and ignores source values while the timer is enabled.
 * Initially, the timer is disabled. As soon as the first source value arrives,
 * the timer is enabled by calling the `durationSelector` function with the
 * source value, which returns the "duration" Observable. When the duration
 * Observable emits a value or completes, the timer is disabled, then the most
 * recent source value is emitted on the output Observable, and this process
 * repeats for the next source value.
 *
 * @example <caption>Emit clicks at a rate of at most one click per second</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.audit(ev => Rx.Observable.interval(1000));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link auditTime}
 * @see {@link debounce}
 * @see {@link delayWhen}
 * @see {@link sample}
 * @see {@link throttle}
 *
 * @param {function(value: T): SubscribableOrPromise} durationSelector A function
 * that receives a value from the source Observable, for computing the silencing
 * duration, returned as an Observable or a Promise.
 * @return {Observable<T>} An Observable that performs rate-limiting of
 * emissions from the source Observable.
 * @method audit
 * @owner Observable
 */
function audit(durationSelector) {
    return this.lift(new AuditOperator(durationSelector));
}
exports.audit = audit;
var AuditOperator = (function () {
    function AuditOperator(durationSelector) {
        this.durationSelector = durationSelector;
    }
    AuditOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
    };
    return AuditOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var AuditSubscriber = (function (_super) {
    __extends(AuditSubscriber, _super);
    function AuditSubscriber(destination, durationSelector) {
        _super.call(this, destination);
        this.durationSelector = durationSelector;
        this.hasValue = false;
    }
    AuditSubscriber.prototype._next = function (value) {
        this.value = value;
        this.hasValue = true;
        if (!this.throttled) {
            var duration = tryCatch_1.tryCatch(this.durationSelector)(value);
            if (duration === errorObject_1.errorObject) {
                this.destination.error(errorObject_1.errorObject.e);
            }
            else {
                var innerSubscription = subscribeToResult_1.subscribeToResult(this, duration);
                if (innerSubscription.closed) {
                    this.clearThrottle();
                }
                else {
                    this.add(this.throttled = innerSubscription);
                }
            }
        }
    };
    AuditSubscriber.prototype.clearThrottle = function () {
        var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
        if (throttled) {
            this.remove(throttled);
            this.throttled = null;
            throttled.unsubscribe();
        }
        if (hasValue) {
            this.value = null;
            this.hasValue = false;
            this.destination.next(value);
        }
    };
    AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
        this.clearThrottle();
    };
    AuditSubscriber.prototype.notifyComplete = function () {
        this.clearThrottle();
    };
    return AuditSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=audit.js.map

/***/ }),
/* 946 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 async_1 = __webpack_require__(23);
var Subscriber_1 = __webpack_require__(6);
/**
 * Ignores source values for `duration` milliseconds, then emits the most recent
 * value from the source Observable, then repeats this process.
 *
 * <span class="informal">When it sees a source values, it ignores that plus
 * the next ones for `duration` milliseconds, and then it emits the most recent
 * value from the source.</span>
 *
 * <img src="./img/auditTime.png" width="100%">
 *
 * `auditTime` is similar to `throttleTime`, but emits the last value from the
 * silenced time window, instead of the first value. `auditTime` emits the most
 * recent value from the source Observable on the output Observable as soon as
 * its internal timer becomes disabled, and ignores source values while the
 * timer is enabled. Initially, the timer is disabled. As soon as the first
 * source value arrives, the timer is enabled. After `duration` milliseconds (or
 * the time unit determined internally by the optional `scheduler`) has passed,
 * the timer is disabled, then the most recent source value is emitted on the
 * output Observable, and this process repeats for the next source value.
 * Optionally takes a {@link IScheduler} for managing timers.
 *
 * @example <caption>Emit clicks at a rate of at most one click per second</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.auditTime(1000);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link audit}
 * @see {@link debounceTime}
 * @see {@link delay}
 * @see {@link sampleTime}
 * @see {@link throttleTime}
 *
 * @param {number} duration Time to wait before emitting the most recent source
 * value, measured in milliseconds or the time unit determined internally
 * by the optional `scheduler`.
 * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
 * managing the timers that handle the rate-limiting behavior.
 * @return {Observable<T>} An Observable that performs rate-limiting of
 * emissions from the source Observable.
 * @method auditTime
 * @owner Observable
 */
function auditTime(duration, scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    return this.lift(new AuditTimeOperator(duration, scheduler));
}
exports.auditTime = auditTime;
var AuditTimeOperator = (function () {
    function AuditTimeOperator(duration, scheduler) {
        this.duration = duration;
        this.scheduler = scheduler;
    }
    AuditTimeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new AuditTimeSubscriber(subscriber, this.duration, this.scheduler));
    };
    return AuditTimeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var AuditTimeSubscriber = (function (_super) {
    __extends(AuditTimeSubscriber, _super);
    function AuditTimeSubscriber(destination, duration, scheduler) {
        _super.call(this, destination);
        this.duration = duration;
        this.scheduler = scheduler;
        this.hasValue = false;
    }
    AuditTimeSubscriber.prototype._next = function (value) {
        this.value = value;
        this.hasValue = true;
        if (!this.throttled) {
            this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, this));
        }
    };
    AuditTimeSubscriber.prototype.clearThrottle = function () {
        var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
        if (throttled) {
            this.remove(throttled);
            this.throttled = null;
            throttled.unsubscribe();
        }
        if (hasValue) {
            this.value = null;
            this.hasValue = false;
            this.destination.next(value);
        }
    };
    return AuditTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchNext(subscriber) {
    subscriber.clearThrottle();
}
//# sourceMappingURL=auditTime.js.map

/***/ }),
/* 947 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Buffers the source Observable values until `closingNotifier` emits.
 *
 * <span class="informal">Collects values from the past as an array, and emits
 * that array only when another Observable emits.</span>
 *
 * <img src="./img/buffer.png" width="100%">
 *
 * Buffers the incoming Observable values until the given `closingNotifier`
 * Observable emits a value, at which point it emits the buffer on the output
 * Observable and starts a new buffer internally, awaiting the next time
 * `closingNotifier` emits.
 *
 * @example <caption>On every click, emit array of most recent interval events</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var interval = Rx.Observable.interval(1000);
 * var buffered = interval.buffer(clicks);
 * buffered.subscribe(x => console.log(x));
 *
 * @see {@link bufferCount}
 * @see {@link bufferTime}
 * @see {@link bufferToggle}
 * @see {@link bufferWhen}
 * @see {@link window}
 *
 * @param {Observable<any>} closingNotifier An Observable that signals the
 * buffer to be emitted on the output Observable.
 * @return {Observable<T[]>} An Observable of buffers, which are arrays of
 * values.
 * @method buffer
 * @owner Observable
 */
function buffer(closingNotifier) {
    return this.lift(new BufferOperator(closingNotifier));
}
exports.buffer = buffer;
var BufferOperator = (function () {
    function BufferOperator(closingNotifier) {
        this.closingNotifier = closingNotifier;
    }
    BufferOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
    };
    return BufferOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var BufferSubscriber = (function (_super) {
    __extends(BufferSubscriber, _super);
    function BufferSubscriber(destination, closingNotifier) {
        _super.call(this, destination);
        this.buffer = [];
        this.add(subscribeToResult_1.subscribeToResult(this, closingNotifier));
    }
    BufferSubscriber.prototype._next = function (value) {
        this.buffer.push(value);
    };
    BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var buffer = this.buffer;
        this.buffer = [];
        this.destination.next(buffer);
    };
    return BufferSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=buffer.js.map

/***/ }),
/* 948 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Buffers the source Observable values until the size hits the maximum
 * `bufferSize` given.
 *
 * <span class="informal">Collects values from the past as an array, and emits
 * that array only when its size reaches `bufferSize`.</span>
 *
 * <img src="./img/bufferCount.png" width="100%">
 *
 * Buffers a number of values from the source Observable by `bufferSize` then
 * emits the buffer and clears it, and starts a new buffer each
 * `startBufferEvery` values. If `startBufferEvery` is not provided or is
 * `null`, then new buffers are started immediately at the start of the source
 * and when each buffer closes and is emitted.
 *
 * @example <caption>Emit the last two click events as an array</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferCount(2);
 * buffered.subscribe(x => console.log(x));
 *
 * @example <caption>On every click, emit the last two click events as an array</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferCount(2, 1);
 * buffered.subscribe(x => console.log(x));
 *
 * @see {@link buffer}
 * @see {@link bufferTime}
 * @see {@link bufferToggle}
 * @see {@link bufferWhen}
 * @see {@link pairwise}
 * @see {@link windowCount}
 *
 * @param {number} bufferSize The maximum size of the buffer emitted.
 * @param {number} [startBufferEvery] Interval at which to start a new buffer.
 * For example if `startBufferEvery` is `2`, then a new buffer will be started
 * on every other value from the source. A new buffer is started at the
 * beginning of the source by default.
 * @return {Observable<T[]>} An Observable of arrays of buffered values.
 * @method bufferCount
 * @owner Observable
 */
function bufferCount(bufferSize, startBufferEvery) {
    if (startBufferEvery === void 0) { startBufferEvery = null; }
    return this.lift(new BufferCountOperator(bufferSize, startBufferEvery));
}
exports.bufferCount = bufferCount;
var BufferCountOperator = (function () {
    function BufferCountOperator(bufferSize, startBufferEvery) {
        this.bufferSize = bufferSize;
        this.startBufferEvery = startBufferEvery;
        if (!startBufferEvery || bufferSize === startBufferEvery) {
            this.subscriberClass = BufferCountSubscriber;
        }
        else {
            this.subscriberClass = BufferSkipCountSubscriber;
        }
    }
    BufferCountOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
    };
    return BufferCountOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var BufferCountSubscriber = (function (_super) {
    __extends(BufferCountSubscriber, _super);
    function BufferCountSubscriber(destination, bufferSize) {
        _super.call(this, destination);
        this.bufferSize = bufferSize;
        this.buffer = [];
    }
    BufferCountSubscriber.prototype._next = function (value) {
        var buffer = this.buffer;
        buffer.push(value);
        if (buffer.length == this.bufferSize) {
            this.destination.next(buffer);
            this.buffer = [];
        }
    };
    BufferCountSubscriber.prototype._complete = function () {
        var buffer = this.buffer;
        if (buffer.length > 0) {
            this.destination.next(buffer);
        }
        _super.prototype._complete.call(this);
    };
    return BufferCountSubscriber;
}(Subscriber_1.Subscriber));
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var BufferSkipCountSubscriber = (function (_super) {
    __extends(BufferSkipCountSubscriber, _super);
    function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
        _super.call(this, destination);
        this.bufferSize = bufferSize;
        this.startBufferEvery = startBufferEvery;
        this.buffers = [];
        this.count = 0;
    }
    BufferSkipCountSubscriber.prototype._next = function (value) {
        var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
        this.count++;
        if (count % startBufferEvery === 0) {
            buffers.push([]);
        }
        for (var i = buffers.length; i--;) {
            var buffer = buffers[i];
            buffer.push(value);
            if (buffer.length === bufferSize) {
                buffers.splice(i, 1);
                this.destination.next(buffer);
            }
        }
    };
    BufferSkipCountSubscriber.prototype._complete = function () {
        var _a = this, buffers = _a.buffers, destination = _a.destination;
        while (buffers.length > 0) {
            var buffer = buffers.shift();
            if (buffer.length > 0) {
                destination.next(buffer);
            }
        }
        _super.prototype._complete.call(this);
    };
    return BufferSkipCountSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=bufferCount.js.map

/***/ }),
/* 949 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 async_1 = __webpack_require__(23);
var Subscriber_1 = __webpack_require__(6);
var isScheduler_1 = __webpack_require__(57);
/* tslint:enable:max-line-length */
/**
 * Buffers the source Observable values for a specific time period.
 *
 * <span class="informal">Collects values from the past as an array, and emits
 * those arrays periodically in time.</span>
 *
 * <img src="./img/bufferTime.png" width="100%">
 *
 * Buffers values from the source for a specific time duration `bufferTimeSpan`.
 * Unless the optional argument `bufferCreationInterval` is given, it emits and
 * resets the buffer every `bufferTimeSpan` milliseconds. If
 * `bufferCreationInterval` is given, this operator opens the buffer every
 * `bufferCreationInterval` milliseconds and closes (emits and resets) the
 * buffer every `bufferTimeSpan` milliseconds. When the optional argument
 * `maxBufferSize` is specified, the buffer will be closed either after
 * `bufferTimeSpan` milliseconds or when it contains `maxBufferSize` elements.
 *
 * @example <caption>Every second, emit an array of the recent click events</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferTime(1000);
 * buffered.subscribe(x => console.log(x));
 *
 * @example <caption>Every 5 seconds, emit the click events from the next 2 seconds</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferTime(2000, 5000);
 * buffered.subscribe(x => console.log(x));
 *
 * @see {@link buffer}
 * @see {@link bufferCount}
 * @see {@link bufferToggle}
 * @see {@link bufferWhen}
 * @see {@link windowTime}
 *
 * @param {number} bufferTimeSpan The amount of time to fill each buffer array.
 * @param {number} [bufferCreationInterval] The interval at which to start new
 * buffers.
 * @param {number} [maxBufferSize] The maximum buffer size.
 * @param {Scheduler} [scheduler=async] The scheduler on which to schedule the
 * intervals that determine buffer boundaries.
 * @return {Observable<T[]>} An observable of arrays of buffered values.
 * @method bufferTime
 * @owner Observable
 */
function bufferTime(bufferTimeSpan) {
    var length = arguments.length;
    var scheduler = async_1.async;
    if (isScheduler_1.isScheduler(arguments[arguments.length - 1])) {
        scheduler = arguments[arguments.length - 1];
        length--;
    }
    var bufferCreationInterval = null;
    if (length >= 2) {
        bufferCreationInterval = arguments[1];
    }
    var maxBufferSize = Number.POSITIVE_INFINITY;
    if (length >= 3) {
        maxBufferSize = arguments[2];
    }
    return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
}
exports.bufferTime = bufferTime;
var BufferTimeOperator = (function () {
    function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
        this.bufferTimeSpan = bufferTimeSpan;
        this.bufferCreationInterval = bufferCreationInterval;
        this.maxBufferSize = maxBufferSize;
        this.scheduler = scheduler;
    }
    BufferTimeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
    };
    return BufferTimeOperator;
}());
var Context = (function () {
    function Context() {
        this.buffer = [];
    }
    return Context;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var BufferTimeSubscriber = (function (_super) {
    __extends(BufferTimeSubscriber, _super);
    function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
        _super.call(this, destination);
        this.bufferTimeSpan = bufferTimeSpan;
        this.bufferCreationInterval = bufferCreationInterval;
        this.maxBufferSize = maxBufferSize;
        this.scheduler = scheduler;
        this.contexts = [];
        var context = this.openContext();
        this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
        if (this.timespanOnly) {
            var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
            this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
        }
        else {
            var closeState = { subscriber: this, context: context };
            var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: this, scheduler: scheduler };
            this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
            this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
        }
    }
    BufferTimeSubscriber.prototype._next = function (value) {
        var contexts = this.contexts;
        var len = contexts.length;
        var filledBufferContext;
        for (var i = 0; i < len; i++) {
            var context = contexts[i];
            var buffer = context.buffer;
            buffer.push(value);
            if (buffer.length == this.maxBufferSize) {
                filledBufferContext = context;
            }
        }
        if (filledBufferContext) {
            this.onBufferFull(filledBufferContext);
        }
    };
    BufferTimeSubscriber.prototype._error = function (err) {
        this.contexts.length = 0;
        _super.prototype._error.call(this, err);
    };
    BufferTimeSubscriber.prototype._complete = function () {
        var _a = this, contexts = _a.contexts, destination = _a.destination;
        while (contexts.length > 0) {
            var context = contexts.shift();
            destination.next(context.buffer);
        }
        _super.prototype._complete.call(this);
    };
    BufferTimeSubscriber.prototype._unsubscribe = function () {
        this.contexts = null;
    };
    BufferTimeSubscriber.prototype.onBufferFull = function (context) {
        this.closeContext(context);
        var closeAction = context.closeAction;
        closeAction.unsubscribe();
        this.remove(closeAction);
        if (!this.closed && this.timespanOnly) {
            context = this.openContext();
            var bufferTimeSpan = this.bufferTimeSpan;
            var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
            this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
        }
    };
    BufferTimeSubscriber.prototype.openContext = function () {
        var context = new Context();
        this.contexts.push(context);
        return context;
    };
    BufferTimeSubscriber.prototype.closeContext = function (context) {
        this.destination.next(context.buffer);
        var contexts = this.contexts;
        var spliceIndex = contexts ? contexts.indexOf(context) : -1;
        if (spliceIndex >= 0) {
            contexts.splice(contexts.indexOf(context), 1);
        }
    };
    return BufferTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchBufferTimeSpanOnly(state) {
    var subscriber = state.subscriber;
    var prevContext = state.context;
    if (prevContext) {
        subscriber.closeContext(prevContext);
    }
    if (!subscriber.closed) {
        state.context = subscriber.openContext();
        state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
    }
}
function dispatchBufferCreation(state) {
    var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;
    var context = subscriber.openContext();
    var action = this;
    if (!subscriber.closed) {
        subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));
        action.schedule(state, bufferCreationInterval);
    }
}
function dispatchBufferClose(arg) {
    var subscriber = arg.subscriber, context = arg.context;
    subscriber.closeContext(context);
}
//# sourceMappingURL=bufferTime.js.map

/***/ }),
/* 950 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscription_1 = __webpack_require__(16);
var subscribeToResult_1 = __webpack_require__(10);
var OuterSubscriber_1 = __webpack_require__(9);
/**
 * Buffers the source Observable values starting from an emission from
 * `openings` and ending when the output of `closingSelector` emits.
 *
 * <span class="informal">Collects values from the past as an array. Starts
 * collecting only when `opening` emits, and calls the `closingSelector`
 * function to get an Observable that tells when to close the buffer.</span>
 *
 * <img src="./img/bufferToggle.png" width="100%">
 *
 * Buffers values from the source by opening the buffer via signals from an
 * Observable provided to `openings`, and closing and sending the buffers when
 * a Subscribable or Promise returned by the `closingSelector` function emits.
 *
 * @example <caption>Every other second, emit the click events from the next 500ms</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var openings = Rx.Observable.interval(1000);
 * var buffered = clicks.bufferToggle(openings, i =>
 *   i % 2 ? Rx.Observable.interval(500) : Rx.Observable.empty()
 * );
 * buffered.subscribe(x => console.log(x));
 *
 * @see {@link buffer}
 * @see {@link bufferCount}
 * @see {@link bufferTime}
 * @see {@link bufferWhen}
 * @see {@link windowToggle}
 *
 * @param {SubscribableOrPromise<O>} openings A Subscribable or Promise of notifications to start new
 * buffers.
 * @param {function(value: O): SubscribableOrPromise} closingSelector A function that takes
 * the value emitted by the `openings` observable and returns a Subscribable or Promise,
 * which, when it emits, signals that the associated buffer should be emitted
 * and cleared.
 * @return {Observable<T[]>} An observable of arrays of buffered values.
 * @method bufferToggle
 * @owner Observable
 */
function bufferToggle(openings, closingSelector) {
    return this.lift(new BufferToggleOperator(openings, closingSelector));
}
exports.bufferToggle = bufferToggle;
var BufferToggleOperator = (function () {
    function BufferToggleOperator(openings, closingSelector) {
        this.openings = openings;
        this.closingSelector = closingSelector;
    }
    BufferToggleOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
    };
    return BufferToggleOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var BufferToggleSubscriber = (function (_super) {
    __extends(BufferToggleSubscriber, _super);
    function BufferToggleSubscriber(destination, openings, closingSelector) {
        _super.call(this, destination);
        this.openings = openings;
        this.closingSelector = closingSelector;
        this.contexts = [];
        this.add(subscribeToResult_1.subscribeToResult(this, openings));
    }
    BufferToggleSubscriber.prototype._next = function (value) {
        var contexts = this.contexts;
        var len = contexts.length;
        for (var i = 0; i < len; i++) {
            contexts[i].buffer.push(value);
        }
    };
    BufferToggleSubscriber.prototype._error = function (err) {
        var contexts = this.contexts;
        while (contexts.length > 0) {
            var context = contexts.shift();
            context.subscription.unsubscribe();
            context.buffer = null;
            context.subscription = null;
        }
        this.contexts = null;
        _super.prototype._error.call(this, err);
    };
    BufferToggleSubscriber.prototype._complete = function () {
        var contexts = this.contexts;
        while (contexts.length > 0) {
            var context = contexts.shift();
            this.destination.next(context.buffer);
            context.subscription.unsubscribe();
            context.buffer = null;
            context.subscription = null;
        }
        this.contexts = null;
        _super.prototype._complete.call(this);
    };
    BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
    };
    BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {
        this.closeBuffer(innerSub.context);
    };
    BufferToggleSubscriber.prototype.openBuffer = function (value) {
        try {
            var closingSelector = this.closingSelector;
            var closingNotifier = closingSelector.call(this, value);
            if (closingNotifier) {
                this.trySubscribe(closingNotifier);
            }
        }
        catch (err) {
            this._error(err);
        }
    };
    BufferToggleSubscriber.prototype.closeBuffer = function (context) {
        var contexts = this.contexts;
        if (contexts && context) {
            var buffer = context.buffer, subscription = context.subscription;
            this.destination.next(buffer);
            contexts.splice(contexts.indexOf(context), 1);
            this.remove(subscription);
            subscription.unsubscribe();
        }
    };
    BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {
        var contexts = this.contexts;
        var buffer = [];
        var subscription = new Subscription_1.Subscription();
        var context = { buffer: buffer, subscription: subscription };
        contexts.push(context);
        var innerSubscription = subscribeToResult_1.subscribeToResult(this, closingNotifier, context);
        if (!innerSubscription || innerSubscription.closed) {
            this.closeBuffer(context);
        }
        else {
            innerSubscription.context = context;
            this.add(innerSubscription);
            subscription.add(innerSubscription);
        }
    };
    return BufferToggleSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=bufferToggle.js.map

/***/ }),
/* 951 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscription_1 = __webpack_require__(16);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Buffers the source Observable values, using a factory function of closing
 * Observables to determine when to close, emit, and reset the buffer.
 *
 * <span class="informal">Collects values from the past as an array. When it
 * starts collecting values, it calls a function that returns an Observable that
 * tells when to close the buffer and restart collecting.</span>
 *
 * <img src="./img/bufferWhen.png" width="100%">
 *
 * Opens a buffer immediately, then closes the buffer when the observable
 * returned by calling `closingSelector` function emits a value. When it closes
 * the buffer, it immediately opens a new buffer and repeats the process.
 *
 * @example <caption>Emit an array of the last clicks every [1-5] random seconds</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferWhen(() =>
 *   Rx.Observable.interval(1000 + Math.random() * 4000)
 * );
 * buffered.subscribe(x => console.log(x));
 *
 * @see {@link buffer}
 * @see {@link bufferCount}
 * @see {@link bufferTime}
 * @see {@link bufferToggle}
 * @see {@link windowWhen}
 *
 * @param {function(): Observable} closingSelector A function that takes no
 * arguments and returns an Observable that signals buffer closure.
 * @return {Observable<T[]>} An observable of arrays of buffered values.
 * @method bufferWhen
 * @owner Observable
 */
function bufferWhen(closingSelector) {
    return this.lift(new BufferWhenOperator(closingSelector));
}
exports.bufferWhen = bufferWhen;
var BufferWhenOperator = (function () {
    function BufferWhenOperator(closingSelector) {
        this.closingSelector = closingSelector;
    }
    BufferWhenOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
    };
    return BufferWhenOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var BufferWhenSubscriber = (function (_super) {
    __extends(BufferWhenSubscriber, _super);
    function BufferWhenSubscriber(destination, closingSelector) {
        _super.call(this, destination);
        this.closingSelector = closingSelector;
        this.subscribing = false;
        this.openBuffer();
    }
    BufferWhenSubscriber.prototype._next = function (value) {
        this.buffer.push(value);
    };
    BufferWhenSubscriber.prototype._complete = function () {
        var buffer = this.buffer;
        if (buffer) {
            this.destination.next(buffer);
        }
        _super.prototype._complete.call(this);
    };
    BufferWhenSubscriber.prototype._unsubscribe = function () {
        this.buffer = null;
        this.subscribing = false;
    };
    BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.openBuffer();
    };
    BufferWhenSubscriber.prototype.notifyComplete = function () {
        if (this.subscribing) {
            this.complete();
        }
        else {
            this.openBuffer();
        }
    };
    BufferWhenSubscriber.prototype.openBuffer = function () {
        var closingSubscription = this.closingSubscription;
        if (closingSubscription) {
            this.remove(closingSubscription);
            closingSubscription.unsubscribe();
        }
        var buffer = this.buffer;
        if (this.buffer) {
            this.destination.next(buffer);
        }
        this.buffer = [];
        var closingNotifier = tryCatch_1.tryCatch(this.closingSelector)();
        if (closingNotifier === errorObject_1.errorObject) {
            this.error(errorObject_1.errorObject.e);
        }
        else {
            closingSubscription = new Subscription_1.Subscription();
            this.closingSubscription = closingSubscription;
            this.add(closingSubscription);
            this.subscribing = true;
            closingSubscription.add(subscribeToResult_1.subscribeToResult(this, closingNotifier));
            this.subscribing = false;
        }
    };
    return BufferWhenSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=bufferWhen.js.map

/***/ }),
/* 952 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var combineLatest_1 = __webpack_require__(246);
/**
 * Converts a higher-order Observable into a first-order Observable by waiting
 * for the outer Observable to complete, then applying {@link combineLatest}.
 *
 * <span class="informal">Flattens an Observable-of-Observables by applying
 * {@link combineLatest} when the Observable-of-Observables completes.</span>
 *
 * <img src="./img/combineAll.png" width="100%">
 *
 * Takes an Observable of Observables, and collects all Observables from it.
 * Once the outer Observable completes, it subscribes to all collected
 * Observables and combines their values using the {@link combineLatest}
 * strategy, such that:
 * - Every time an inner Observable emits, the output Observable emits.
 * - When the returned observable emits, it emits all of the latest values by:
 *   - If a `project` function is provided, it is called with each recent value
 *     from each inner Observable in whatever order they arrived, and the result
 *     of the `project` function is what is emitted by the output Observable.
 *   - If there is no `project` function, an array of all of the most recent
 *     values is emitted by the output Observable.
 *
 * @example <caption>Map two click events to a finite interval Observable, then apply combineAll</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var higherOrder = clicks.map(ev =>
 *   Rx.Observable.interval(Math.random()*2000).take(3)
 * ).take(2);
 * var result = higherOrder.combineAll();
 * result.subscribe(x => console.log(x));
 *
 * @see {@link combineLatest}
 * @see {@link mergeAll}
 *
 * @param {function} [project] An optional function to map the most recent
 * values from each inner Observable into a new result. Takes each of the most
 * recent values from each collected inner Observable as arguments, in order.
 * @return {Observable} An Observable of projected results or arrays of recent
 * values.
 * @method combineAll
 * @owner Observable
 */
function combineAll(project) {
    return this.lift(new combineLatest_1.CombineLatestOperator(project));
}
exports.combineAll = combineAll;
//# sourceMappingURL=combineAll.js.map

/***/ }),
/* 953 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var mergeMapTo_1 = __webpack_require__(505);
/* tslint:enable:max-line-length */
/**
 * Projects each source value to the same Observable which is merged multiple
 * times in a serialized fashion on the output Observable.
 *
 * <span class="informal">It's like {@link concatMap}, but maps each value
 * always to the same inner Observable.</span>
 *
 * <img src="./img/concatMapTo.png" width="100%">
 *
 * Maps each source value to the given Observable `innerObservable` regardless
 * of the source value, and then flattens those resulting Observables into one
 * single Observable, which is the output Observable. Each new `innerObservable`
 * instance emitted on the output Observable is concatenated with the previous
 * `innerObservable` instance.
 *
 * __Warning:__ if source values arrive endlessly and faster than their
 * corresponding inner Observables can complete, it will result in memory issues
 * as inner Observables amass in an unbounded buffer waiting for their turn to
 * be subscribed to.
 *
 * Note: `concatMapTo` is equivalent to `mergeMapTo` with concurrency parameter
 * set to `1`.
 *
 * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.concatMapTo(Rx.Observable.interval(1000).take(4));
 * result.subscribe(x => console.log(x));
 *
 * // Results in the following:
 * // (results are not concurrent)
 * // For every click on the "document" it will emit values 0 to 3 spaced
 * // on a 1000ms interval
 * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
 *
 * @see {@link concat}
 * @see {@link concatAll}
 * @see {@link concatMap}
 * @see {@link mergeMapTo}
 * @see {@link switchMapTo}
 *
 * @param {ObservableInput} innerObservable An Observable to replace each value from
 * the source Observable.
 * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
 * A function to produce the value on the output Observable based on the values
 * and the indices of the source (outer) emission and the inner Observable
 * emission. The arguments passed to this function are:
 * - `outerValue`: the value that came from the source
 * - `innerValue`: the value that came from the projected Observable
 * - `outerIndex`: the "index" of the value that came from the source
 * - `innerIndex`: the "index" of the value from the projected Observable
 * @return {Observable} An observable of values merged together by joining the
 * passed observable with itself, one after the other, for each value emitted
 * from the source.
 * @method concatMapTo
 * @owner Observable
 */
function concatMapTo(innerObservable, resultSelector) {
    return this.lift(new mergeMapTo_1.MergeMapToOperator(innerObservable, resultSelector, 1));
}
exports.concatMapTo = concatMapTo;
//# sourceMappingURL=concatMapTo.js.map

/***/ }),
/* 954 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Counts the number of emissions on the source and emits that number when the
 * source completes.
 *
 * <span class="informal">Tells how many values were emitted, when the source
 * completes.</span>
 *
 * <img src="./img/count.png" width="100%">
 *
 * `count` transforms an Observable that emits values into an Observable that
 * emits a single value that represents the number of values emitted by the
 * source Observable. If the source Observable terminates with an error, `count`
 * will pass this error notification along without emitting a value first. If
 * the source Observable does not terminate at all, `count` will neither emit
 * a value nor terminate. This operator takes an optional `predicate` function
 * as argument, in which case the output emission will represent the number of
 * source values that matched `true` with the `predicate`.
 *
 * @example <caption>Counts how many seconds have passed before the first click happened</caption>
 * var seconds = Rx.Observable.interval(1000);
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var secondsBeforeClick = seconds.takeUntil(clicks);
 * var result = secondsBeforeClick.count();
 * result.subscribe(x => console.log(x));
 *
 * @example <caption>Counts how many odd numbers are there between 1 and 7</caption>
 * var numbers = Rx.Observable.range(1, 7);
 * var result = numbers.count(i => i % 2 === 1);
 * result.subscribe(x => console.log(x));
 *
 * // Results in:
 * // 4
 *
 * @see {@link max}
 * @see {@link min}
 * @see {@link reduce}
 *
 * @param {function(value: T, i: number, source: Observable<T>): boolean} [predicate] A
 * boolean function to select what values are to be counted. It is provided with
 * arguments of:
 * - `value`: the value from the source Observable.
 * - `index`: the (zero-based) "index" of the value from the source Observable.
 * - `source`: the source Observable instance itself.
 * @return {Observable} An Observable of one number that represents the count as
 * described above.
 * @method count
 * @owner Observable
 */
function count(predicate) {
    return this.lift(new CountOperator(predicate, this));
}
exports.count = count;
var CountOperator = (function () {
    function CountOperator(predicate, source) {
        this.predicate = predicate;
        this.source = source;
    }
    CountOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
    };
    return CountOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var CountSubscriber = (function (_super) {
    __extends(CountSubscriber, _super);
    function CountSubscriber(destination, predicate, source) {
        _super.call(this, destination);
        this.predicate = predicate;
        this.source = source;
        this.count = 0;
        this.index = 0;
    }
    CountSubscriber.prototype._next = function (value) {
        if (this.predicate) {
            this._tryPredicate(value);
        }
        else {
            this.count++;
        }
    };
    CountSubscriber.prototype._tryPredicate = function (value) {
        var result;
        try {
            result = this.predicate(value, this.index++, this.source);
        }
        catch (err) {
            this.destination.error(err);
            return;
        }
        if (result) {
            this.count++;
        }
    };
    CountSubscriber.prototype._complete = function () {
        this.destination.next(this.count);
        this.destination.complete();
    };
    return CountSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=count.js.map

/***/ }),
/* 955 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Emits a value from the source Observable only after a particular time span
 * determined by another Observable has passed without another source emission.
 *
 * <span class="informal">It's like {@link debounceTime}, but the time span of
 * emission silence is determined by a second Observable.</span>
 *
 * <img src="./img/debounce.png" width="100%">
 *
 * `debounce` delays values emitted by the source Observable, but drops previous
 * pending delayed emissions if a new value arrives on the source Observable.
 * This operator keeps track of the most recent value from the source
 * Observable, and spawns a duration Observable by calling the
 * `durationSelector` function. The value is emitted only when the duration
 * Observable emits a value or completes, and if no other value was emitted on
 * the source Observable since the duration Observable was spawned. If a new
 * value appears before the duration Observable emits, the previous value will
 * be dropped and will not be emitted on the output Observable.
 *
 * Like {@link debounceTime}, this is a rate-limiting operator, and also a
 * delay-like operator since output emissions do not necessarily occur at the
 * same time as they did on the source Observable.
 *
 * @example <caption>Emit the most recent click after a burst of clicks</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.debounce(() => Rx.Observable.interval(1000));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link audit}
 * @see {@link debounceTime}
 * @see {@link delayWhen}
 * @see {@link throttle}
 *
 * @param {function(value: T): SubscribableOrPromise} durationSelector A function
 * that receives a value from the source Observable, for computing the timeout
 * duration for each source value, returned as an Observable or a Promise.
 * @return {Observable} An Observable that delays the emissions of the source
 * Observable by the specified duration Observable returned by
 * `durationSelector`, and may drop some values if they occur too frequently.
 * @method debounce
 * @owner Observable
 */
function debounce(durationSelector) {
    return this.lift(new DebounceOperator(durationSelector));
}
exports.debounce = debounce;
var DebounceOperator = (function () {
    function DebounceOperator(durationSelector) {
        this.durationSelector = durationSelector;
    }
    DebounceOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
    };
    return DebounceOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DebounceSubscriber = (function (_super) {
    __extends(DebounceSubscriber, _super);
    function DebounceSubscriber(destination, durationSelector) {
        _super.call(this, destination);
        this.durationSelector = durationSelector;
        this.hasValue = false;
        this.durationSubscription = null;
    }
    DebounceSubscriber.prototype._next = function (value) {
        try {
            var result = this.durationSelector.call(this, value);
            if (result) {
                this._tryNext(value, result);
            }
        }
        catch (err) {
            this.destination.error(err);
        }
    };
    DebounceSubscriber.prototype._complete = function () {
        this.emitValue();
        this.destination.complete();
    };
    DebounceSubscriber.prototype._tryNext = function (value, duration) {
        var subscription = this.durationSubscription;
        this.value = value;
        this.hasValue = true;
        if (subscription) {
            subscription.unsubscribe();
            this.remove(subscription);
        }
        subscription = subscribeToResult_1.subscribeToResult(this, duration);
        if (!subscription.closed) {
            this.add(this.durationSubscription = subscription);
        }
    };
    DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.emitValue();
    };
    DebounceSubscriber.prototype.notifyComplete = function () {
        this.emitValue();
    };
    DebounceSubscriber.prototype.emitValue = function () {
        if (this.hasValue) {
            var value = this.value;
            var subscription = this.durationSubscription;
            if (subscription) {
                this.durationSubscription = null;
                subscription.unsubscribe();
                this.remove(subscription);
            }
            this.value = null;
            this.hasValue = false;
            _super.prototype._next.call(this, value);
        }
    };
    return DebounceSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=debounce.js.map

/***/ }),
/* 956 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var async_1 = __webpack_require__(23);
/**
 * Emits a value from the source Observable only after a particular time span
 * has passed without another source emission.
 *
 * <span class="informal">It's like {@link delay}, but passes only the most
 * recent value from each burst of emissions.</span>
 *
 * <img src="./img/debounceTime.png" width="100%">
 *
 * `debounceTime` delays values emitted by the source Observable, but drops
 * previous pending delayed emissions if a new value arrives on the source
 * Observable. This operator keeps track of the most recent value from the
 * source Observable, and emits that only when `dueTime` enough time has passed
 * without any other value appearing on the source Observable. If a new value
 * appears before `dueTime` silence occurs, the previous value will be dropped
 * and will not be emitted on the output Observable.
 *
 * This is a rate-limiting operator, because it is impossible for more than one
 * value to be emitted in any time window of duration `dueTime`, but it is also
 * a delay-like operator since output emissions do not occur at the same time as
 * they did on the source Observable. Optionally takes a {@link IScheduler} for
 * managing timers.
 *
 * @example <caption>Emit the most recent click after a burst of clicks</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.debounceTime(1000);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link auditTime}
 * @see {@link debounce}
 * @see {@link delay}
 * @see {@link sampleTime}
 * @see {@link throttleTime}
 *
 * @param {number} dueTime The timeout duration in milliseconds (or the time
 * unit determined internally by the optional `scheduler`) for the window of
 * time required to wait for emission silence before emitting the most recent
 * source value.
 * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
 * managing the timers that handle the timeout for each value.
 * @return {Observable} An Observable that delays the emissions of the source
 * Observable by the specified `dueTime`, and may drop some values if they occur
 * too frequently.
 * @method debounceTime
 * @owner Observable
 */
function debounceTime(dueTime, scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    return this.lift(new DebounceTimeOperator(dueTime, scheduler));
}
exports.debounceTime = debounceTime;
var DebounceTimeOperator = (function () {
    function DebounceTimeOperator(dueTime, scheduler) {
        this.dueTime = dueTime;
        this.scheduler = scheduler;
    }
    DebounceTimeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
    };
    return DebounceTimeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DebounceTimeSubscriber = (function (_super) {
    __extends(DebounceTimeSubscriber, _super);
    function DebounceTimeSubscriber(destination, dueTime, scheduler) {
        _super.call(this, destination);
        this.dueTime = dueTime;
        this.scheduler = scheduler;
        this.debouncedSubscription = null;
        this.lastValue = null;
        this.hasValue = false;
    }
    DebounceTimeSubscriber.prototype._next = function (value) {
        this.clearDebounce();
        this.lastValue = value;
        this.hasValue = true;
        this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
    };
    DebounceTimeSubscriber.prototype._complete = function () {
        this.debouncedNext();
        this.destination.complete();
    };
    DebounceTimeSubscriber.prototype.debouncedNext = function () {
        this.clearDebounce();
        if (this.hasValue) {
            this.destination.next(this.lastValue);
            this.lastValue = null;
            this.hasValue = false;
        }
    };
    DebounceTimeSubscriber.prototype.clearDebounce = function () {
        var debouncedSubscription = this.debouncedSubscription;
        if (debouncedSubscription !== null) {
            this.remove(debouncedSubscription);
            debouncedSubscription.unsubscribe();
            this.debouncedSubscription = null;
        }
    };
    return DebounceTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchNext(subscriber) {
    subscriber.debouncedNext();
}
//# sourceMappingURL=debounceTime.js.map

/***/ }),
/* 957 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/* tslint:enable:max-line-length */
/**
 * Emits a given value if the source Observable completes without emitting any
 * `next` value, otherwise mirrors the source Observable.
 *
 * <span class="informal">If the source Observable turns out to be empty, then
 * this operator will emit a default value.</span>
 *
 * <img src="./img/defaultIfEmpty.png" width="100%">
 *
 * `defaultIfEmpty` emits the values emitted by the source Observable or a
 * specified default value if the source Observable is empty (completes without
 * having emitted any `next` value).
 *
 * @example <caption>If no clicks happen in 5 seconds, then emit "no clicks"</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var clicksBeforeFive = clicks.takeUntil(Rx.Observable.interval(5000));
 * var result = clicksBeforeFive.defaultIfEmpty('no clicks');
 * result.subscribe(x => console.log(x));
 *
 * @see {@link empty}
 * @see {@link last}
 *
 * @param {any} [defaultValue=null] The default value used if the source
 * Observable is empty.
 * @return {Observable} An Observable that emits either the specified
 * `defaultValue` if the source Observable emits no items, or the values emitted
 * by the source Observable.
 * @method defaultIfEmpty
 * @owner Observable
 */
function defaultIfEmpty(defaultValue) {
    if (defaultValue === void 0) { defaultValue = null; }
    return this.lift(new DefaultIfEmptyOperator(defaultValue));
}
exports.defaultIfEmpty = defaultIfEmpty;
var DefaultIfEmptyOperator = (function () {
    function DefaultIfEmptyOperator(defaultValue) {
        this.defaultValue = defaultValue;
    }
    DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
    };
    return DefaultIfEmptyOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DefaultIfEmptySubscriber = (function (_super) {
    __extends(DefaultIfEmptySubscriber, _super);
    function DefaultIfEmptySubscriber(destination, defaultValue) {
        _super.call(this, destination);
        this.defaultValue = defaultValue;
        this.isEmpty = true;
    }
    DefaultIfEmptySubscriber.prototype._next = function (value) {
        this.isEmpty = false;
        this.destination.next(value);
    };
    DefaultIfEmptySubscriber.prototype._complete = function () {
        if (this.isEmpty) {
            this.destination.next(this.defaultValue);
        }
        this.destination.complete();
    };
    return DefaultIfEmptySubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=defaultIfEmpty.js.map

/***/ }),
/* 958 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 async_1 = __webpack_require__(23);
var isDate_1 = __webpack_require__(148);
var Subscriber_1 = __webpack_require__(6);
var Notification_1 = __webpack_require__(151);
/**
 * Delays the emission of items from the source Observable by a given timeout or
 * until a given Date.
 *
 * <span class="informal">Time shifts each item by some specified amount of
 * milliseconds.</span>
 *
 * <img src="./img/delay.png" width="100%">
 *
 * If the delay argument is a Number, this operator time shifts the source
 * Observable by that amount of time expressed in milliseconds. The relative
 * time intervals between the values are preserved.
 *
 * If the delay argument is a Date, this operator time shifts the start of the
 * Observable execution until the given date occurs.
 *
 * @example <caption>Delay each click by one second</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var delayedClicks = clicks.delay(1000); // each click emitted after 1 second
 * delayedClicks.subscribe(x => console.log(x));
 *
 * @example <caption>Delay all clicks until a future date happens</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var date = new Date('March 15, 2050 12:00:00'); // in the future
 * var delayedClicks = clicks.delay(date); // click emitted only after that date
 * delayedClicks.subscribe(x => console.log(x));
 *
 * @see {@link debounceTime}
 * @see {@link delayWhen}
 *
 * @param {number|Date} delay The delay duration in milliseconds (a `number`) or
 * a `Date` until which the emission of the source items is delayed.
 * @param {Scheduler} [scheduler=async] The IScheduler to use for
 * managing the timers that handle the time-shift for each item.
 * @return {Observable} An Observable that delays the emissions of the source
 * Observable by the specified timeout or Date.
 * @method delay
 * @owner Observable
 */
function delay(delay, scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    var absoluteDelay = isDate_1.isDate(delay);
    var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
    return this.lift(new DelayOperator(delayFor, scheduler));
}
exports.delay = delay;
var DelayOperator = (function () {
    function DelayOperator(delay, scheduler) {
        this.delay = delay;
        this.scheduler = scheduler;
    }
    DelayOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
    };
    return DelayOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DelaySubscriber = (function (_super) {
    __extends(DelaySubscriber, _super);
    function DelaySubscriber(destination, delay, scheduler) {
        _super.call(this, destination);
        this.delay = delay;
        this.scheduler = scheduler;
        this.queue = [];
        this.active = false;
        this.errored = false;
    }
    DelaySubscriber.dispatch = function (state) {
        var source = state.source;
        var queue = source.queue;
        var scheduler = state.scheduler;
        var destination = state.destination;
        while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
            queue.shift().notification.observe(destination);
        }
        if (queue.length > 0) {
            var delay_1 = Math.max(0, queue[0].time - scheduler.now());
            this.schedule(state, delay_1);
        }
        else {
            source.active = false;
        }
    };
    DelaySubscriber.prototype._schedule = function (scheduler) {
        this.active = true;
        this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
            source: this, destination: this.destination, scheduler: scheduler
        }));
    };
    DelaySubscriber.prototype.scheduleNotification = function (notification) {
        if (this.errored === true) {
            return;
        }
        var scheduler = this.scheduler;
        var message = new DelayMessage(scheduler.now() + this.delay, notification);
        this.queue.push(message);
        if (this.active === false) {
            this._schedule(scheduler);
        }
    };
    DelaySubscriber.prototype._next = function (value) {
        this.scheduleNotification(Notification_1.Notification.createNext(value));
    };
    DelaySubscriber.prototype._error = function (err) {
        this.errored = true;
        this.queue = [];
        this.destination.error(err);
    };
    DelaySubscriber.prototype._complete = function () {
        this.scheduleNotification(Notification_1.Notification.createComplete());
    };
    return DelaySubscriber;
}(Subscriber_1.Subscriber));
var DelayMessage = (function () {
    function DelayMessage(time, notification) {
        this.time = time;
        this.notification = notification;
    }
    return DelayMessage;
}());
//# sourceMappingURL=delay.js.map

/***/ }),
/* 959 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var Observable_1 = __webpack_require__(1);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Delays the emission of items from the source Observable by a given time span
 * determined by the emissions of another Observable.
 *
 * <span class="informal">It's like {@link delay}, but the time span of the
 * delay duration is determined by a second Observable.</span>
 *
 * <img src="./img/delayWhen.png" width="100%">
 *
 * `delayWhen` time shifts each emitted value from the source Observable by a
 * time span determined by another Observable. When the source emits a value,
 * the `delayDurationSelector` function is called with the source value as
 * argument, and should return an Observable, called the "duration" Observable.
 * The source value is emitted on the output Observable only when the duration
 * Observable emits a value or completes.
 *
 * Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which
 * is an Observable. When `subscriptionDelay` emits its first value or
 * completes, the source Observable is subscribed to and starts behaving like
 * described in the previous paragraph. If `subscriptionDelay` is not provided,
 * `delayWhen` will subscribe to the source Observable as soon as the output
 * Observable is subscribed.
 *
 * @example <caption>Delay each click by a random amount of time, between 0 and 5 seconds</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var delayedClicks = clicks.delayWhen(event =>
 *   Rx.Observable.interval(Math.random() * 5000)
 * );
 * delayedClicks.subscribe(x => console.log(x));
 *
 * @see {@link debounce}
 * @see {@link delay}
 *
 * @param {function(value: T): Observable} delayDurationSelector A function that
 * returns an Observable for each value emitted by the source Observable, which
 * is then used to delay the emission of that item on the output Observable
 * until the Observable returned from this function emits a value.
 * @param {Observable} subscriptionDelay An Observable that triggers the
 * subscription to the source Observable once it emits any value.
 * @return {Observable} An Observable that delays the emissions of the source
 * Observable by an amount of time specified by the Observable returned by
 * `delayDurationSelector`.
 * @method delayWhen
 * @owner Observable
 */
function delayWhen(delayDurationSelector, subscriptionDelay) {
    if (subscriptionDelay) {
        return new SubscriptionDelayObservable(this, subscriptionDelay)
            .lift(new DelayWhenOperator(delayDurationSelector));
    }
    return this.lift(new DelayWhenOperator(delayDurationSelector));
}
exports.delayWhen = delayWhen;
var DelayWhenOperator = (function () {
    function DelayWhenOperator(delayDurationSelector) {
        this.delayDurationSelector = delayDurationSelector;
    }
    DelayWhenOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
    };
    return DelayWhenOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DelayWhenSubscriber = (function (_super) {
    __extends(DelayWhenSubscriber, _super);
    function DelayWhenSubscriber(destination, delayDurationSelector) {
        _super.call(this, destination);
        this.delayDurationSelector = delayDurationSelector;
        this.completed = false;
        this.delayNotifierSubscriptions = [];
        this.values = [];
    }
    DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.destination.next(outerValue);
        this.removeSubscription(innerSub);
        this.tryComplete();
    };
    DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {
        this._error(error);
    };
    DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {
        var value = this.removeSubscription(innerSub);
        if (value) {
            this.destination.next(value);
        }
        this.tryComplete();
    };
    DelayWhenSubscriber.prototype._next = function (value) {
        try {
            var delayNotifier = this.delayDurationSelector(value);
            if (delayNotifier) {
                this.tryDelay(delayNotifier, value);
            }
        }
        catch (err) {
            this.destination.error(err);
        }
    };
    DelayWhenSubscriber.prototype._complete = function () {
        this.completed = true;
        this.tryComplete();
    };
    DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {
        subscription.unsubscribe();
        var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
        var value = null;
        if (subscriptionIdx !== -1) {
            value = this.values[subscriptionIdx];
            this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
            this.values.splice(subscriptionIdx, 1);
        }
        return value;
    };
    DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {
        var notifierSubscription = subscribeToResult_1.subscribeToResult(this, delayNotifier, value);
        if (notifierSubscription && !notifierSubscription.closed) {
            this.add(notifierSubscription);
            this.delayNotifierSubscriptions.push(notifierSubscription);
        }
        this.values.push(value);
    };
    DelayWhenSubscriber.prototype.tryComplete = function () {
        if (this.completed && this.delayNotifierSubscriptions.length === 0) {
            this.destination.complete();
        }
    };
    return DelayWhenSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SubscriptionDelayObservable = (function (_super) {
    __extends(SubscriptionDelayObservable, _super);
    function SubscriptionDelayObservable(source, subscriptionDelay) {
        _super.call(this);
        this.source = source;
        this.subscriptionDelay = subscriptionDelay;
    }
    SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {
        this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
    };
    return SubscriptionDelayObservable;
}(Observable_1.Observable));
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SubscriptionDelaySubscriber = (function (_super) {
    __extends(SubscriptionDelaySubscriber, _super);
    function SubscriptionDelaySubscriber(parent, source) {
        _super.call(this);
        this.parent = parent;
        this.source = source;
        this.sourceSubscribed = false;
    }
    SubscriptionDelaySubscriber.prototype._next = function (unused) {
        this.subscribeToSource();
    };
    SubscriptionDelaySubscriber.prototype._error = function (err) {
        this.unsubscribe();
        this.parent.error(err);
    };
    SubscriptionDelaySubscriber.prototype._complete = function () {
        this.subscribeToSource();
    };
    SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {
        if (!this.sourceSubscribed) {
            this.sourceSubscribed = true;
            this.unsubscribe();
            this.source.subscribe(this.parent);
        }
    };
    return SubscriptionDelaySubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=delayWhen.js.map

/***/ }),
/* 960 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Converts an Observable of {@link Notification} objects into the emissions
 * that they represent.
 *
 * <span class="informal">Unwraps {@link Notification} objects as actual `next`,
 * `error` and `complete` emissions. The opposite of {@link materialize}.</span>
 *
 * <img src="./img/dematerialize.png" width="100%">
 *
 * `dematerialize` is assumed to operate an Observable that only emits
 * {@link Notification} objects as `next` emissions, and does not emit any
 * `error`. Such Observable is the output of a `materialize` operation. Those
 * notifications are then unwrapped using the metadata they contain, and emitted
 * as `next`, `error`, and `complete` on the output Observable.
 *
 * Use this operator in conjunction with {@link materialize}.
 *
 * @example <caption>Convert an Observable of Notifications to an actual Observable</caption>
 * var notifA = new Rx.Notification('N', 'A');
 * var notifB = new Rx.Notification('N', 'B');
 * var notifE = new Rx.Notification('E', void 0,
 *   new TypeError('x.toUpperCase is not a function')
 * );
 * var materialized = Rx.Observable.of(notifA, notifB, notifE);
 * var upperCase = materialized.dematerialize();
 * upperCase.subscribe(x => console.log(x), e => console.error(e));
 *
 * // Results in:
 * // A
 * // B
 * // TypeError: x.toUpperCase is not a function
 *
 * @see {@link Notification}
 * @see {@link materialize}
 *
 * @return {Observable} An Observable that emits items and notifications
 * embedded in Notification objects emitted by the source Observable.
 * @method dematerialize
 * @owner Observable
 */
function dematerialize() {
    return this.lift(new DeMaterializeOperator());
}
exports.dematerialize = dematerialize;
var DeMaterializeOperator = (function () {
    function DeMaterializeOperator() {
    }
    DeMaterializeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DeMaterializeSubscriber(subscriber));
    };
    return DeMaterializeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DeMaterializeSubscriber = (function (_super) {
    __extends(DeMaterializeSubscriber, _super);
    function DeMaterializeSubscriber(destination) {
        _super.call(this, destination);
    }
    DeMaterializeSubscriber.prototype._next = function (value) {
        value.observe(this.destination);
    };
    return DeMaterializeSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=dematerialize.js.map

/***/ }),
/* 961 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
var Set_1 = __webpack_require__(1036);
/**
 * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items.
 *
 * If a keySelector function is provided, then it will project each value from the source observable into a new value that it will
 * check for equality with previously projected values. If a keySelector function is not provided, it will use each value from the
 * source observable directly with an equality check against previous values.
 *
 * In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking.
 *
 * In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the
 * hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct`
 * use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so
 * that the internal `Set` can be "flushed", basically clearing it of values.
 *
 * @example <caption>A simple example with numbers</caption>
 * Observable.of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1)
 *   .distinct()
 *   .subscribe(x => console.log(x)); // 1, 2, 3, 4
 *
 * @example <caption>An example using a keySelector function</caption>
 * interface Person {
 *    age: number,
 *    name: string
 * }
 *
 * Observable.of<Person>(
 *     { age: 4, name: 'Foo'},
 *     { age: 7, name: 'Bar'},
 *     { age: 5, name: 'Foo'})
 *     .distinct((p: Person) => p.name)
 *     .subscribe(x => console.log(x));
 *
 * // displays:
 * // { age: 4, name: 'Foo' }
 * // { age: 7, name: 'Bar' }
 *
 * @see {@link distinctUntilChanged}
 * @see {@link distinctUntilKeyChanged}
 *
 * @param {function} [keySelector] Optional function to select which value you want to check as distinct.
 * @param {Observable} [flushes] Optional Observable for flushing the internal HashSet of the operator.
 * @return {Observable} An Observable that emits items from the source Observable with distinct values.
 * @method distinct
 * @owner Observable
 */
function distinct(keySelector, flushes) {
    return this.lift(new DistinctOperator(keySelector, flushes));
}
exports.distinct = distinct;
var DistinctOperator = (function () {
    function DistinctOperator(keySelector, flushes) {
        this.keySelector = keySelector;
        this.flushes = flushes;
    }
    DistinctOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
    };
    return DistinctOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DistinctSubscriber = (function (_super) {
    __extends(DistinctSubscriber, _super);
    function DistinctSubscriber(destination, keySelector, flushes) {
        _super.call(this, destination);
        this.keySelector = keySelector;
        this.values = new Set_1.Set();
        if (flushes) {
            this.add(subscribeToResult_1.subscribeToResult(this, flushes));
        }
    }
    DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.values.clear();
    };
    DistinctSubscriber.prototype.notifyError = function (error, innerSub) {
        this._error(error);
    };
    DistinctSubscriber.prototype._next = function (value) {
        if (this.keySelector) {
            this._useKeySelector(value);
        }
        else {
            this._finalizeNext(value, value);
        }
    };
    DistinctSubscriber.prototype._useKeySelector = function (value) {
        var key;
        var destination = this.destination;
        try {
            key = this.keySelector(value);
        }
        catch (err) {
            destination.error(err);
            return;
        }
        this._finalizeNext(key, value);
    };
    DistinctSubscriber.prototype._finalizeNext = function (key, value) {
        var values = this.values;
        if (!values.has(key)) {
            values.add(key);
            this.destination.next(value);
        }
    };
    return DistinctSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.DistinctSubscriber = DistinctSubscriber;
//# sourceMappingURL=distinct.js.map

/***/ }),
/* 962 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var distinctUntilChanged_1 = __webpack_require__(503);
/* tslint:enable:max-line-length */
/**
 * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item,
 * using a property accessed by using the key provided to check if the two items are distinct.
 *
 * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.
 *
 * If a comparator function is not provided, an equality check is used by default.
 *
 * @example <caption>An example comparing the name of persons</caption>
 *
 *  interface Person {
 *     age: number,
 *     name: string
 *  }
 *
 * Observable.of<Person>(
 *     { age: 4, name: 'Foo'},
 *     { age: 7, name: 'Bar'},
 *     { age: 5, name: 'Foo'},
 *     { age: 6, name: 'Foo'})
 *     .distinctUntilKeyChanged('name')
 *     .subscribe(x => console.log(x));
 *
 * // displays:
 * // { age: 4, name: 'Foo' }
 * // { age: 7, name: 'Bar' }
 * // { age: 5, name: 'Foo' }
 *
 * @example <caption>An example comparing the first letters of the name</caption>
 *
 * interface Person {
 *     age: number,
 *     name: string
 *  }
 *
 * Observable.of<Person>(
 *     { age: 4, name: 'Foo1'},
 *     { age: 7, name: 'Bar'},
 *     { age: 5, name: 'Foo2'},
 *     { age: 6, name: 'Foo3'})
 *     .distinctUntilKeyChanged('name', (x: string, y: string) => x.substring(0, 3) === y.substring(0, 3))
 *     .subscribe(x => console.log(x));
 *
 * // displays:
 * // { age: 4, name: 'Foo1' }
 * // { age: 7, name: 'Bar' }
 * // { age: 5, name: 'Foo2' }
 *
 * @see {@link distinct}
 * @see {@link distinctUntilChanged}
 *
 * @param {string} key String key for object property lookup on each item.
 * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.
 * @return {Observable} An Observable that emits items from the source Observable with distinct values based on the key specified.
 * @method distinctUntilKeyChanged
 * @owner Observable
 */
function distinctUntilKeyChanged(key, compare) {
    return distinctUntilChanged_1.distinctUntilChanged.call(this, function (x, y) {
        if (compare) {
            return compare(x[key], y[key]);
        }
        return x[key] === y[key];
    });
}
exports.distinctUntilKeyChanged = distinctUntilKeyChanged;
//# sourceMappingURL=distinctUntilKeyChanged.js.map

/***/ }),
/* 963 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/* tslint:enable:max-line-length */
/**
 * Perform a side effect for every emission on the source Observable, but return
 * an Observable that is identical to the source.
 *
 * <span class="informal">Intercepts each emission on the source and runs a
 * function, but returns an output which is identical to the source as long as errors don't occur.</span>
 *
 * <img src="./img/do.png" width="100%">
 *
 * Returns a mirrored Observable of the source Observable, but modified so that
 * the provided Observer is called to perform a side effect for every value,
 * error, and completion emitted by the source. Any errors that are thrown in
 * the aforementioned Observer or handlers are safely sent down the error path
 * of the output Observable.
 *
 * This operator is useful for debugging your Observables for the correct values
 * or performing other side effects.
 *
 * Note: this is different to a `subscribe` on the Observable. If the Observable
 * returned by `do` is not subscribed, the side effects specified by the
 * Observer will never happen. `do` therefore simply spies on existing
 * execution, it does not trigger an execution to happen like `subscribe` does.
 *
 * @example <caption>Map every click to the clientX position of that click, while also logging the click event</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var positions = clicks
 *   .do(ev => console.log(ev))
 *   .map(ev => ev.clientX);
 * positions.subscribe(x => console.log(x));
 *
 * @see {@link map}
 * @see {@link subscribe}
 *
 * @param {Observer|function} [nextOrObserver] A normal Observer object or a
 * callback for `next`.
 * @param {function} [error] Callback for errors in the source.
 * @param {function} [complete] Callback for the completion of the source.
 * @return {Observable} An Observable identical to the source, but runs the
 * specified Observer or callback(s) for each item.
 * @method do
 * @name do
 * @owner Observable
 */
function _do(nextOrObserver, error, complete) {
    return this.lift(new DoOperator(nextOrObserver, error, complete));
}
exports._do = _do;
var DoOperator = (function () {
    function DoOperator(nextOrObserver, error, complete) {
        this.nextOrObserver = nextOrObserver;
        this.error = error;
        this.complete = complete;
    }
    DoOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new DoSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
    };
    return DoOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var DoSubscriber = (function (_super) {
    __extends(DoSubscriber, _super);
    function DoSubscriber(destination, nextOrObserver, error, complete) {
        _super.call(this, destination);
        var safeSubscriber = new Subscriber_1.Subscriber(nextOrObserver, error, complete);
        safeSubscriber.syncErrorThrowable = true;
        this.add(safeSubscriber);
        this.safeSubscriber = safeSubscriber;
    }
    DoSubscriber.prototype._next = function (value) {
        var safeSubscriber = this.safeSubscriber;
        safeSubscriber.next(value);
        if (safeSubscriber.syncErrorThrown) {
            this.destination.error(safeSubscriber.syncErrorValue);
        }
        else {
            this.destination.next(value);
        }
    };
    DoSubscriber.prototype._error = function (err) {
        var safeSubscriber = this.safeSubscriber;
        safeSubscriber.error(err);
        if (safeSubscriber.syncErrorThrown) {
            this.destination.error(safeSubscriber.syncErrorValue);
        }
        else {
            this.destination.error(err);
        }
    };
    DoSubscriber.prototype._complete = function () {
        var safeSubscriber = this.safeSubscriber;
        safeSubscriber.complete();
        if (safeSubscriber.syncErrorThrown) {
            this.destination.error(safeSubscriber.syncErrorValue);
        }
        else {
            this.destination.complete();
        }
    };
    return DoSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=do.js.map

/***/ }),
/* 964 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var ArgumentOutOfRangeError_1 = __webpack_require__(110);
/**
 * Emits the single value at the specified `index` in a sequence of emissions
 * from the source Observable.
 *
 * <span class="informal">Emits only the i-th value, then completes.</span>
 *
 * <img src="./img/elementAt.png" width="100%">
 *
 * `elementAt` returns an Observable that emits the item at the specified
 * `index` in the source Observable, or a default value if that `index` is out
 * of range and the `default` argument is provided. If the `default` argument is
 * not given and the `index` is out of range, the output Observable will emit an
 * `ArgumentOutOfRangeError` error.
 *
 * @example <caption>Emit only the third click event</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.elementAt(2);
 * result.subscribe(x => console.log(x));
 *
 * // Results in:
 * // click 1 = nothing
 * // click 2 = nothing
 * // click 3 = MouseEvent object logged to console
 *
 * @see {@link first}
 * @see {@link last}
 * @see {@link skip}
 * @see {@link single}
 * @see {@link take}
 *
 * @throws {ArgumentOutOfRangeError} When using `elementAt(i)`, it delivers an
 * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0` or the
 * Observable has completed before emitting the i-th `next` notification.
 *
 * @param {number} index Is the number `i` for the i-th source emission that has
 * happened since the subscription, starting from the number `0`.
 * @param {T} [defaultValue] The default value returned for missing indices.
 * @return {Observable} An Observable that emits a single item, if it is found.
 * Otherwise, will emit the default value if given. If not, then emits an error.
 * @method elementAt
 * @owner Observable
 */
function elementAt(index, defaultValue) {
    return this.lift(new ElementAtOperator(index, defaultValue));
}
exports.elementAt = elementAt;
var ElementAtOperator = (function () {
    function ElementAtOperator(index, defaultValue) {
        this.index = index;
        this.defaultValue = defaultValue;
        if (index < 0) {
            throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
        }
    }
    ElementAtOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ElementAtSubscriber(subscriber, this.index, this.defaultValue));
    };
    return ElementAtOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ElementAtSubscriber = (function (_super) {
    __extends(ElementAtSubscriber, _super);
    function ElementAtSubscriber(destination, index, defaultValue) {
        _super.call(this, destination);
        this.index = index;
        this.defaultValue = defaultValue;
    }
    ElementAtSubscriber.prototype._next = function (x) {
        if (this.index-- === 0) {
            this.destination.next(x);
            this.destination.complete();
        }
    };
    ElementAtSubscriber.prototype._complete = function () {
        var destination = this.destination;
        if (this.index >= 0) {
            if (typeof this.defaultValue !== 'undefined') {
                destination.next(this.defaultValue);
            }
            else {
                destination.error(new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError);
            }
        }
        destination.complete();
    };
    return ElementAtSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=elementAt.js.map

/***/ }),
/* 965 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Converts a higher-order Observable into a first-order Observable by dropping
 * inner Observables while the previous inner Observable has not yet completed.
 *
 * <span class="informal">Flattens an Observable-of-Observables by dropping the
 * next inner Observables while the current inner is still executing.</span>
 *
 * <img src="./img/exhaust.png" width="100%">
 *
 * `exhaust` subscribes to an Observable that emits Observables, also known as a
 * higher-order Observable. Each time it observes one of these emitted inner
 * Observables, the output Observable begins emitting the items emitted by that
 * inner Observable. So far, it behaves like {@link mergeAll}. However,
 * `exhaust` ignores every new inner Observable if the previous Observable has
 * not yet completed. Once that one completes, it will accept and flatten the
 * next inner Observable and repeat this process.
 *
 * @example <caption>Run a finite timer for each click, only if there is no currently active timer</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(5));
 * var result = higherOrder.exhaust();
 * result.subscribe(x => console.log(x));
 *
 * @see {@link combineAll}
 * @see {@link concatAll}
 * @see {@link switch}
 * @see {@link mergeAll}
 * @see {@link exhaustMap}
 * @see {@link zipAll}
 *
 * @return {Observable} An Observable that takes a source of Observables and propagates the first observable
 * exclusively until it completes before subscribing to the next.
 * @method exhaust
 * @owner Observable
 */
function exhaust() {
    return this.lift(new SwitchFirstOperator());
}
exports.exhaust = exhaust;
var SwitchFirstOperator = (function () {
    function SwitchFirstOperator() {
    }
    SwitchFirstOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SwitchFirstSubscriber(subscriber));
    };
    return SwitchFirstOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SwitchFirstSubscriber = (function (_super) {
    __extends(SwitchFirstSubscriber, _super);
    function SwitchFirstSubscriber(destination) {
        _super.call(this, destination);
        this.hasCompleted = false;
        this.hasSubscription = false;
    }
    SwitchFirstSubscriber.prototype._next = function (value) {
        if (!this.hasSubscription) {
            this.hasSubscription = true;
            this.add(subscribeToResult_1.subscribeToResult(this, value));
        }
    };
    SwitchFirstSubscriber.prototype._complete = function () {
        this.hasCompleted = true;
        if (!this.hasSubscription) {
            this.destination.complete();
        }
    };
    SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) {
        this.remove(innerSub);
        this.hasSubscription = false;
        if (this.hasCompleted) {
            this.destination.complete();
        }
    };
    return SwitchFirstSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=exhaust.js.map

/***/ }),
/* 966 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Projects each source value to an Observable which is merged in the output
 * Observable only if the previous projected Observable has completed.
 *
 * <span class="informal">Maps each value to an Observable, then flattens all of
 * these inner Observables using {@link exhaust}.</span>
 *
 * <img src="./img/exhaustMap.png" width="100%">
 *
 * Returns an Observable that emits items based on applying a function that you
 * supply to each item emitted by the source Observable, where that function
 * returns an (so-called "inner") Observable. When it projects a source value to
 * an Observable, the output Observable begins emitting the items emitted by
 * that projected Observable. However, `exhaustMap` ignores every new projected
 * Observable if the previous projected Observable has not yet completed. Once
 * that one completes, it will accept and flatten the next projected Observable
 * and repeat this process.
 *
 * @example <caption>Run a finite timer for each click, only if there is no currently active timer</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.exhaustMap((ev) => Rx.Observable.interval(1000).take(5));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link concatMap}
 * @see {@link exhaust}
 * @see {@link mergeMap}
 * @see {@link switchMap}
 *
 * @param {function(value: T, ?index: number): ObservableInput} project A function
 * that, when applied to an item emitted by the source Observable, returns an
 * Observable.
 * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
 * A function to produce the value on the output Observable based on the values
 * and the indices of the source (outer) emission and the inner Observable
 * emission. The arguments passed to this function are:
 * - `outerValue`: the value that came from the source
 * - `innerValue`: the value that came from the projected Observable
 * - `outerIndex`: the "index" of the value that came from the source
 * - `innerIndex`: the "index" of the value from the projected Observable
 * @return {Observable} An Observable containing projected Observables
 * of each item of the source, ignoring projected Observables that start before
 * their preceding Observable has completed.
 * @method exhaustMap
 * @owner Observable
 */
function exhaustMap(project, resultSelector) {
    return this.lift(new SwitchFirstMapOperator(project, resultSelector));
}
exports.exhaustMap = exhaustMap;
var SwitchFirstMapOperator = (function () {
    function SwitchFirstMapOperator(project, resultSelector) {
        this.project = project;
        this.resultSelector = resultSelector;
    }
    SwitchFirstMapOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SwitchFirstMapSubscriber(subscriber, this.project, this.resultSelector));
    };
    return SwitchFirstMapOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SwitchFirstMapSubscriber = (function (_super) {
    __extends(SwitchFirstMapSubscriber, _super);
    function SwitchFirstMapSubscriber(destination, project, resultSelector) {
        _super.call(this, destination);
        this.project = project;
        this.resultSelector = resultSelector;
        this.hasSubscription = false;
        this.hasCompleted = false;
        this.index = 0;
    }
    SwitchFirstMapSubscriber.prototype._next = function (value) {
        if (!this.hasSubscription) {
            this.tryNext(value);
        }
    };
    SwitchFirstMapSubscriber.prototype.tryNext = function (value) {
        var index = this.index++;
        var destination = this.destination;
        try {
            var result = this.project(value, index);
            this.hasSubscription = true;
            this.add(subscribeToResult_1.subscribeToResult(this, result, value, index));
        }
        catch (err) {
            destination.error(err);
        }
    };
    SwitchFirstMapSubscriber.prototype._complete = function () {
        this.hasCompleted = true;
        if (!this.hasSubscription) {
            this.destination.complete();
        }
    };
    SwitchFirstMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var _a = this, resultSelector = _a.resultSelector, destination = _a.destination;
        if (resultSelector) {
            this.trySelectResult(outerValue, innerValue, outerIndex, innerIndex);
        }
        else {
            destination.next(innerValue);
        }
    };
    SwitchFirstMapSubscriber.prototype.trySelectResult = function (outerValue, innerValue, outerIndex, innerIndex) {
        var _a = this, resultSelector = _a.resultSelector, destination = _a.destination;
        try {
            var result = resultSelector(outerValue, innerValue, outerIndex, innerIndex);
            destination.next(result);
        }
        catch (err) {
            destination.error(err);
        }
    };
    SwitchFirstMapSubscriber.prototype.notifyError = function (err) {
        this.destination.error(err);
    };
    SwitchFirstMapSubscriber.prototype.notifyComplete = function (innerSub) {
        this.remove(innerSub);
        this.hasSubscription = false;
        if (this.hasCompleted) {
            this.destination.complete();
        }
    };
    return SwitchFirstMapSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=exhaustMap.js.map

/***/ }),
/* 967 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Recursively projects each source value to an Observable which is merged in
 * the output Observable.
 *
 * <span class="informal">It's similar to {@link mergeMap}, but applies the
 * projection function to every source value as well as every output value.
 * It's recursive.</span>
 *
 * <img src="./img/expand.png" width="100%">
 *
 * Returns an Observable that emits items based on applying a function that you
 * supply to each item emitted by the source Observable, where that function
 * returns an Observable, and then merging those resulting Observables and
 * emitting the results of this merger. *Expand* will re-emit on the output
 * Observable every source value. Then, each output value is given to the
 * `project` function which returns an inner Observable to be merged on the
 * output Observable. Those output values resulting from the projection are also
 * given to the `project` function to produce new output values. This is how
 * *expand* behaves recursively.
 *
 * @example <caption>Start emitting the powers of two on every click, at most 10 of them</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var powersOfTwo = clicks
 *   .mapTo(1)
 *   .expand(x => Rx.Observable.of(2 * x).delay(1000))
 *   .take(10);
 * powersOfTwo.subscribe(x => console.log(x));
 *
 * @see {@link mergeMap}
 * @see {@link mergeScan}
 *
 * @param {function(value: T, index: number) => Observable} project A function
 * that, when applied to an item emitted by the source or the output Observable,
 * returns an Observable.
 * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
 * Observables being subscribed to concurrently.
 * @param {Scheduler} [scheduler=null] The IScheduler to use for subscribing to
 * each projected inner Observable.
 * @return {Observable} An Observable that emits the source values and also
 * result of applying the projection function to each value emitted on the
 * output Observable and and merging the results of the Observables obtained
 * from this transformation.
 * @method expand
 * @owner Observable
 */
function expand(project, concurrent, scheduler) {
    if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
    if (scheduler === void 0) { scheduler = undefined; }
    concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
    return this.lift(new ExpandOperator(project, concurrent, scheduler));
}
exports.expand = expand;
var ExpandOperator = (function () {
    function ExpandOperator(project, concurrent, scheduler) {
        this.project = project;
        this.concurrent = concurrent;
        this.scheduler = scheduler;
    }
    ExpandOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
    };
    return ExpandOperator;
}());
exports.ExpandOperator = ExpandOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ExpandSubscriber = (function (_super) {
    __extends(ExpandSubscriber, _super);
    function ExpandSubscriber(destination, project, concurrent, scheduler) {
        _super.call(this, destination);
        this.project = project;
        this.concurrent = concurrent;
        this.scheduler = scheduler;
        this.index = 0;
        this.active = 0;
        this.hasCompleted = false;
        if (concurrent < Number.POSITIVE_INFINITY) {
            this.buffer = [];
        }
    }
    ExpandSubscriber.dispatch = function (arg) {
        var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;
        subscriber.subscribeToProjection(result, value, index);
    };
    ExpandSubscriber.prototype._next = function (value) {
        var destination = this.destination;
        if (destination.closed) {
            this._complete();
            return;
        }
        var index = this.index++;
        if (this.active < this.concurrent) {
            destination.next(value);
            var result = tryCatch_1.tryCatch(this.project)(value, index);
            if (result === errorObject_1.errorObject) {
                destination.error(errorObject_1.errorObject.e);
            }
            else if (!this.scheduler) {
                this.subscribeToProjection(result, value, index);
            }
            else {
                var state = { subscriber: this, result: result, value: value, index: index };
                this.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
            }
        }
        else {
            this.buffer.push(value);
        }
    };
    ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {
        this.active++;
        this.add(subscribeToResult_1.subscribeToResult(this, result, value, index));
    };
    ExpandSubscriber.prototype._complete = function () {
        this.hasCompleted = true;
        if (this.hasCompleted && this.active === 0) {
            this.destination.complete();
        }
    };
    ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this._next(innerValue);
    };
    ExpandSubscriber.prototype.notifyComplete = function (innerSub) {
        var buffer = this.buffer;
        this.remove(innerSub);
        this.active--;
        if (buffer && buffer.length > 0) {
            this._next(buffer.shift());
        }
        if (this.hasCompleted && this.active === 0) {
            this.destination.complete();
        }
    };
    return ExpandSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.ExpandSubscriber = ExpandSubscriber;
//# sourceMappingURL=expand.js.map

/***/ }),
/* 968 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var Subscription_1 = __webpack_require__(16);
/**
 * Returns an Observable that mirrors the source Observable, but will call a specified function when
 * the source terminates on complete or error.
 * @param {function} callback Function to be called when source terminates.
 * @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.
 * @method finally
 * @owner Observable
 */
function _finally(callback) {
    return this.lift(new FinallyOperator(callback));
}
exports._finally = _finally;
var FinallyOperator = (function () {
    function FinallyOperator(callback) {
        this.callback = callback;
    }
    FinallyOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new FinallySubscriber(subscriber, this.callback));
    };
    return FinallyOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var FinallySubscriber = (function (_super) {
    __extends(FinallySubscriber, _super);
    function FinallySubscriber(destination, callback) {
        _super.call(this, destination);
        this.add(new Subscription_1.Subscription(callback));
    }
    return FinallySubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=finally.js.map

/***/ }),
/* 969 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var find_1 = __webpack_require__(504);
/**
 * Emits only the index of the first value emitted by the source Observable that
 * meets some condition.
 *
 * <span class="informal">It's like {@link find}, but emits the index of the
 * found value, not the value itself.</span>
 *
 * <img src="./img/findIndex.png" width="100%">
 *
 * `findIndex` searches for the first item in the source Observable that matches
 * the specified condition embodied by the `predicate`, and returns the
 * (zero-based) index of the first occurrence in the source. Unlike
 * {@link first}, the `predicate` is required in `findIndex`, and does not emit
 * an error if a valid value is not found.
 *
 * @example <caption>Emit the index of first click that happens on a DIV element</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.findIndex(ev => ev.target.tagName === 'DIV');
 * result.subscribe(x => console.log(x));
 *
 * @see {@link filter}
 * @see {@link find}
 * @see {@link first}
 * @see {@link take}
 *
 * @param {function(value: T, index: number, source: Observable<T>): boolean} predicate
 * A function called with each item to test for condition matching.
 * @param {any} [thisArg] An optional argument to determine the value of `this`
 * in the `predicate` function.
 * @return {Observable} An Observable of the index of the first item that
 * matches the condition.
 * @method find
 * @owner Observable
 */
function findIndex(predicate, thisArg) {
    return this.lift(new find_1.FindValueOperator(predicate, this, true, thisArg));
}
exports.findIndex = findIndex;
//# sourceMappingURL=findIndex.js.map

/***/ }),
/* 970 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var Subscription_1 = __webpack_require__(16);
var Observable_1 = __webpack_require__(1);
var Subject_1 = __webpack_require__(11);
var Map_1 = __webpack_require__(1034);
var FastMap_1 = __webpack_require__(1032);
/* tslint:enable:max-line-length */
/**
 * Groups the items emitted by an Observable according to a specified criterion,
 * and emits these grouped items as `GroupedObservables`, one
 * {@link GroupedObservable} per group.
 *
 * <img src="./img/groupBy.png" width="100%">
 *
 * @example <caption>Group objects by id and return as array</caption>
 * Observable.of<Obj>({id: 1, name: 'aze1'},
 *                    {id: 2, name: 'sf2'},
 *                    {id: 2, name: 'dg2'},
 *                    {id: 1, name: 'erg1'},
 *                    {id: 1, name: 'df1'},
 *                    {id: 2, name: 'sfqfb2'},
 *                    {id: 3, name: 'qfs3'},
 *                    {id: 2, name: 'qsgqsfg2'}
 *     )
 *     .groupBy(p => p.id)
 *     .flatMap( (group$) => group$.reduce((acc, cur) => [...acc, cur], []))
 *     .subscribe(p => console.log(p));
 *
 * // displays:
 * // [ { id: 1, name: 'aze1' },
 * //   { id: 1, name: 'erg1' },
 * //   { id: 1, name: 'df1' } ]
 * //
 * // [ { id: 2, name: 'sf2' },
 * //   { id: 2, name: 'dg2' },
 * //   { id: 2, name: 'sfqfb2' },
 * //   { id: 2, name: 'qsgqsfg2' } ]
 * //
 * // [ { id: 3, name: 'qfs3' } ]
 *
 * @example <caption>Pivot data on the id field</caption>
 * Observable.of<Obj>({id: 1, name: 'aze1'},
 *                    {id: 2, name: 'sf2'},
 *                    {id: 2, name: 'dg2'},
 *                    {id: 1, name: 'erg1'},
 *                    {id: 1, name: 'df1'},
 *                    {id: 2, name: 'sfqfb2'},
 *                    {id: 3, name: 'qfs1'},
 *                    {id: 2, name: 'qsgqsfg2'}
 *                   )
 *     .groupBy(p => p.id, p => p.name)
 *     .flatMap( (group$) => group$.reduce((acc, cur) => [...acc, cur], ["" + group$.key]))
 *     .map(arr => ({'id': parseInt(arr[0]), 'values': arr.slice(1)}))
 *     .subscribe(p => console.log(p));
 *
 * // displays:
 * // { id: 1, values: [ 'aze1', 'erg1', 'df1' ] }
 * // { id: 2, values: [ 'sf2', 'dg2', 'sfqfb2', 'qsgqsfg2' ] }
 * // { id: 3, values: [ 'qfs1' ] }
 *
 * @param {function(value: T): K} keySelector A function that extracts the key
 * for each item.
 * @param {function(value: T): R} [elementSelector] A function that extracts the
 * return element for each item.
 * @param {function(grouped: GroupedObservable<K,R>): Observable<any>} [durationSelector]
 * A function that returns an Observable to determine how long each group should
 * exist.
 * @return {Observable<GroupedObservable<K,R>>} An Observable that emits
 * GroupedObservables, each of which corresponds to a unique key value and each
 * of which emits those items from the source Observable that share that key
 * value.
 * @method groupBy
 * @owner Observable
 */
function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
    return this.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
}
exports.groupBy = groupBy;
var GroupByOperator = (function () {
    function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {
        this.keySelector = keySelector;
        this.elementSelector = elementSelector;
        this.durationSelector = durationSelector;
        this.subjectSelector = subjectSelector;
    }
    GroupByOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
    };
    return GroupByOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var GroupBySubscriber = (function (_super) {
    __extends(GroupBySubscriber, _super);
    function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
        _super.call(this, destination);
        this.keySelector = keySelector;
        this.elementSelector = elementSelector;
        this.durationSelector = durationSelector;
        this.subjectSelector = subjectSelector;
        this.groups = null;
        this.attemptedToUnsubscribe = false;
        this.count = 0;
    }
    GroupBySubscriber.prototype._next = function (value) {
        var key;
        try {
            key = this.keySelector(value);
        }
        catch (err) {
            this.error(err);
            return;
        }
        this._group(value, key);
    };
    GroupBySubscriber.prototype._group = function (value, key) {
        var groups = this.groups;
        if (!groups) {
            groups = this.groups = typeof key === 'string' ? new FastMap_1.FastMap() : new Map_1.Map();
        }
        var group = groups.get(key);
        var element;
        if (this.elementSelector) {
            try {
                element = this.elementSelector(value);
            }
            catch (err) {
                this.error(err);
            }
        }
        else {
            element = value;
        }
        if (!group) {
            group = this.subjectSelector ? this.subjectSelector() : new Subject_1.Subject();
            groups.set(key, group);
            var groupedObservable = new GroupedObservable(key, group, this);
            this.destination.next(groupedObservable);
            if (this.durationSelector) {
                var duration = void 0;
                try {
                    duration = this.durationSelector(new GroupedObservable(key, group));
                }
                catch (err) {
                    this.error(err);
                    return;
                }
                this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
            }
        }
        if (!group.closed) {
            group.next(element);
        }
    };
    GroupBySubscriber.prototype._error = function (err) {
        var groups = this.groups;
        if (groups) {
            groups.forEach(function (group, key) {
                group.error(err);
            });
            groups.clear();
        }
        this.destination.error(err);
    };
    GroupBySubscriber.prototype._complete = function () {
        var groups = this.groups;
        if (groups) {
            groups.forEach(function (group, key) {
                group.complete();
            });
            groups.clear();
        }
        this.destination.complete();
    };
    GroupBySubscriber.prototype.removeGroup = function (key) {
        this.groups.delete(key);
    };
    GroupBySubscriber.prototype.unsubscribe = function () {
        if (!this.closed) {
            this.attemptedToUnsubscribe = true;
            if (this.count === 0) {
                _super.prototype.unsubscribe.call(this);
            }
        }
    };
    return GroupBySubscriber;
}(Subscriber_1.Subscriber));
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var GroupDurationSubscriber = (function (_super) {
    __extends(GroupDurationSubscriber, _super);
    function GroupDurationSubscriber(key, group, parent) {
        _super.call(this, group);
        this.key = key;
        this.group = group;
        this.parent = parent;
    }
    GroupDurationSubscriber.prototype._next = function (value) {
        this.complete();
    };
    GroupDurationSubscriber.prototype._unsubscribe = function () {
        var _a = this, parent = _a.parent, key = _a.key;
        this.key = this.parent = null;
        if (parent) {
            parent.removeGroup(key);
        }
    };
    return GroupDurationSubscriber;
}(Subscriber_1.Subscriber));
/**
 * An Observable representing values belonging to the same group represented by
 * a common key. The values emitted by a GroupedObservable come from the source
 * Observable. The common key is available as the field `key` on a
 * GroupedObservable instance.
 *
 * @class GroupedObservable<K, T>
 */
var GroupedObservable = (function (_super) {
    __extends(GroupedObservable, _super);
    function GroupedObservable(key, groupSubject, refCountSubscription) {
        _super.call(this);
        this.key = key;
        this.groupSubject = groupSubject;
        this.refCountSubscription = refCountSubscription;
    }
    GroupedObservable.prototype._subscribe = function (subscriber) {
        var subscription = new Subscription_1.Subscription();
        var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
        if (refCountSubscription && !refCountSubscription.closed) {
            subscription.add(new InnerRefCountSubscription(refCountSubscription));
        }
        subscription.add(groupSubject.subscribe(subscriber));
        return subscription;
    };
    return GroupedObservable;
}(Observable_1.Observable));
exports.GroupedObservable = GroupedObservable;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var InnerRefCountSubscription = (function (_super) {
    __extends(InnerRefCountSubscription, _super);
    function InnerRefCountSubscription(parent) {
        _super.call(this);
        this.parent = parent;
        parent.count++;
    }
    InnerRefCountSubscription.prototype.unsubscribe = function () {
        var parent = this.parent;
        if (!parent.closed && !this.closed) {
            _super.prototype.unsubscribe.call(this);
            parent.count -= 1;
            if (parent.count === 0 && parent.attemptedToUnsubscribe) {
                parent.unsubscribe();
            }
        }
    };
    return InnerRefCountSubscription;
}(Subscription_1.Subscription));
//# sourceMappingURL=groupBy.js.map

/***/ }),
/* 971 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var noop_1 = __webpack_require__(519);
/**
 * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`.
 *
 * <img src="./img/ignoreElements.png" width="100%">
 *
 * @return {Observable} An empty Observable that only calls `complete`
 * or `error`, based on which one is called by the source Observable.
 * @method ignoreElements
 * @owner Observable
 */
function ignoreElements() {
    return this.lift(new IgnoreElementsOperator());
}
exports.ignoreElements = ignoreElements;
;
var IgnoreElementsOperator = (function () {
    function IgnoreElementsOperator() {
    }
    IgnoreElementsOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new IgnoreElementsSubscriber(subscriber));
    };
    return IgnoreElementsOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var IgnoreElementsSubscriber = (function (_super) {
    __extends(IgnoreElementsSubscriber, _super);
    function IgnoreElementsSubscriber() {
        _super.apply(this, arguments);
    }
    IgnoreElementsSubscriber.prototype._next = function (unused) {
        noop_1.noop();
    };
    return IgnoreElementsSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=ignoreElements.js.map

/***/ }),
/* 972 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * If the source Observable is empty it returns an Observable that emits true, otherwise it emits false.
 *
 * <img src="./img/isEmpty.png" width="100%">
 *
 * @return {Observable} An Observable that emits a Boolean.
 * @method isEmpty
 * @owner Observable
 */
function isEmpty() {
    return this.lift(new IsEmptyOperator());
}
exports.isEmpty = isEmpty;
var IsEmptyOperator = (function () {
    function IsEmptyOperator() {
    }
    IsEmptyOperator.prototype.call = function (observer, source) {
        return source.subscribe(new IsEmptySubscriber(observer));
    };
    return IsEmptyOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var IsEmptySubscriber = (function (_super) {
    __extends(IsEmptySubscriber, _super);
    function IsEmptySubscriber(destination) {
        _super.call(this, destination);
    }
    IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
        var destination = this.destination;
        destination.next(isEmpty);
        destination.complete();
    };
    IsEmptySubscriber.prototype._next = function (value) {
        this.notifyComplete(false);
    };
    IsEmptySubscriber.prototype._complete = function () {
        this.notifyComplete(true);
    };
    return IsEmptySubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=isEmpty.js.map

/***/ }),
/* 973 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

/**
 * @param func
 * @return {Observable<R>}
 * @method let
 * @owner Observable
 */
function letProto(func) {
    return func(this);
}
exports.letProto = letProto;
//# sourceMappingURL=let.js.map

/***/ }),
/* 974 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Emits the given constant value on the output Observable every time the source
 * Observable emits a value.
 *
 * <span class="informal">Like {@link map}, but it maps every source value to
 * the same output value every time.</span>
 *
 * <img src="./img/mapTo.png" width="100%">
 *
 * Takes a constant `value` as argument, and emits that whenever the source
 * Observable emits a value. In other words, ignores the actual source value,
 * and simply uses the emission moment to know when to emit the given `value`.
 *
 * @example <caption>Map every click to the string 'Hi'</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var greetings = clicks.mapTo('Hi');
 * greetings.subscribe(x => console.log(x));
 *
 * @see {@link map}
 *
 * @param {any} value The value to map each source value to.
 * @return {Observable} An Observable that emits the given `value` every time
 * the source Observable emits something.
 * @method mapTo
 * @owner Observable
 */
function mapTo(value) {
    return this.lift(new MapToOperator(value));
}
exports.mapTo = mapTo;
var MapToOperator = (function () {
    function MapToOperator(value) {
        this.value = value;
    }
    MapToOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new MapToSubscriber(subscriber, this.value));
    };
    return MapToOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var MapToSubscriber = (function (_super) {
    __extends(MapToSubscriber, _super);
    function MapToSubscriber(destination, value) {
        _super.call(this, destination);
        this.value = value;
    }
    MapToSubscriber.prototype._next = function (x) {
        this.destination.next(this.value);
    };
    return MapToSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=mapTo.js.map

/***/ }),
/* 975 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var Notification_1 = __webpack_require__(151);
/**
 * Represents all of the notifications from the source Observable as `next`
 * emissions marked with their original types within {@link Notification}
 * objects.
 *
 * <span class="informal">Wraps `next`, `error` and `complete` emissions in
 * {@link Notification} objects, emitted as `next` on the output Observable.
 * </span>
 *
 * <img src="./img/materialize.png" width="100%">
 *
 * `materialize` returns an Observable that emits a `next` notification for each
 * `next`, `error`, or `complete` emission of the source Observable. When the
 * source Observable emits `complete`, the output Observable will emit `next` as
 * a Notification of type "complete", and then it will emit `complete` as well.
 * When the source Observable emits `error`, the output will emit `next` as a
 * Notification of type "error", and then `complete`.
 *
 * This operator is useful for producing metadata of the source Observable, to
 * be consumed as `next` emissions. Use it in conjunction with
 * {@link dematerialize}.
 *
 * @example <caption>Convert a faulty Observable to an Observable of Notifications</caption>
 * var letters = Rx.Observable.of('a', 'b', 13, 'd');
 * var upperCase = letters.map(x => x.toUpperCase());
 * var materialized = upperCase.materialize();
 * materialized.subscribe(x => console.log(x));
 *
 * // Results in the following:
 * // - Notification {kind: "N", value: "A", error: undefined, hasValue: true}
 * // - Notification {kind: "N", value: "B", error: undefined, hasValue: true}
 * // - Notification {kind: "E", value: undefined, error: TypeError:
 * //   x.toUpperCase is not a function at MapSubscriber.letters.map.x
 * //   [as project] (http://1…, hasValue: false}
 *
 * @see {@link Notification}
 * @see {@link dematerialize}
 *
 * @return {Observable<Notification<T>>} An Observable that emits
 * {@link Notification} objects that wrap the original emissions from the source
 * Observable with metadata.
 * @method materialize
 * @owner Observable
 */
function materialize() {
    return this.lift(new MaterializeOperator());
}
exports.materialize = materialize;
var MaterializeOperator = (function () {
    function MaterializeOperator() {
    }
    MaterializeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new MaterializeSubscriber(subscriber));
    };
    return MaterializeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var MaterializeSubscriber = (function (_super) {
    __extends(MaterializeSubscriber, _super);
    function MaterializeSubscriber(destination) {
        _super.call(this, destination);
    }
    MaterializeSubscriber.prototype._next = function (value) {
        this.destination.next(Notification_1.Notification.createNext(value));
    };
    MaterializeSubscriber.prototype._error = function (err) {
        var destination = this.destination;
        destination.next(Notification_1.Notification.createError(err));
        destination.complete();
    };
    MaterializeSubscriber.prototype._complete = function () {
        var destination = this.destination;
        destination.next(Notification_1.Notification.createComplete());
        destination.complete();
    };
    return MaterializeSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=materialize.js.map

/***/ }),
/* 976 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var reduce_1 = __webpack_require__(252);
/**
 * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
 * and when source Observable completes it emits a single item: the item with the largest value.
 *
 * <img src="./img/max.png" width="100%">
 *
 * @example <caption>Get the maximal value of a series of numbers</caption>
 * Rx.Observable.of(5, 4, 7, 2, 8)
 *   .max()
 *   .subscribe(x => console.log(x)); // -> 8
 *
 * @example <caption>Use a comparer function to get the maximal item</caption>
 * interface Person {
 *   age: number,
 *   name: string
 * }
 * Observable.of<Person>({age: 7, name: 'Foo'},
 *                       {age: 5, name: 'Bar'},
 *                       {age: 9, name: 'Beer'})
 *           .max<Person>((a: Person, b: Person) => a.age < b.age ? -1 : 1)
 *           .subscribe((x: Person) => console.log(x.name)); // -> 'Beer'
 * }
 *
 * @see {@link min}
 *
 * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
 * value of two items.
 * @return {Observable} An Observable that emits item with the largest value.
 * @method max
 * @owner Observable
 */
function max(comparer) {
    var max = (typeof comparer === 'function')
        ? function (x, y) { return comparer(x, y) > 0 ? x : y; }
        : function (x, y) { return x > y ? x : y; };
    return this.lift(new reduce_1.ReduceOperator(max));
}
exports.max = max;
//# sourceMappingURL=max.js.map

/***/ }),
/* 977 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var subscribeToResult_1 = __webpack_require__(10);
var OuterSubscriber_1 = __webpack_require__(9);
/**
 * Applies an accumulator function over the source Observable where the
 * accumulator function itself returns an Observable, then each intermediate
 * Observable returned is merged into the output Observable.
 *
 * <span class="informal">It's like {@link scan}, but the Observables returned
 * by the accumulator are merged into the outer Observable.</span>
 *
 * @example <caption>Count the number of click events</caption>
 * const click$ = Rx.Observable.fromEvent(document, 'click');
 * const one$ = click$.mapTo(1);
 * const seed = 0;
 * const count$ = one$.mergeScan((acc, one) => Rx.Observable.of(acc + one), seed);
 * count$.subscribe(x => console.log(x));
 *
 * // Results:
 * 1
 * 2
 * 3
 * 4
 * // ...and so on for each click
 *
 * @param {function(acc: R, value: T): Observable<R>} accumulator
 * The accumulator function called on each source value.
 * @param seed The initial accumulation value.
 * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of
 * input Observables being subscribed to concurrently.
 * @return {Observable<R>} An observable of the accumulated values.
 * @method mergeScan
 * @owner Observable
 */
function mergeScan(accumulator, seed, concurrent) {
    if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
    return this.lift(new MergeScanOperator(accumulator, seed, concurrent));
}
exports.mergeScan = mergeScan;
var MergeScanOperator = (function () {
    function MergeScanOperator(accumulator, seed, concurrent) {
        this.accumulator = accumulator;
        this.seed = seed;
        this.concurrent = concurrent;
    }
    MergeScanOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
    };
    return MergeScanOperator;
}());
exports.MergeScanOperator = MergeScanOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var MergeScanSubscriber = (function (_super) {
    __extends(MergeScanSubscriber, _super);
    function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
        _super.call(this, destination);
        this.accumulator = accumulator;
        this.acc = acc;
        this.concurrent = concurrent;
        this.hasValue = false;
        this.hasCompleted = false;
        this.buffer = [];
        this.active = 0;
        this.index = 0;
    }
    MergeScanSubscriber.prototype._next = function (value) {
        if (this.active < this.concurrent) {
            var index = this.index++;
            var ish = tryCatch_1.tryCatch(this.accumulator)(this.acc, value);
            var destination = this.destination;
            if (ish === errorObject_1.errorObject) {
                destination.error(errorObject_1.errorObject.e);
            }
            else {
                this.active++;
                this._innerSub(ish, value, index);
            }
        }
        else {
            this.buffer.push(value);
        }
    };
    MergeScanSubscriber.prototype._innerSub = function (ish, value, index) {
        this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));
    };
    MergeScanSubscriber.prototype._complete = function () {
        this.hasCompleted = true;
        if (this.active === 0 && this.buffer.length === 0) {
            if (this.hasValue === false) {
                this.destination.next(this.acc);
            }
            this.destination.complete();
        }
    };
    MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var destination = this.destination;
        this.acc = innerValue;
        this.hasValue = true;
        destination.next(innerValue);
    };
    MergeScanSubscriber.prototype.notifyComplete = function (innerSub) {
        var buffer = this.buffer;
        this.remove(innerSub);
        this.active--;
        if (buffer.length > 0) {
            this._next(buffer.shift());
        }
        else if (this.active === 0 && this.hasCompleted) {
            if (this.hasValue === false) {
                this.destination.next(this.acc);
            }
            this.destination.complete();
        }
    };
    return MergeScanSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
exports.MergeScanSubscriber = MergeScanSubscriber;
//# sourceMappingURL=mergeScan.js.map

/***/ }),
/* 978 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var reduce_1 = __webpack_require__(252);
/**
 * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
 * and when source Observable completes it emits a single item: the item with the smallest value.
 *
 * <img src="./img/min.png" width="100%">
 *
 * @example <caption>Get the minimal value of a series of numbers</caption>
 * Rx.Observable.of(5, 4, 7, 2, 8)
 *   .min()
 *   .subscribe(x => console.log(x)); // -> 2
 *
 * @example <caption>Use a comparer function to get the minimal item</caption>
 * interface Person {
 *   age: number,
 *   name: string
 * }
 * Observable.of<Person>({age: 7, name: 'Foo'},
 *                       {age: 5, name: 'Bar'},
 *                       {age: 9, name: 'Beer'})
 *           .min<Person>( (a: Person, b: Person) => a.age < b.age ? -1 : 1)
 *           .subscribe((x: Person) => console.log(x.name)); // -> 'Bar'
 * }
 *
 * @see {@link max}
 *
 * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
 * value of two items.
 * @return {Observable<R>} An Observable that emits item with the smallest value.
 * @method min
 * @owner Observable
 */
function min(comparer) {
    var min = (typeof comparer === 'function')
        ? function (x, y) { return comparer(x, y) < 0 ? x : y; }
        : function (x, y) { return x < y ? x : y; };
    return this.lift(new reduce_1.ReduceOperator(min));
}
exports.min = min;
//# sourceMappingURL=min.js.map

/***/ }),
/* 979 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Groups pairs of consecutive emissions together and emits them as an array of
 * two values.
 *
 * <span class="informal">Puts the current value and previous value together as
 * an array, and emits that.</span>
 *
 * <img src="./img/pairwise.png" width="100%">
 *
 * The Nth emission from the source Observable will cause the output Observable
 * to emit an array [(N-1)th, Nth] of the previous and the current value, as a
 * pair. For this reason, `pairwise` emits on the second and subsequent
 * emissions from the source Observable, but not on the first emission, because
 * there is no previous value in that case.
 *
 * @example <caption>On every click (starting from the second), emit the relative distance to the previous click</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var pairs = clicks.pairwise();
 * var distance = pairs.map(pair => {
 *   var x0 = pair[0].clientX;
 *   var y0 = pair[0].clientY;
 *   var x1 = pair[1].clientX;
 *   var y1 = pair[1].clientY;
 *   return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));
 * });
 * distance.subscribe(x => console.log(x));
 *
 * @see {@link buffer}
 * @see {@link bufferCount}
 *
 * @return {Observable<Array<T>>} An Observable of pairs (as arrays) of
 * consecutive values from the source Observable.
 * @method pairwise
 * @owner Observable
 */
function pairwise() {
    return this.lift(new PairwiseOperator());
}
exports.pairwise = pairwise;
var PairwiseOperator = (function () {
    function PairwiseOperator() {
    }
    PairwiseOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new PairwiseSubscriber(subscriber));
    };
    return PairwiseOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var PairwiseSubscriber = (function (_super) {
    __extends(PairwiseSubscriber, _super);
    function PairwiseSubscriber(destination) {
        _super.call(this, destination);
        this.hasPrev = false;
    }
    PairwiseSubscriber.prototype._next = function (value) {
        if (this.hasPrev) {
            this.destination.next([this.prev, value]);
        }
        else {
            this.hasPrev = true;
        }
        this.prev = value;
    };
    return PairwiseSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=pairwise.js.map

/***/ }),
/* 980 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var not_1 = __webpack_require__(1038);
var filter_1 = __webpack_require__(527);
/**
 * Splits the source Observable into two, one with values that satisfy a
 * predicate, and another with values that don't satisfy the predicate.
 *
 * <span class="informal">It's like {@link filter}, but returns two Observables:
 * one like the output of {@link filter}, and the other with values that did not
 * pass the condition.</span>
 *
 * <img src="./img/partition.png" width="100%">
 *
 * `partition` outputs an array with two Observables that partition the values
 * from the source Observable through the given `predicate` function. The first
 * Observable in that array emits source values for which the predicate argument
 * returns true. The second Observable emits source values for which the
 * predicate returns false. The first behaves like {@link filter} and the second
 * behaves like {@link filter} with the predicate negated.
 *
 * @example <caption>Partition click events into those on DIV elements and those elsewhere</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var parts = clicks.partition(ev => ev.target.tagName === 'DIV');
 * var clicksOnDivs = parts[0];
 * var clicksElsewhere = parts[1];
 * clicksOnDivs.subscribe(x => console.log('DIV clicked: ', x));
 * clicksElsewhere.subscribe(x => console.log('Other clicked: ', x));
 *
 * @see {@link filter}
 *
 * @param {function(value: T, index: number): boolean} predicate A function that
 * evaluates each value emitted by the source Observable. If it returns `true`,
 * the value is emitted on the first Observable in the returned array, if
 * `false` the value is emitted on the second Observable in the array. The
 * `index` parameter is the number `i` for the i-th source emission that has
 * happened since the subscription, starting from the number `0`.
 * @param {any} [thisArg] An optional argument to determine the value of `this`
 * in the `predicate` function.
 * @return {[Observable<T>, Observable<T>]} An array with two Observables: one
 * with values that passed the predicate, and another with values that did not
 * pass the predicate.
 * @method partition
 * @owner Observable
 */
function partition(predicate, thisArg) {
    return [
        filter_1.filter.call(this, predicate, thisArg),
        filter_1.filter.call(this, not_1.not(predicate, thisArg))
    ];
}
exports.partition = partition;
//# sourceMappingURL=partition.js.map

/***/ }),
/* 981 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var map_1 = __webpack_require__(249);
/**
 * Maps each source value (an object) to its specified nested property.
 *
 * <span class="informal">Like {@link map}, but meant only for picking one of
 * the nested properties of every emitted object.</span>
 *
 * <img src="./img/pluck.png" width="100%">
 *
 * Given a list of strings describing a path to an object property, retrieves
 * the value of a specified nested property from all values in the source
 * Observable. If a property can't be resolved, it will return `undefined` for
 * that value.
 *
 * @example <caption>Map every click to the tagName of the clicked target element</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var tagNames = clicks.pluck('target', 'tagName');
 * tagNames.subscribe(x => console.log(x));
 *
 * @see {@link map}
 *
 * @param {...string} properties The nested properties to pluck from each source
 * value (an object).
 * @return {Observable} A new Observable of property values from the source values.
 * @method pluck
 * @owner Observable
 */
function pluck() {
    var properties = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        properties[_i - 0] = arguments[_i];
    }
    var length = properties.length;
    if (length === 0) {
        throw new Error('list of properties cannot be empty.');
    }
    return map_1.map.call(this, plucker(properties, length));
}
exports.pluck = pluck;
function plucker(props, length) {
    var mapper = function (x) {
        var currentProp = x;
        for (var i = 0; i < length; i++) {
            var p = currentProp[props[i]];
            if (typeof p !== 'undefined') {
                currentProp = p;
            }
            else {
                return undefined;
            }
        }
        return currentProp;
    };
    return mapper;
}
//# sourceMappingURL=pluck.js.map

/***/ }),
/* 982 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var Subject_1 = __webpack_require__(11);
var multicast_1 = __webpack_require__(84);
/* tslint:enable:max-line-length */
/**
 * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called
 * before it begins emitting items to those Observers that have subscribed to it.
 *
 * <img src="./img/publish.png" width="100%">
 *
 * @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times
 * as needed, without causing multiple subscriptions to the source sequence.
 * Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
 * @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.
 * @method publish
 * @owner Observable
 */
function publish(selector) {
    return selector ? multicast_1.multicast.call(this, function () { return new Subject_1.Subject(); }, selector) :
        multicast_1.multicast.call(this, new Subject_1.Subject());
}
exports.publish = publish;
//# sourceMappingURL=publish.js.map

/***/ }),
/* 983 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var BehaviorSubject_1 = __webpack_require__(150);
var multicast_1 = __webpack_require__(84);
/**
 * @param value
 * @return {ConnectableObservable<T>}
 * @method publishBehavior
 * @owner Observable
 */
function publishBehavior(value) {
    return multicast_1.multicast.call(this, new BehaviorSubject_1.BehaviorSubject(value));
}
exports.publishBehavior = publishBehavior;
//# sourceMappingURL=publishBehavior.js.map

/***/ }),
/* 984 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var AsyncSubject_1 = __webpack_require__(144);
var multicast_1 = __webpack_require__(84);
/**
 * @return {ConnectableObservable<T>}
 * @method publishLast
 * @owner Observable
 */
function publishLast() {
    return multicast_1.multicast.call(this, new AsyncSubject_1.AsyncSubject());
}
exports.publishLast = publishLast;
//# sourceMappingURL=publishLast.js.map

/***/ }),
/* 985 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var ReplaySubject_1 = __webpack_require__(103);
var multicast_1 = __webpack_require__(84);
/**
 * @param bufferSize
 * @param windowTime
 * @param scheduler
 * @return {ConnectableObservable<T>}
 * @method publishReplay
 * @owner Observable
 */
function publishReplay(bufferSize, windowTime, scheduler) {
    if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; }
    if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; }
    return multicast_1.multicast.call(this, new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler));
}
exports.publishReplay = publishReplay;
//# sourceMappingURL=publishReplay.js.map

/***/ }),
/* 986 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var EmptyObservable_1 = __webpack_require__(111);
/**
 * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times.
 *
 * <img src="./img/repeat.png" width="100%">
 *
 * @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield
 * an empty Observable.
 * @return {Observable} An Observable that repeats the stream of items emitted by the source Observable at most
 * count times.
 * @method repeat
 * @owner Observable
 */
function repeat(count) {
    if (count === void 0) { count = -1; }
    if (count === 0) {
        return new EmptyObservable_1.EmptyObservable();
    }
    else if (count < 0) {
        return this.lift(new RepeatOperator(-1, this));
    }
    else {
        return this.lift(new RepeatOperator(count - 1, this));
    }
}
exports.repeat = repeat;
var RepeatOperator = (function () {
    function RepeatOperator(count, source) {
        this.count = count;
        this.source = source;
    }
    RepeatOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
    };
    return RepeatOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var RepeatSubscriber = (function (_super) {
    __extends(RepeatSubscriber, _super);
    function RepeatSubscriber(destination, count, source) {
        _super.call(this, destination);
        this.count = count;
        this.source = source;
    }
    RepeatSubscriber.prototype.complete = function () {
        if (!this.isStopped) {
            var _a = this, source = _a.source, count = _a.count;
            if (count === 0) {
                return _super.prototype.complete.call(this);
            }
            else if (count > -1) {
                this.count = count - 1;
            }
            source.subscribe(this._unsubscribeAndRecycle());
        }
    };
    return RepeatSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=repeat.js.map

/***/ }),
/* 987 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source
 * Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable
 * calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise
 * this method will resubscribe to the source Observable.
 *
 * <img src="./img/repeatWhen.png" width="100%">
 *
 * @param {function(notifications: Observable): Observable} notifier - Receives an Observable of notifications with
 * which a user can `complete` or `error`, aborting the repetition.
 * @return {Observable} The source Observable modified with repeat logic.
 * @method repeatWhen
 * @owner Observable
 */
function repeatWhen(notifier) {
    return this.lift(new RepeatWhenOperator(notifier));
}
exports.repeatWhen = repeatWhen;
var RepeatWhenOperator = (function () {
    function RepeatWhenOperator(notifier) {
        this.notifier = notifier;
    }
    RepeatWhenOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
    };
    return RepeatWhenOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var RepeatWhenSubscriber = (function (_super) {
    __extends(RepeatWhenSubscriber, _super);
    function RepeatWhenSubscriber(destination, notifier, source) {
        _super.call(this, destination);
        this.notifier = notifier;
        this.source = source;
        this.sourceIsBeingSubscribedTo = true;
    }
    RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.sourceIsBeingSubscribedTo = true;
        this.source.subscribe(this);
    };
    RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) {
        if (this.sourceIsBeingSubscribedTo === false) {
            return _super.prototype.complete.call(this);
        }
    };
    RepeatWhenSubscriber.prototype.complete = function () {
        this.sourceIsBeingSubscribedTo = false;
        if (!this.isStopped) {
            if (!this.retries) {
                this.subscribeToRetries();
            }
            else if (this.retriesSubscription.closed) {
                return _super.prototype.complete.call(this);
            }
            this._unsubscribeAndRecycle();
            this.notifications.next();
        }
    };
    RepeatWhenSubscriber.prototype._unsubscribe = function () {
        var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;
        if (notifications) {
            notifications.unsubscribe();
            this.notifications = null;
        }
        if (retriesSubscription) {
            retriesSubscription.unsubscribe();
            this.retriesSubscription = null;
        }
        this.retries = null;
    };
    RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {
        var _a = this, notifications = _a.notifications, retries = _a.retries, retriesSubscription = _a.retriesSubscription;
        this.notifications = null;
        this.retries = null;
        this.retriesSubscription = null;
        _super.prototype._unsubscribeAndRecycle.call(this);
        this.notifications = notifications;
        this.retries = retries;
        this.retriesSubscription = retriesSubscription;
        return this;
    };
    RepeatWhenSubscriber.prototype.subscribeToRetries = function () {
        this.notifications = new Subject_1.Subject();
        var retries = tryCatch_1.tryCatch(this.notifier)(this.notifications);
        if (retries === errorObject_1.errorObject) {
            return _super.prototype.complete.call(this);
        }
        this.retries = retries;
        this.retriesSubscription = subscribeToResult_1.subscribeToResult(this, retries);
    };
    return RepeatWhenSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=repeatWhen.js.map

/***/ }),
/* 988 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
 * calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given
 * as a number parameter) rather than propagating the `error` call.
 *
 * <img src="./img/retry.png" width="100%">
 *
 * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted
 * during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second
 * time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications
 * would be: [1, 2, 1, 2, 3, 4, 5, `complete`].
 * @param {number} count - Number of retry attempts before failing.
 * @return {Observable} The source Observable modified with the retry logic.
 * @method retry
 * @owner Observable
 */
function retry(count) {
    if (count === void 0) { count = -1; }
    return this.lift(new RetryOperator(count, this));
}
exports.retry = retry;
var RetryOperator = (function () {
    function RetryOperator(count, source) {
        this.count = count;
        this.source = source;
    }
    RetryOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
    };
    return RetryOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var RetrySubscriber = (function (_super) {
    __extends(RetrySubscriber, _super);
    function RetrySubscriber(destination, count, source) {
        _super.call(this, destination);
        this.count = count;
        this.source = source;
    }
    RetrySubscriber.prototype.error = function (err) {
        if (!this.isStopped) {
            var _a = this, source = _a.source, count = _a.count;
            if (count === 0) {
                return _super.prototype.error.call(this, err);
            }
            else if (count > -1) {
                this.count = count - 1;
            }
            source.subscribe(this._unsubscribeAndRecycle());
        }
    };
    return RetrySubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=retry.js.map

/***/ }),
/* 989 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
 * calls `error`, this method will emit the Throwable that caused the error to the Observable returned from `notifier`.
 * If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child
 * subscription. Otherwise this method will resubscribe to the source Observable.
 *
 * <img src="./img/retryWhen.png" width="100%">
 *
 * @param {function(errors: Observable): Observable} notifier - Receives an Observable of notifications with which a
 * user can `complete` or `error`, aborting the retry.
 * @return {Observable} The source Observable modified with retry logic.
 * @method retryWhen
 * @owner Observable
 */
function retryWhen(notifier) {
    return this.lift(new RetryWhenOperator(notifier, this));
}
exports.retryWhen = retryWhen;
var RetryWhenOperator = (function () {
    function RetryWhenOperator(notifier, source) {
        this.notifier = notifier;
        this.source = source;
    }
    RetryWhenOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
    };
    return RetryWhenOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var RetryWhenSubscriber = (function (_super) {
    __extends(RetryWhenSubscriber, _super);
    function RetryWhenSubscriber(destination, notifier, source) {
        _super.call(this, destination);
        this.notifier = notifier;
        this.source = source;
    }
    RetryWhenSubscriber.prototype.error = function (err) {
        if (!this.isStopped) {
            var errors = this.errors;
            var retries = this.retries;
            var retriesSubscription = this.retriesSubscription;
            if (!retries) {
                errors = new Subject_1.Subject();
                retries = tryCatch_1.tryCatch(this.notifier)(errors);
                if (retries === errorObject_1.errorObject) {
                    return _super.prototype.error.call(this, errorObject_1.errorObject.e);
                }
                retriesSubscription = subscribeToResult_1.subscribeToResult(this, retries);
            }
            else {
                this.errors = null;
                this.retriesSubscription = null;
            }
            this._unsubscribeAndRecycle();
            this.errors = errors;
            this.retries = retries;
            this.retriesSubscription = retriesSubscription;
            errors.next(err);
        }
    };
    RetryWhenSubscriber.prototype._unsubscribe = function () {
        var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;
        if (errors) {
            errors.unsubscribe();
            this.errors = null;
        }
        if (retriesSubscription) {
            retriesSubscription.unsubscribe();
            this.retriesSubscription = null;
        }
        this.retries = null;
    };
    RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var _a = this, errors = _a.errors, retries = _a.retries, retriesSubscription = _a.retriesSubscription;
        this.errors = null;
        this.retries = null;
        this.retriesSubscription = null;
        this._unsubscribeAndRecycle();
        this.errors = errors;
        this.retries = retries;
        this.retriesSubscription = retriesSubscription;
        this.source.subscribe(this);
    };
    return RetryWhenSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=retryWhen.js.map

/***/ }),
/* 990 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Emits the most recently emitted value from the source Observable whenever
 * another Observable, the `notifier`, emits.
 *
 * <span class="informal">It's like {@link sampleTime}, but samples whenever
 * the `notifier` Observable emits something.</span>
 *
 * <img src="./img/sample.png" width="100%">
 *
 * Whenever the `notifier` Observable emits a value or completes, `sample`
 * looks at the source Observable and emits whichever value it has most recently
 * emitted since the previous sampling, unless the source has not emitted
 * anything since the previous sampling. The `notifier` is subscribed to as soon
 * as the output Observable is subscribed.
 *
 * @example <caption>On every click, sample the most recent "seconds" timer</caption>
 * var seconds = Rx.Observable.interval(1000);
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = seconds.sample(clicks);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link audit}
 * @see {@link debounce}
 * @see {@link sampleTime}
 * @see {@link throttle}
 *
 * @param {Observable<any>} notifier The Observable to use for sampling the
 * source Observable.
 * @return {Observable<T>} An Observable that emits the results of sampling the
 * values emitted by the source Observable whenever the notifier Observable
 * emits value or completes.
 * @method sample
 * @owner Observable
 */
function sample(notifier) {
    return this.lift(new SampleOperator(notifier));
}
exports.sample = sample;
var SampleOperator = (function () {
    function SampleOperator(notifier) {
        this.notifier = notifier;
    }
    SampleOperator.prototype.call = function (subscriber, source) {
        var sampleSubscriber = new SampleSubscriber(subscriber);
        var subscription = source.subscribe(sampleSubscriber);
        subscription.add(subscribeToResult_1.subscribeToResult(sampleSubscriber, this.notifier));
        return subscription;
    };
    return SampleOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SampleSubscriber = (function (_super) {
    __extends(SampleSubscriber, _super);
    function SampleSubscriber() {
        _super.apply(this, arguments);
        this.hasValue = false;
    }
    SampleSubscriber.prototype._next = function (value) {
        this.value = value;
        this.hasValue = true;
    };
    SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.emitValue();
    };
    SampleSubscriber.prototype.notifyComplete = function () {
        this.emitValue();
    };
    SampleSubscriber.prototype.emitValue = function () {
        if (this.hasValue) {
            this.hasValue = false;
            this.destination.next(this.value);
        }
    };
    return SampleSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=sample.js.map

/***/ }),
/* 991 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var async_1 = __webpack_require__(23);
/**
 * Emits the most recently emitted value from the source Observable within
 * periodic time intervals.
 *
 * <span class="informal">Samples the source Observable at periodic time
 * intervals, emitting what it samples.</span>
 *
 * <img src="./img/sampleTime.png" width="100%">
 *
 * `sampleTime` periodically looks at the source Observable and emits whichever
 * value it has most recently emitted since the previous sampling, unless the
 * source has not emitted anything since the previous sampling. The sampling
 * happens periodically in time every `period` milliseconds (or the time unit
 * defined by the optional `scheduler` argument). The sampling starts as soon as
 * the output Observable is subscribed.
 *
 * @example <caption>Every second, emit the most recent click at most once</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.sampleTime(1000);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link auditTime}
 * @see {@link debounceTime}
 * @see {@link delay}
 * @see {@link sample}
 * @see {@link throttleTime}
 *
 * @param {number} period The sampling period expressed in milliseconds or the
 * time unit determined internally by the optional `scheduler`.
 * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
 * managing the timers that handle the sampling.
 * @return {Observable<T>} An Observable that emits the results of sampling the
 * values emitted by the source Observable at the specified time interval.
 * @method sampleTime
 * @owner Observable
 */
function sampleTime(period, scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    return this.lift(new SampleTimeOperator(period, scheduler));
}
exports.sampleTime = sampleTime;
var SampleTimeOperator = (function () {
    function SampleTimeOperator(period, scheduler) {
        this.period = period;
        this.scheduler = scheduler;
    }
    SampleTimeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
    };
    return SampleTimeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SampleTimeSubscriber = (function (_super) {
    __extends(SampleTimeSubscriber, _super);
    function SampleTimeSubscriber(destination, period, scheduler) {
        _super.call(this, destination);
        this.period = period;
        this.scheduler = scheduler;
        this.hasValue = false;
        this.add(scheduler.schedule(dispatchNotification, period, { subscriber: this, period: period }));
    }
    SampleTimeSubscriber.prototype._next = function (value) {
        this.lastValue = value;
        this.hasValue = true;
    };
    SampleTimeSubscriber.prototype.notifyNext = function () {
        if (this.hasValue) {
            this.hasValue = false;
            this.destination.next(this.lastValue);
        }
    };
    return SampleTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchNotification(state) {
    var subscriber = state.subscriber, period = state.period;
    subscriber.notifyNext();
    this.schedule(state, period);
}
//# sourceMappingURL=sampleTime.js.map

/***/ }),
/* 992 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/* tslint:enable:max-line-length */
/**
 * Applies an accumulator function over the source Observable, and returns each
 * intermediate result, with an optional seed value.
 *
 * <span class="informal">It's like {@link reduce}, but emits the current
 * accumulation whenever the source emits a value.</span>
 *
 * <img src="./img/scan.png" width="100%">
 *
 * Combines together all values emitted on the source, using an accumulator
 * function that knows how to join a new source value into the accumulation from
 * the past. Is similar to {@link reduce}, but emits the intermediate
 * accumulations.
 *
 * Returns an Observable that applies a specified `accumulator` function to each
 * item emitted by the source Observable. If a `seed` value is specified, then
 * that value will be used as the initial value for the accumulator. If no seed
 * value is specified, the first item of the source is used as the seed.
 *
 * @example <caption>Count the number of click events</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var ones = clicks.mapTo(1);
 * var seed = 0;
 * var count = ones.scan((acc, one) => acc + one, seed);
 * count.subscribe(x => console.log(x));
 *
 * @see {@link expand}
 * @see {@link mergeScan}
 * @see {@link reduce}
 *
 * @param {function(acc: R, value: T, index: number): R} accumulator
 * The accumulator function called on each source value.
 * @param {T|R} [seed] The initial accumulation value.
 * @return {Observable<R>} An observable of the accumulated values.
 * @method scan
 * @owner Observable
 */
function scan(accumulator, seed) {
    var hasSeed = false;
    // providing a seed of `undefined` *should* be valid and trigger
    // hasSeed! so don't use `seed !== undefined` checks!
    // For this reason, we have to check it here at the original call site
    // otherwise inside Operator/Subscriber we won't know if `undefined`
    // means they didn't provide anything or if they literally provided `undefined`
    if (arguments.length >= 2) {
        hasSeed = true;
    }
    return this.lift(new ScanOperator(accumulator, seed, hasSeed));
}
exports.scan = scan;
var ScanOperator = (function () {
    function ScanOperator(accumulator, seed, hasSeed) {
        if (hasSeed === void 0) { hasSeed = false; }
        this.accumulator = accumulator;
        this.seed = seed;
        this.hasSeed = hasSeed;
    }
    ScanOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
    };
    return ScanOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ScanSubscriber = (function (_super) {
    __extends(ScanSubscriber, _super);
    function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
        _super.call(this, destination);
        this.accumulator = accumulator;
        this._seed = _seed;
        this.hasSeed = hasSeed;
        this.index = 0;
    }
    Object.defineProperty(ScanSubscriber.prototype, "seed", {
        get: function () {
            return this._seed;
        },
        set: function (value) {
            this.hasSeed = true;
            this._seed = value;
        },
        enumerable: true,
        configurable: true
    });
    ScanSubscriber.prototype._next = function (value) {
        if (!this.hasSeed) {
            this.seed = value;
            this.destination.next(value);
        }
        else {
            return this._tryNext(value);
        }
    };
    ScanSubscriber.prototype._tryNext = function (value) {
        var index = this.index++;
        var result;
        try {
            result = this.accumulator(this.seed, value, index);
        }
        catch (err) {
            this.destination.error(err);
        }
        this.seed = result;
        this.destination.next(result);
    };
    return ScanSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=scan.js.map

/***/ }),
/* 993 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
/**
 * Compares all values of two observables in sequence using an optional comparor function
 * and returns an observable of a single boolean value representing whether or not the two sequences
 * are equal.
 *
 * <span class="informal">Checks to see of all values emitted by both observables are equal, in order.</span>
 *
 * <img src="./img/sequenceEqual.png" width="100%">
 *
 * `sequenceEqual` subscribes to two observables and buffers incoming values from each observable. Whenever either
 * observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom
 * up; If any value pair doesn't match, the returned observable will emit `false` and complete. If one of the
 * observables completes, the operator will wait for the other observable to complete; If the other
 * observable emits before completing, the returned observable will emit `false` and complete. If one observable never
 * completes or emits after the other complets, the returned observable will never complete.
 *
 * @example <caption>figure out if the Konami code matches</caption>
 * var code = Rx.Observable.from([
 *  "ArrowUp",
 *  "ArrowUp",
 *  "ArrowDown",
 *  "ArrowDown",
 *  "ArrowLeft",
 *  "ArrowRight",
 *  "ArrowLeft",
 *  "ArrowRight",
 *  "KeyB",
 *  "KeyA",
 *  "Enter" // no start key, clearly.
 * ]);
 *
 * var keys = Rx.Observable.fromEvent(document, 'keyup')
 *  .map(e => e.code);
 * var matches = keys.bufferCount(11, 1)
 *  .mergeMap(
 *    last11 =>
 *      Rx.Observable.from(last11)
 *        .sequenceEqual(code)
 *   );
 * matches.subscribe(matched => console.log('Successful cheat at Contra? ', matched));
 *
 * @see {@link combineLatest}
 * @see {@link zip}
 * @see {@link withLatestFrom}
 *
 * @param {Observable} compareTo The observable sequence to compare the source sequence to.
 * @param {function} [comparor] An optional function to compare each value pair
 * @return {Observable} An Observable of a single boolean value representing whether or not
 * the values emitted by both observables were equal in sequence.
 * @method sequenceEqual
 * @owner Observable
 */
function sequenceEqual(compareTo, comparor) {
    return this.lift(new SequenceEqualOperator(compareTo, comparor));
}
exports.sequenceEqual = sequenceEqual;
var SequenceEqualOperator = (function () {
    function SequenceEqualOperator(compareTo, comparor) {
        this.compareTo = compareTo;
        this.comparor = comparor;
    }
    SequenceEqualOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor));
    };
    return SequenceEqualOperator;
}());
exports.SequenceEqualOperator = SequenceEqualOperator;
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SequenceEqualSubscriber = (function (_super) {
    __extends(SequenceEqualSubscriber, _super);
    function SequenceEqualSubscriber(destination, compareTo, comparor) {
        _super.call(this, destination);
        this.compareTo = compareTo;
        this.comparor = comparor;
        this._a = [];
        this._b = [];
        this._oneComplete = false;
        this.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this)));
    }
    SequenceEqualSubscriber.prototype._next = function (value) {
        if (this._oneComplete && this._b.length === 0) {
            this.emit(false);
        }
        else {
            this._a.push(value);
            this.checkValues();
        }
    };
    SequenceEqualSubscriber.prototype._complete = function () {
        if (this._oneComplete) {
            this.emit(this._a.length === 0 && this._b.length === 0);
        }
        else {
            this._oneComplete = true;
        }
    };
    SequenceEqualSubscriber.prototype.checkValues = function () {
        var _c = this, _a = _c._a, _b = _c._b, comparor = _c.comparor;
        while (_a.length > 0 && _b.length > 0) {
            var a = _a.shift();
            var b = _b.shift();
            var areEqual = false;
            if (comparor) {
                areEqual = tryCatch_1.tryCatch(comparor)(a, b);
                if (areEqual === errorObject_1.errorObject) {
                    this.destination.error(errorObject_1.errorObject.e);
                }
            }
            else {
                areEqual = a === b;
            }
            if (!areEqual) {
                this.emit(false);
            }
        }
    };
    SequenceEqualSubscriber.prototype.emit = function (value) {
        var destination = this.destination;
        destination.next(value);
        destination.complete();
    };
    SequenceEqualSubscriber.prototype.nextB = function (value) {
        if (this._oneComplete && this._a.length === 0) {
            this.emit(false);
        }
        else {
            this._b.push(value);
            this.checkValues();
        }
    };
    return SequenceEqualSubscriber;
}(Subscriber_1.Subscriber));
exports.SequenceEqualSubscriber = SequenceEqualSubscriber;
var SequenceEqualCompareToSubscriber = (function (_super) {
    __extends(SequenceEqualCompareToSubscriber, _super);
    function SequenceEqualCompareToSubscriber(destination, parent) {
        _super.call(this, destination);
        this.parent = parent;
    }
    SequenceEqualCompareToSubscriber.prototype._next = function (value) {
        this.parent.nextB(value);
    };
    SequenceEqualCompareToSubscriber.prototype._error = function (err) {
        this.parent.error(err);
    };
    SequenceEqualCompareToSubscriber.prototype._complete = function () {
        this.parent._complete();
    };
    return SequenceEqualCompareToSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=sequenceEqual.js.map

/***/ }),
/* 994 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var multicast_1 = __webpack_require__(84);
var ReplaySubject_1 = __webpack_require__(103);
/**
 * @method shareReplay
 * @owner Observable
 */
function shareReplay(bufferSize, windowTime, scheduler) {
    var subject;
    var connectable = multicast_1.multicast.call(this, function shareReplaySubjectFactory() {
        if (this._isComplete) {
            return subject;
        }
        else {
            return (subject = new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler));
        }
    });
    return connectable.refCount();
}
exports.shareReplay = shareReplay;
;
//# sourceMappingURL=shareReplay.js.map

/***/ }),
/* 995 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var EmptyError_1 = __webpack_require__(522);
/**
 * Returns an Observable that emits the single item emitted by the source Observable that matches a specified
 * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no
 * such items, notify of an IllegalArgumentException or NoSuchElementException respectively.
 *
 * <img src="./img/single.png" width="100%">
 *
 * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
 * callback if the Observable completes before any `next` notification was sent.
 * @param {Function} predicate - A predicate function to evaluate items emitted by the source Observable.
 * @return {Observable<T>} An Observable that emits the single item emitted by the source Observable that matches
 * the predicate.
 .
 * @method single
 * @owner Observable
 */
function single(predicate) {
    return this.lift(new SingleOperator(predicate, this));
}
exports.single = single;
var SingleOperator = (function () {
    function SingleOperator(predicate, source) {
        this.predicate = predicate;
        this.source = source;
    }
    SingleOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
    };
    return SingleOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SingleSubscriber = (function (_super) {
    __extends(SingleSubscriber, _super);
    function SingleSubscriber(destination, predicate, source) {
        _super.call(this, destination);
        this.predicate = predicate;
        this.source = source;
        this.seenValue = false;
        this.index = 0;
    }
    SingleSubscriber.prototype.applySingleValue = function (value) {
        if (this.seenValue) {
            this.destination.error('Sequence contains more than one element');
        }
        else {
            this.seenValue = true;
            this.singleValue = value;
        }
    };
    SingleSubscriber.prototype._next = function (value) {
        var index = this.index++;
        if (this.predicate) {
            this.tryNext(value, index);
        }
        else {
            this.applySingleValue(value);
        }
    };
    SingleSubscriber.prototype.tryNext = function (value, index) {
        try {
            if (this.predicate(value, index, this.source)) {
                this.applySingleValue(value);
            }
        }
        catch (err) {
            this.destination.error(err);
        }
    };
    SingleSubscriber.prototype._complete = function () {
        var destination = this.destination;
        if (this.index > 0) {
            destination.next(this.seenValue ? this.singleValue : undefined);
            destination.complete();
        }
        else {
            destination.error(new EmptyError_1.EmptyError);
        }
    };
    return SingleSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=single.js.map

/***/ }),
/* 996 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Returns an Observable that skips the first `count` items emitted by the source Observable.
 *
 * <img src="./img/skip.png" width="100%">
 *
 * @param {Number} count - The number of times, items emitted by source Observable should be skipped.
 * @return {Observable} An Observable that skips values emitted by the source Observable.
 *
 * @method skip
 * @owner Observable
 */
function skip(count) {
    return this.lift(new SkipOperator(count));
}
exports.skip = skip;
var SkipOperator = (function () {
    function SkipOperator(total) {
        this.total = total;
    }
    SkipOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SkipSubscriber(subscriber, this.total));
    };
    return SkipOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SkipSubscriber = (function (_super) {
    __extends(SkipSubscriber, _super);
    function SkipSubscriber(destination, total) {
        _super.call(this, destination);
        this.total = total;
        this.count = 0;
    }
    SkipSubscriber.prototype._next = function (x) {
        if (++this.count > this.total) {
            this.destination.next(x);
        }
    };
    return SkipSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=skip.js.map

/***/ }),
/* 997 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var ArgumentOutOfRangeError_1 = __webpack_require__(110);
/**
 * Skip the last `count` values emitted by the source Observable.
 *
 * <img src="./img/skipLast.png" width="100%">
 *
 * `skipLast` returns an Observable that accumulates a queue with a length
 * enough to store the first `count` values. As more values are received,
 * values are taken from the front of the queue and produced on the result
 * sequence. This causes values to be delayed.
 *
 * @example <caption>Skip the last 2 values of an Observable with many values</caption>
 * var many = Rx.Observable.range(1, 5);
 * var skipLastTwo = many.skipLast(2);
 * skipLastTwo.subscribe(x => console.log(x));
 *
 * // Results in:
 * // 1 2 3
 *
 * @see {@link skip}
 * @see {@link skipUntil}
 * @see {@link skipWhile}
 * @see {@link take}
 *
 * @throws {ArgumentOutOfRangeError} When using `skipLast(i)`, it throws
 * ArgumentOutOrRangeError if `i < 0`.
 *
 * @param {number} count Number of elements to skip from the end of the source Observable.
 * @returns {Observable<T>} An Observable that skips the last count values
 * emitted by the source Observable.
 * @method skipLast
 * @owner Observable
 */
function skipLast(count) {
    return this.lift(new SkipLastOperator(count));
}
exports.skipLast = skipLast;
var SkipLastOperator = (function () {
    function SkipLastOperator(_skipCount) {
        this._skipCount = _skipCount;
        if (this._skipCount < 0) {
            throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
        }
    }
    SkipLastOperator.prototype.call = function (subscriber, source) {
        if (this._skipCount === 0) {
            // If we don't want to skip any values then just subscribe
            // to Subscriber without any further logic.
            return source.subscribe(new Subscriber_1.Subscriber(subscriber));
        }
        else {
            return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
        }
    };
    return SkipLastOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SkipLastSubscriber = (function (_super) {
    __extends(SkipLastSubscriber, _super);
    function SkipLastSubscriber(destination, _skipCount) {
        _super.call(this, destination);
        this._skipCount = _skipCount;
        this._count = 0;
        this._ring = new Array(_skipCount);
    }
    SkipLastSubscriber.prototype._next = function (value) {
        var skipCount = this._skipCount;
        var count = this._count++;
        if (count < skipCount) {
            this._ring[count] = value;
        }
        else {
            var currentIndex = count % skipCount;
            var ring = this._ring;
            var oldValue = ring[currentIndex];
            ring[currentIndex] = value;
            this.destination.next(oldValue);
        }
    };
    return SkipLastSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=skipLast.js.map

/***/ }),
/* 998 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
 *
 * <img src="./img/skipUntil.png" width="100%">
 *
 * @param {Observable} notifier - The second Observable that has to emit an item before the source Observable's elements begin to
 * be mirrored by the resulting Observable.
 * @return {Observable<T>} An Observable that skips items from the source Observable until the second Observable emits
 * an item, then emits the remaining items.
 * @method skipUntil
 * @owner Observable
 */
function skipUntil(notifier) {
    return this.lift(new SkipUntilOperator(notifier));
}
exports.skipUntil = skipUntil;
var SkipUntilOperator = (function () {
    function SkipUntilOperator(notifier) {
        this.notifier = notifier;
    }
    SkipUntilOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SkipUntilSubscriber(subscriber, this.notifier));
    };
    return SkipUntilOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SkipUntilSubscriber = (function (_super) {
    __extends(SkipUntilSubscriber, _super);
    function SkipUntilSubscriber(destination, notifier) {
        _super.call(this, destination);
        this.hasValue = false;
        this.isInnerStopped = false;
        this.add(subscribeToResult_1.subscribeToResult(this, notifier));
    }
    SkipUntilSubscriber.prototype._next = function (value) {
        if (this.hasValue) {
            _super.prototype._next.call(this, value);
        }
    };
    SkipUntilSubscriber.prototype._complete = function () {
        if (this.isInnerStopped) {
            _super.prototype._complete.call(this);
        }
        else {
            this.unsubscribe();
        }
    };
    SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.hasValue = true;
    };
    SkipUntilSubscriber.prototype.notifyComplete = function () {
        this.isInnerStopped = true;
        if (this.isStopped) {
            _super.prototype._complete.call(this);
        }
    };
    return SkipUntilSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=skipUntil.js.map

/***/ }),
/* 999 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds
 * true, but emits all further source items as soon as the condition becomes false.
 *
 * <img src="./img/skipWhile.png" width="100%">
 *
 * @param {Function} predicate - A function to test each item emitted from the source Observable.
 * @return {Observable<T>} An Observable that begins emitting items emitted by the source Observable when the
 * specified predicate becomes false.
 * @method skipWhile
 * @owner Observable
 */
function skipWhile(predicate) {
    return this.lift(new SkipWhileOperator(predicate));
}
exports.skipWhile = skipWhile;
var SkipWhileOperator = (function () {
    function SkipWhileOperator(predicate) {
        this.predicate = predicate;
    }
    SkipWhileOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
    };
    return SkipWhileOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SkipWhileSubscriber = (function (_super) {
    __extends(SkipWhileSubscriber, _super);
    function SkipWhileSubscriber(destination, predicate) {
        _super.call(this, destination);
        this.predicate = predicate;
        this.skipping = true;
        this.index = 0;
    }
    SkipWhileSubscriber.prototype._next = function (value) {
        var destination = this.destination;
        if (this.skipping) {
            this.tryCallPredicate(value);
        }
        if (!this.skipping) {
            destination.next(value);
        }
    };
    SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
        try {
            var result = this.predicate(value, this.index++);
            this.skipping = Boolean(result);
        }
        catch (err) {
            this.destination.error(err);
        }
    };
    return SkipWhileSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=skipWhile.js.map

/***/ }),
/* 1000 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var ArrayObservable_1 = __webpack_require__(82);
var ScalarObservable_1 = __webpack_require__(1048);
var EmptyObservable_1 = __webpack_require__(111);
var concat_1 = __webpack_require__(247);
var isScheduler_1 = __webpack_require__(57);
/* tslint:enable:max-line-length */
/**
 * Returns an Observable that emits the items you specify as arguments before it begins to emit
 * items emitted by the source Observable.
 *
 * <img src="./img/startWith.png" width="100%">
 *
 * @param {...T} values - Items you want the modified Observable to emit first.
 * @param {Scheduler} [scheduler] - A {@link IScheduler} to use for scheduling
 * the emissions of the `next` notifications.
 * @return {Observable} An Observable that emits the items in the specified Iterable and then emits the items
 * emitted by the source Observable.
 * @method startWith
 * @owner Observable
 */
function startWith() {
    var array = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        array[_i - 0] = arguments[_i];
    }
    var scheduler = array[array.length - 1];
    if (isScheduler_1.isScheduler(scheduler)) {
        array.pop();
    }
    else {
        scheduler = null;
    }
    var len = array.length;
    if (len === 1) {
        return concat_1.concatStatic(new ScalarObservable_1.ScalarObservable(array[0], scheduler), this);
    }
    else if (len > 1) {
        return concat_1.concatStatic(new ArrayObservable_1.ArrayObservable(array, scheduler), this);
    }
    else {
        return concat_1.concatStatic(new EmptyObservable_1.EmptyObservable(scheduler), this);
    }
}
exports.startWith = startWith;
//# sourceMappingURL=startWith.js.map

/***/ }),
/* 1001 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var SubscribeOnObservable_1 = __webpack_require__(922);
/**
 * Asynchronously subscribes Observers to this Observable on the specified IScheduler.
 *
 * <img src="./img/subscribeOn.png" width="100%">
 *
 * @param {Scheduler} scheduler - The IScheduler to perform subscription actions on.
 * @return {Observable<T>} The source Observable modified so that its subscriptions happen on the specified IScheduler.
 .
 * @method subscribeOn
 * @owner Observable
 */
function subscribeOn(scheduler, delay) {
    if (delay === void 0) { delay = 0; }
    return this.lift(new SubscribeOnOperator(scheduler, delay));
}
exports.subscribeOn = subscribeOn;
var SubscribeOnOperator = (function () {
    function SubscribeOnOperator(scheduler, delay) {
        this.scheduler = scheduler;
        this.delay = delay;
    }
    SubscribeOnOperator.prototype.call = function (subscriber, source) {
        return new SubscribeOnObservable_1.SubscribeOnObservable(source, this.delay, this.scheduler).subscribe(subscriber);
    };
    return SubscribeOnOperator;
}());
//# sourceMappingURL=subscribeOn.js.map

/***/ }),
/* 1002 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Converts a higher-order Observable into a first-order Observable by
 * subscribing to only the most recently emitted of those inner Observables.
 *
 * <span class="informal">Flattens an Observable-of-Observables by dropping the
 * previous inner Observable once a new one appears.</span>
 *
 * <img src="./img/switch.png" width="100%">
 *
 * `switch` subscribes to an Observable that emits Observables, also known as a
 * higher-order Observable. Each time it observes one of these emitted inner
 * Observables, the output Observable subscribes to the inner Observable and
 * begins emitting the items emitted by that. So far, it behaves
 * like {@link mergeAll}. However, when a new inner Observable is emitted,
 * `switch` unsubscribes from the earlier-emitted inner Observable and
 * subscribes to the new inner Observable and begins emitting items from it. It
 * continues to behave like this for subsequent inner Observables.
 *
 * @example <caption>Rerun an interval Observable on every click event</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * // Each click event is mapped to an Observable that ticks every second
 * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));
 * var switched = higherOrder.switch();
 * // The outcome is that `switched` is essentially a timer that restarts
 * // on every click. The interval Observables from older clicks do not merge
 * // with the current interval Observable.
 * switched.subscribe(x => console.log(x));
 *
 * @see {@link combineAll}
 * @see {@link concatAll}
 * @see {@link exhaust}
 * @see {@link mergeAll}
 * @see {@link switchMap}
 * @see {@link switchMapTo}
 * @see {@link zipAll}
 *
 * @return {Observable<T>} An Observable that emits the items emitted by the
 * Observable most recently emitted by the source Observable.
 * @method switch
 * @name switch
 * @owner Observable
 */
function _switch() {
    return this.lift(new SwitchOperator());
}
exports._switch = _switch;
var SwitchOperator = (function () {
    function SwitchOperator() {
    }
    SwitchOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SwitchSubscriber(subscriber));
    };
    return SwitchOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SwitchSubscriber = (function (_super) {
    __extends(SwitchSubscriber, _super);
    function SwitchSubscriber(destination) {
        _super.call(this, destination);
        this.active = 0;
        this.hasCompleted = false;
    }
    SwitchSubscriber.prototype._next = function (value) {
        this.unsubscribeInner();
        this.active++;
        this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, value));
    };
    SwitchSubscriber.prototype._complete = function () {
        this.hasCompleted = true;
        if (this.active === 0) {
            this.destination.complete();
        }
    };
    SwitchSubscriber.prototype.unsubscribeInner = function () {
        this.active = this.active > 0 ? this.active - 1 : 0;
        var innerSubscription = this.innerSubscription;
        if (innerSubscription) {
            innerSubscription.unsubscribe();
            this.remove(innerSubscription);
        }
    };
    SwitchSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.destination.next(innerValue);
    };
    SwitchSubscriber.prototype.notifyError = function (err) {
        this.destination.error(err);
    };
    SwitchSubscriber.prototype.notifyComplete = function () {
        this.unsubscribeInner();
        if (this.hasCompleted && this.active === 0) {
            this.destination.complete();
        }
    };
    return SwitchSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=switch.js.map

/***/ }),
/* 1003 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Projects each source value to an Observable which is merged in the output
 * Observable, emitting values only from the most recently projected Observable.
 *
 * <span class="informal">Maps each value to an Observable, then flattens all of
 * these inner Observables using {@link switch}.</span>
 *
 * <img src="./img/switchMap.png" width="100%">
 *
 * Returns an Observable that emits items based on applying a function that you
 * supply to each item emitted by the source Observable, where that function
 * returns an (so-called "inner") Observable. Each time it observes one of these
 * inner Observables, the output Observable begins emitting the items emitted by
 * that inner Observable. When a new inner Observable is emitted, `switchMap`
 * stops emitting items from the earlier-emitted inner Observable and begins
 * emitting items from the new one. It continues to behave like this for
 * subsequent inner Observables.
 *
 * @example <caption>Rerun an interval Observable on every click event</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.switchMap((ev) => Rx.Observable.interval(1000));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link concatMap}
 * @see {@link exhaustMap}
 * @see {@link mergeMap}
 * @see {@link switch}
 * @see {@link switchMapTo}
 *
 * @param {function(value: T, ?index: number): ObservableInput} project A function
 * that, when applied to an item emitted by the source Observable, returns an
 * Observable.
 * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
 * A function to produce the value on the output Observable based on the values
 * and the indices of the source (outer) emission and the inner Observable
 * emission. The arguments passed to this function are:
 * - `outerValue`: the value that came from the source
 * - `innerValue`: the value that came from the projected Observable
 * - `outerIndex`: the "index" of the value that came from the source
 * - `innerIndex`: the "index" of the value from the projected Observable
 * @return {Observable} An Observable that emits the result of applying the
 * projection function (and the optional `resultSelector`) to each item emitted
 * by the source Observable and taking only the values from the most recently
 * projected inner Observable.
 * @method switchMap
 * @owner Observable
 */
function switchMap(project, resultSelector) {
    return this.lift(new SwitchMapOperator(project, resultSelector));
}
exports.switchMap = switchMap;
var SwitchMapOperator = (function () {
    function SwitchMapOperator(project, resultSelector) {
        this.project = project;
        this.resultSelector = resultSelector;
    }
    SwitchMapOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SwitchMapSubscriber(subscriber, this.project, this.resultSelector));
    };
    return SwitchMapOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SwitchMapSubscriber = (function (_super) {
    __extends(SwitchMapSubscriber, _super);
    function SwitchMapSubscriber(destination, project, resultSelector) {
        _super.call(this, destination);
        this.project = project;
        this.resultSelector = resultSelector;
        this.index = 0;
    }
    SwitchMapSubscriber.prototype._next = function (value) {
        var result;
        var index = this.index++;
        try {
            result = this.project(value, index);
        }
        catch (error) {
            this.destination.error(error);
            return;
        }
        this._innerSub(result, value, index);
    };
    SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {
        var innerSubscription = this.innerSubscription;
        if (innerSubscription) {
            innerSubscription.unsubscribe();
        }
        this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, result, value, index));
    };
    SwitchMapSubscriber.prototype._complete = function () {
        var innerSubscription = this.innerSubscription;
        if (!innerSubscription || innerSubscription.closed) {
            _super.prototype._complete.call(this);
        }
    };
    SwitchMapSubscriber.prototype._unsubscribe = function () {
        this.innerSubscription = null;
    };
    SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {
        this.remove(innerSub);
        this.innerSubscription = null;
        if (this.isStopped) {
            _super.prototype._complete.call(this);
        }
    };
    SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        if (this.resultSelector) {
            this._tryNotifyNext(outerValue, innerValue, outerIndex, innerIndex);
        }
        else {
            this.destination.next(innerValue);
        }
    };
    SwitchMapSubscriber.prototype._tryNotifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
        var result;
        try {
            result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);
        }
        catch (err) {
            this.destination.error(err);
            return;
        }
        this.destination.next(result);
    };
    return SwitchMapSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=switchMap.js.map

/***/ }),
/* 1004 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Projects each source value to the same Observable which is flattened multiple
 * times with {@link switch} in the output Observable.
 *
 * <span class="informal">It's like {@link switchMap}, but maps each value
 * always to the same inner Observable.</span>
 *
 * <img src="./img/switchMapTo.png" width="100%">
 *
 * Maps each source value to the given Observable `innerObservable` regardless
 * of the source value, and then flattens those resulting Observables into one
 * single Observable, which is the output Observable. The output Observables
 * emits values only from the most recently emitted instance of
 * `innerObservable`.
 *
 * @example <caption>Rerun an interval Observable on every click event</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.switchMapTo(Rx.Observable.interval(1000));
 * result.subscribe(x => console.log(x));
 *
 * @see {@link concatMapTo}
 * @see {@link switch}
 * @see {@link switchMap}
 * @see {@link mergeMapTo}
 *
 * @param {ObservableInput} innerObservable An Observable to replace each value from
 * the source Observable.
 * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
 * A function to produce the value on the output Observable based on the values
 * and the indices of the source (outer) emission and the inner Observable
 * emission. The arguments passed to this function are:
 * - `outerValue`: the value that came from the source
 * - `innerValue`: the value that came from the projected Observable
 * - `outerIndex`: the "index" of the value that came from the source
 * - `innerIndex`: the "index" of the value from the projected Observable
 * @return {Observable} An Observable that emits items from the given
 * `innerObservable` (and optionally transformed through `resultSelector`) every
 * time a value is emitted on the source Observable, and taking only the values
 * from the most recently projected inner Observable.
 * @method switchMapTo
 * @owner Observable
 */
function switchMapTo(innerObservable, resultSelector) {
    return this.lift(new SwitchMapToOperator(innerObservable, resultSelector));
}
exports.switchMapTo = switchMapTo;
var SwitchMapToOperator = (function () {
    function SwitchMapToOperator(observable, resultSelector) {
        this.observable = observable;
        this.resultSelector = resultSelector;
    }
    SwitchMapToOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector));
    };
    return SwitchMapToOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var SwitchMapToSubscriber = (function (_super) {
    __extends(SwitchMapToSubscriber, _super);
    function SwitchMapToSubscriber(destination, inner, resultSelector) {
        _super.call(this, destination);
        this.inner = inner;
        this.resultSelector = resultSelector;
        this.index = 0;
    }
    SwitchMapToSubscriber.prototype._next = function (value) {
        var innerSubscription = this.innerSubscription;
        if (innerSubscription) {
            innerSubscription.unsubscribe();
        }
        this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, this.inner, value, this.index++));
    };
    SwitchMapToSubscriber.prototype._complete = function () {
        var innerSubscription = this.innerSubscription;
        if (!innerSubscription || innerSubscription.closed) {
            _super.prototype._complete.call(this);
        }
    };
    SwitchMapToSubscriber.prototype._unsubscribe = function () {
        this.innerSubscription = null;
    };
    SwitchMapToSubscriber.prototype.notifyComplete = function (innerSub) {
        this.remove(innerSub);
        this.innerSubscription = null;
        if (this.isStopped) {
            _super.prototype._complete.call(this);
        }
    };
    SwitchMapToSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        var _a = this, resultSelector = _a.resultSelector, destination = _a.destination;
        if (resultSelector) {
            this.tryResultSelector(outerValue, innerValue, outerIndex, innerIndex);
        }
        else {
            destination.next(innerValue);
        }
    };
    SwitchMapToSubscriber.prototype.tryResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) {
        var _a = this, resultSelector = _a.resultSelector, destination = _a.destination;
        var result;
        try {
            result = resultSelector(outerValue, innerValue, outerIndex, innerIndex);
        }
        catch (err) {
            destination.error(err);
            return;
        }
        destination.next(result);
    };
    return SwitchMapToSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=switchMapTo.js.map

/***/ }),
/* 1005 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var ArgumentOutOfRangeError_1 = __webpack_require__(110);
var EmptyObservable_1 = __webpack_require__(111);
/**
 * Emits only the first `count` values emitted by the source Observable.
 *
 * <span class="informal">Takes the first `count` values from the source, then
 * completes.</span>
 *
 * <img src="./img/take.png" width="100%">
 *
 * `take` returns an Observable that emits only the first `count` values emitted
 * by the source Observable. If the source emits fewer than `count` values then
 * all of its values are emitted. After that, it completes, regardless if the
 * source completes.
 *
 * @example <caption>Take the first 5 seconds of an infinite 1-second interval Observable</caption>
 * var interval = Rx.Observable.interval(1000);
 * var five = interval.take(5);
 * five.subscribe(x => console.log(x));
 *
 * @see {@link takeLast}
 * @see {@link takeUntil}
 * @see {@link takeWhile}
 * @see {@link skip}
 *
 * @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an
 * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
 *
 * @param {number} count The maximum number of `next` values to emit.
 * @return {Observable<T>} An Observable that emits only the first `count`
 * values emitted by the source Observable, or all of the values from the source
 * if the source emits fewer than `count` values.
 * @method take
 * @owner Observable
 */
function take(count) {
    if (count === 0) {
        return new EmptyObservable_1.EmptyObservable();
    }
    else {
        return this.lift(new TakeOperator(count));
    }
}
exports.take = take;
var TakeOperator = (function () {
    function TakeOperator(total) {
        this.total = total;
        if (this.total < 0) {
            throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
        }
    }
    TakeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new TakeSubscriber(subscriber, this.total));
    };
    return TakeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TakeSubscriber = (function (_super) {
    __extends(TakeSubscriber, _super);
    function TakeSubscriber(destination, total) {
        _super.call(this, destination);
        this.total = total;
        this.count = 0;
    }
    TakeSubscriber.prototype._next = function (value) {
        var total = this.total;
        var count = ++this.count;
        if (count <= total) {
            this.destination.next(value);
            if (count === total) {
                this.destination.complete();
                this.unsubscribe();
            }
        }
    };
    return TakeSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=take.js.map

/***/ }),
/* 1006 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var ArgumentOutOfRangeError_1 = __webpack_require__(110);
var EmptyObservable_1 = __webpack_require__(111);
/**
 * Emits only the last `count` values emitted by the source Observable.
 *
 * <span class="informal">Remembers the latest `count` values, then emits those
 * only when the source completes.</span>
 *
 * <img src="./img/takeLast.png" width="100%">
 *
 * `takeLast` returns an Observable that emits at most the last `count` values
 * emitted by the source Observable. If the source emits fewer than `count`
 * values then all of its values are emitted. This operator must wait until the
 * `complete` notification emission from the source in order to emit the `next`
 * values on the output Observable, because otherwise it is impossible to know
 * whether or not more values will be emitted on the source. For this reason,
 * all values are emitted synchronously, followed by the complete notification.
 *
 * @example <caption>Take the last 3 values of an Observable with many values</caption>
 * var many = Rx.Observable.range(1, 100);
 * var lastThree = many.takeLast(3);
 * lastThree.subscribe(x => console.log(x));
 *
 * @see {@link take}
 * @see {@link takeUntil}
 * @see {@link takeWhile}
 * @see {@link skip}
 *
 * @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an
 * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
 *
 * @param {number} count The maximum number of values to emit from the end of
 * the sequence of values emitted by the source Observable.
 * @return {Observable<T>} An Observable that emits at most the last count
 * values emitted by the source Observable.
 * @method takeLast
 * @owner Observable
 */
function takeLast(count) {
    if (count === 0) {
        return new EmptyObservable_1.EmptyObservable();
    }
    else {
        return this.lift(new TakeLastOperator(count));
    }
}
exports.takeLast = takeLast;
var TakeLastOperator = (function () {
    function TakeLastOperator(total) {
        this.total = total;
        if (this.total < 0) {
            throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
        }
    }
    TakeLastOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
    };
    return TakeLastOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TakeLastSubscriber = (function (_super) {
    __extends(TakeLastSubscriber, _super);
    function TakeLastSubscriber(destination, total) {
        _super.call(this, destination);
        this.total = total;
        this.ring = new Array();
        this.count = 0;
    }
    TakeLastSubscriber.prototype._next = function (value) {
        var ring = this.ring;
        var total = this.total;
        var count = this.count++;
        if (ring.length < total) {
            ring.push(value);
        }
        else {
            var index = count % total;
            ring[index] = value;
        }
    };
    TakeLastSubscriber.prototype._complete = function () {
        var destination = this.destination;
        var count = this.count;
        if (count > 0) {
            var total = this.count >= this.total ? this.total : this.count;
            var ring = this.ring;
            for (var i = 0; i < total; i++) {
                var idx = (count++) % total;
                destination.next(ring[idx]);
            }
        }
        destination.complete();
    };
    return TakeLastSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=takeLast.js.map

/***/ }),
/* 1007 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Emits the values emitted by the source Observable until a `notifier`
 * Observable emits a value.
 *
 * <span class="informal">Lets values pass until a second Observable,
 * `notifier`, emits something. Then, it completes.</span>
 *
 * <img src="./img/takeUntil.png" width="100%">
 *
 * `takeUntil` subscribes and begins mirroring the source Observable. It also
 * monitors a second Observable, `notifier` that you provide. If the `notifier`
 * emits a value or a complete notification, the output Observable stops
 * mirroring the source Observable and completes.
 *
 * @example <caption>Tick every second until the first click happens</caption>
 * var interval = Rx.Observable.interval(1000);
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = interval.takeUntil(clicks);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link take}
 * @see {@link takeLast}
 * @see {@link takeWhile}
 * @see {@link skip}
 *
 * @param {Observable} notifier The Observable whose first emitted value will
 * cause the output Observable of `takeUntil` to stop emitting values from the
 * source Observable.
 * @return {Observable<T>} An Observable that emits the values from the source
 * Observable until such time as `notifier` emits its first value.
 * @method takeUntil
 * @owner Observable
 */
function takeUntil(notifier) {
    return this.lift(new TakeUntilOperator(notifier));
}
exports.takeUntil = takeUntil;
var TakeUntilOperator = (function () {
    function TakeUntilOperator(notifier) {
        this.notifier = notifier;
    }
    TakeUntilOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new TakeUntilSubscriber(subscriber, this.notifier));
    };
    return TakeUntilOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TakeUntilSubscriber = (function (_super) {
    __extends(TakeUntilSubscriber, _super);
    function TakeUntilSubscriber(destination, notifier) {
        _super.call(this, destination);
        this.notifier = notifier;
        this.add(subscribeToResult_1.subscribeToResult(this, notifier));
    }
    TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.complete();
    };
    TakeUntilSubscriber.prototype.notifyComplete = function () {
        // noop
    };
    return TakeUntilSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=takeUntil.js.map

/***/ }),
/* 1008 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * Emits values emitted by the source Observable so long as each value satisfies
 * the given `predicate`, and then completes as soon as this `predicate` is not
 * satisfied.
 *
 * <span class="informal">Takes values from the source only while they pass the
 * condition given. When the first value does not satisfy, it completes.</span>
 *
 * <img src="./img/takeWhile.png" width="100%">
 *
 * `takeWhile` subscribes and begins mirroring the source Observable. Each value
 * emitted on the source is given to the `predicate` function which returns a
 * boolean, representing a condition to be satisfied by the source values. The
 * output Observable emits the source values until such time as the `predicate`
 * returns false, at which point `takeWhile` stops mirroring the source
 * Observable and completes the output Observable.
 *
 * @example <caption>Emit click events only while the clientX property is greater than 200</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.takeWhile(ev => ev.clientX > 200);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link take}
 * @see {@link takeLast}
 * @see {@link takeUntil}
 * @see {@link skip}
 *
 * @param {function(value: T, index: number): boolean} predicate A function that
 * evaluates a value emitted by the source Observable and returns a boolean.
 * Also takes the (zero-based) index as the second argument.
 * @return {Observable<T>} An Observable that emits the values from the source
 * Observable so long as each value satisfies the condition defined by the
 * `predicate`, then completes.
 * @method takeWhile
 * @owner Observable
 */
function takeWhile(predicate) {
    return this.lift(new TakeWhileOperator(predicate));
}
exports.takeWhile = takeWhile;
var TakeWhileOperator = (function () {
    function TakeWhileOperator(predicate) {
        this.predicate = predicate;
    }
    TakeWhileOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate));
    };
    return TakeWhileOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TakeWhileSubscriber = (function (_super) {
    __extends(TakeWhileSubscriber, _super);
    function TakeWhileSubscriber(destination, predicate) {
        _super.call(this, destination);
        this.predicate = predicate;
        this.index = 0;
    }
    TakeWhileSubscriber.prototype._next = function (value) {
        var destination = this.destination;
        var result;
        try {
            result = this.predicate(value, this.index++);
        }
        catch (err) {
            destination.error(err);
            return;
        }
        this.nextOrComplete(value, result);
    };
    TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {
        var destination = this.destination;
        if (Boolean(predicateResult)) {
            destination.next(value);
        }
        else {
            destination.complete();
        }
    };
    return TakeWhileSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=takeWhile.js.map

/***/ }),
/* 1009 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var async_1 = __webpack_require__(23);
var throttle_1 = __webpack_require__(508);
/**
 * Emits a value from the source Observable, then ignores subsequent source
 * values for `duration` milliseconds, then repeats this process.
 *
 * <span class="informal">Lets a value pass, then ignores source values for the
 * next `duration` milliseconds.</span>
 *
 * <img src="./img/throttleTime.png" width="100%">
 *
 * `throttleTime` emits the source Observable values on the output Observable
 * when its internal timer is disabled, and ignores source values when the timer
 * is enabled. Initially, the timer is disabled. As soon as the first source
 * value arrives, it is forwarded to the output Observable, and then the timer
 * is enabled. After `duration` milliseconds (or the time unit determined
 * internally by the optional `scheduler`) has passed, the timer is disabled,
 * and this process repeats for the next source value. Optionally takes a
 * {@link IScheduler} for managing timers.
 *
 * @example <caption>Emit clicks at a rate of at most one click per second</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.throttleTime(1000);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link auditTime}
 * @see {@link debounceTime}
 * @see {@link delay}
 * @see {@link sampleTime}
 * @see {@link throttle}
 *
 * @param {number} duration Time to wait before emitting another value after
 * emitting the last value, measured in milliseconds or the time unit determined
 * internally by the optional `scheduler`.
 * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
 * managing the timers that handle the throttling.
 * @return {Observable<T>} An Observable that performs the throttle operation to
 * limit the rate of emissions from the source.
 * @method throttleTime
 * @owner Observable
 */
function throttleTime(duration, scheduler, config) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    if (config === void 0) { config = throttle_1.defaultThrottleConfig; }
    return this.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));
}
exports.throttleTime = throttleTime;
var ThrottleTimeOperator = (function () {
    function ThrottleTimeOperator(duration, scheduler, leading, trailing) {
        this.duration = duration;
        this.scheduler = scheduler;
        this.leading = leading;
        this.trailing = trailing;
    }
    ThrottleTimeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
    };
    return ThrottleTimeOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ThrottleTimeSubscriber = (function (_super) {
    __extends(ThrottleTimeSubscriber, _super);
    function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {
        _super.call(this, destination);
        this.duration = duration;
        this.scheduler = scheduler;
        this.leading = leading;
        this.trailing = trailing;
        this._hasTrailingValue = false;
        this._trailingValue = null;
    }
    ThrottleTimeSubscriber.prototype._next = function (value) {
        if (this.throttled) {
            if (this.trailing) {
                this._trailingValue = value;
                this._hasTrailingValue = true;
            }
        }
        else {
            this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
            if (this.leading) {
                this.destination.next(value);
            }
        }
    };
    ThrottleTimeSubscriber.prototype.clearThrottle = function () {
        var throttled = this.throttled;
        if (throttled) {
            if (this.trailing && this._hasTrailingValue) {
                this.destination.next(this._trailingValue);
                this._trailingValue = null;
                this._hasTrailingValue = false;
            }
            throttled.unsubscribe();
            this.remove(throttled);
            this.throttled = null;
        }
    };
    return ThrottleTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchNext(arg) {
    var subscriber = arg.subscriber;
    subscriber.clearThrottle();
}
//# sourceMappingURL=throttleTime.js.map

/***/ }),
/* 1010 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 async_1 = __webpack_require__(23);
var isDate_1 = __webpack_require__(148);
var Subscriber_1 = __webpack_require__(6);
var TimeoutError_1 = __webpack_require__(517);
/**
 * @param {number} due
 * @param {Scheduler} [scheduler]
 * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}
 * @method timeout
 * @owner Observable
 */
function timeout(due, scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    var absoluteTimeout = isDate_1.isDate(due);
    var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
    return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, scheduler, new TimeoutError_1.TimeoutError()));
}
exports.timeout = timeout;
var TimeoutOperator = (function () {
    function TimeoutOperator(waitFor, absoluteTimeout, scheduler, errorInstance) {
        this.waitFor = waitFor;
        this.absoluteTimeout = absoluteTimeout;
        this.scheduler = scheduler;
        this.errorInstance = errorInstance;
    }
    TimeoutOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.scheduler, this.errorInstance));
    };
    return TimeoutOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TimeoutSubscriber = (function (_super) {
    __extends(TimeoutSubscriber, _super);
    function TimeoutSubscriber(destination, absoluteTimeout, waitFor, scheduler, errorInstance) {
        _super.call(this, destination);
        this.absoluteTimeout = absoluteTimeout;
        this.waitFor = waitFor;
        this.scheduler = scheduler;
        this.errorInstance = errorInstance;
        this.action = null;
        this.scheduleTimeout();
    }
    TimeoutSubscriber.dispatchTimeout = function (subscriber) {
        subscriber.error(subscriber.errorInstance);
    };
    TimeoutSubscriber.prototype.scheduleTimeout = function () {
        var action = this.action;
        if (action) {
            // Recycle the action if we've already scheduled one. All the production
            // Scheduler Actions mutate their state/delay time and return themeselves.
            // VirtualActions are immutable, so they create and return a clone. In this
            // case, we need to set the action reference to the most recent VirtualAction,
            // to ensure that's the one we clone from next time.
            this.action = action.schedule(this, this.waitFor);
        }
        else {
            this.add(this.action = this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, this));
        }
    };
    TimeoutSubscriber.prototype._next = function (value) {
        if (!this.absoluteTimeout) {
            this.scheduleTimeout();
        }
        _super.prototype._next.call(this, value);
    };
    TimeoutSubscriber.prototype._unsubscribe = function () {
        this.action = null;
        this.scheduler = null;
        this.errorInstance = null;
    };
    return TimeoutSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=timeout.js.map

/***/ }),
/* 1011 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 async_1 = __webpack_require__(23);
var isDate_1 = __webpack_require__(148);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * @param due
 * @param withObservable
 * @param scheduler
 * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}
 * @method timeoutWith
 * @owner Observable
 */
function timeoutWith(due, withObservable, scheduler) {
    if (scheduler === void 0) { scheduler = async_1.async; }
    var absoluteTimeout = isDate_1.isDate(due);
    var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
    return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
}
exports.timeoutWith = timeoutWith;
var TimeoutWithOperator = (function () {
    function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {
        this.waitFor = waitFor;
        this.absoluteTimeout = absoluteTimeout;
        this.withObservable = withObservable;
        this.scheduler = scheduler;
    }
    TimeoutWithOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
    };
    return TimeoutWithOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var TimeoutWithSubscriber = (function (_super) {
    __extends(TimeoutWithSubscriber, _super);
    function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
        _super.call(this, destination);
        this.absoluteTimeout = absoluteTimeout;
        this.waitFor = waitFor;
        this.withObservable = withObservable;
        this.scheduler = scheduler;
        this.action = null;
        this.scheduleTimeout();
    }
    TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {
        var withObservable = subscriber.withObservable;
        subscriber._unsubscribeAndRecycle();
        subscriber.add(subscribeToResult_1.subscribeToResult(subscriber, withObservable));
    };
    TimeoutWithSubscriber.prototype.scheduleTimeout = function () {
        var action = this.action;
        if (action) {
            // Recycle the action if we've already scheduled one. All the production
            // Scheduler Actions mutate their state/delay time and return themeselves.
            // VirtualActions are immutable, so they create and return a clone. In this
            // case, we need to set the action reference to the most recent VirtualAction,
            // to ensure that's the one we clone from next time.
            this.action = action.schedule(this, this.waitFor);
        }
        else {
            this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
        }
    };
    TimeoutWithSubscriber.prototype._next = function (value) {
        if (!this.absoluteTimeout) {
            this.scheduleTimeout();
        }
        _super.prototype._next.call(this, value);
    };
    TimeoutWithSubscriber.prototype._unsubscribe = function () {
        this.action = null;
        this.scheduler = null;
        this.withObservable = null;
    };
    return TimeoutWithSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=timeoutWith.js.map

/***/ }),
/* 1012 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
/**
 * @return {Observable<any[]>|WebSocketSubject<T>|Observable<T>}
 * @method toArray
 * @owner Observable
 */
function toArray() {
    return this.lift(new ToArrayOperator());
}
exports.toArray = toArray;
var ToArrayOperator = (function () {
    function ToArrayOperator() {
    }
    ToArrayOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new ToArraySubscriber(subscriber));
    };
    return ToArrayOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ToArraySubscriber = (function (_super) {
    __extends(ToArraySubscriber, _super);
    function ToArraySubscriber(destination) {
        _super.call(this, destination);
        this.array = [];
    }
    ToArraySubscriber.prototype._next = function (x) {
        this.array.push(x);
    };
    ToArraySubscriber.prototype._complete = function () {
        this.destination.next(this.array);
        this.destination.complete();
    };
    return ToArraySubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=toArray.js.map

/***/ }),
/* 1013 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var root_1 = __webpack_require__(42);
/* tslint:enable:max-line-length */
/**
 * Converts an Observable sequence to a ES2015 compliant promise.
 *
 * @example
 * // Using normal ES2015
 * let source = Rx.Observable
 *   .of(42)
 *   .toPromise();
 *
 * source.then((value) => console.log('Value: %s', value));
 * // => Value: 42
 *
 * // Rejected Promise
 * // Using normal ES2015
 * let source = Rx.Observable
 *   .throw(new Error('woops'))
 *   .toPromise();
 *
 * source
 *   .then((value) => console.log('Value: %s', value))
 *   .catch((err) => console.log('Error: %s', err));
 * // => Error: Error: woops
 *
 * // Setting via the config
 * Rx.config.Promise = RSVP.Promise;
 *
 * let source = Rx.Observable
 *   .of(42)
 *   .toPromise();
 *
 * source.then((value) => console.log('Value: %s', value));
 * // => Value: 42
 *
 * // Setting via the method
 * let source = Rx.Observable
 *   .of(42)
 *   .toPromise(RSVP.Promise);
 *
 * source.then((value) => console.log('Value: %s', value));
 * // => Value: 42
 *
 * @param {PromiseConstructor} [PromiseCtor] The constructor of the promise. If not provided,
 * it will look for a constructor first in Rx.config.Promise then fall back to
 * the native Promise constructor if available.
 * @return {Promise<T>} An ES2015 compatible promise with the last value from
 * the observable sequence.
 * @method toPromise
 * @owner Observable
 */
function toPromise(PromiseCtor) {
    var _this = this;
    if (!PromiseCtor) {
        if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {
            PromiseCtor = root_1.root.Rx.config.Promise;
        }
        else if (root_1.root.Promise) {
            PromiseCtor = root_1.root.Promise;
        }
    }
    if (!PromiseCtor) {
        throw new Error('no Promise impl found');
    }
    return new PromiseCtor(function (resolve, reject) {
        var value;
        _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
    });
}
exports.toPromise = toPromise;
//# sourceMappingURL=toPromise.js.map

/***/ }),
/* 1014 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Branch out the source Observable values as a nested Observable whenever
 * `windowBoundaries` emits.
 *
 * <span class="informal">It's like {@link buffer}, but emits a nested Observable
 * instead of an array.</span>
 *
 * <img src="./img/window.png" width="100%">
 *
 * Returns an Observable that emits windows of items it collects from the source
 * Observable. The output Observable emits connected, non-overlapping
 * windows. It emits the current window and opens a new one whenever the
 * Observable `windowBoundaries` emits an item. Because each window is an
 * Observable, the output is a higher-order Observable.
 *
 * @example <caption>In every window of 1 second each, emit at most 2 click events</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var interval = Rx.Observable.interval(1000);
 * var result = clicks.window(interval)
 *   .map(win => win.take(2)) // each window has at most 2 emissions
 *   .mergeAll(); // flatten the Observable-of-Observables
 * result.subscribe(x => console.log(x));
 *
 * @see {@link windowCount}
 * @see {@link windowTime}
 * @see {@link windowToggle}
 * @see {@link windowWhen}
 * @see {@link buffer}
 *
 * @param {Observable<any>} windowBoundaries An Observable that completes the
 * previous window and starts a new window.
 * @return {Observable<Observable<T>>} An Observable of windows, which are
 * Observables emitting values of the source Observable.
 * @method window
 * @owner Observable
 */
function window(windowBoundaries) {
    return this.lift(new WindowOperator(windowBoundaries));
}
exports.window = window;
var WindowOperator = (function () {
    function WindowOperator(windowBoundaries) {
        this.windowBoundaries = windowBoundaries;
    }
    WindowOperator.prototype.call = function (subscriber, source) {
        var windowSubscriber = new WindowSubscriber(subscriber);
        var sourceSubscription = source.subscribe(windowSubscriber);
        if (!sourceSubscription.closed) {
            windowSubscriber.add(subscribeToResult_1.subscribeToResult(windowSubscriber, this.windowBoundaries));
        }
        return sourceSubscription;
    };
    return WindowOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var WindowSubscriber = (function (_super) {
    __extends(WindowSubscriber, _super);
    function WindowSubscriber(destination) {
        _super.call(this, destination);
        this.window = new Subject_1.Subject();
        destination.next(this.window);
    }
    WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.openWindow();
    };
    WindowSubscriber.prototype.notifyError = function (error, innerSub) {
        this._error(error);
    };
    WindowSubscriber.prototype.notifyComplete = function (innerSub) {
        this._complete();
    };
    WindowSubscriber.prototype._next = function (value) {
        this.window.next(value);
    };
    WindowSubscriber.prototype._error = function (err) {
        this.window.error(err);
        this.destination.error(err);
    };
    WindowSubscriber.prototype._complete = function () {
        this.window.complete();
        this.destination.complete();
    };
    WindowSubscriber.prototype._unsubscribe = function () {
        this.window = null;
    };
    WindowSubscriber.prototype.openWindow = function () {
        var prevWindow = this.window;
        if (prevWindow) {
            prevWindow.complete();
        }
        var destination = this.destination;
        var newWindow = this.window = new Subject_1.Subject();
        destination.next(newWindow);
    };
    return WindowSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=window.js.map

/***/ }),
/* 1015 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscriber_1 = __webpack_require__(6);
var Subject_1 = __webpack_require__(11);
/**
 * Branch out the source Observable values as a nested Observable with each
 * nested Observable emitting at most `windowSize` values.
 *
 * <span class="informal">It's like {@link bufferCount}, but emits a nested
 * Observable instead of an array.</span>
 *
 * <img src="./img/windowCount.png" width="100%">
 *
 * Returns an Observable that emits windows of items it collects from the source
 * Observable. The output Observable emits windows every `startWindowEvery`
 * items, each containing no more than `windowSize` items. When the source
 * Observable completes or encounters an error, the output Observable emits
 * the current window and propagates the notification from the source
 * Observable. If `startWindowEvery` is not provided, then new windows are
 * started immediately at the start of the source and when each window completes
 * with size `windowSize`.
 *
 * @example <caption>Ignore every 3rd click event, starting from the first one</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.windowCount(3)
 *   .map(win => win.skip(1)) // skip first of every 3 clicks
 *   .mergeAll(); // flatten the Observable-of-Observables
 * result.subscribe(x => console.log(x));
 *
 * @example <caption>Ignore every 3rd click event, starting from the third one</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks.windowCount(2, 3)
 *   .mergeAll(); // flatten the Observable-of-Observables
 * result.subscribe(x => console.log(x));
 *
 * @see {@link window}
 * @see {@link windowTime}
 * @see {@link windowToggle}
 * @see {@link windowWhen}
 * @see {@link bufferCount}
 *
 * @param {number} windowSize The maximum number of values emitted by each
 * window.
 * @param {number} [startWindowEvery] Interval at which to start a new window.
 * For example if `startWindowEvery` is `2`, then a new window will be started
 * on every other value from the source. A new window is started at the
 * beginning of the source by default.
 * @return {Observable<Observable<T>>} An Observable of windows, which in turn
 * are Observable of values.
 * @method windowCount
 * @owner Observable
 */
function windowCount(windowSize, startWindowEvery) {
    if (startWindowEvery === void 0) { startWindowEvery = 0; }
    return this.lift(new WindowCountOperator(windowSize, startWindowEvery));
}
exports.windowCount = windowCount;
var WindowCountOperator = (function () {
    function WindowCountOperator(windowSize, startWindowEvery) {
        this.windowSize = windowSize;
        this.startWindowEvery = startWindowEvery;
    }
    WindowCountOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
    };
    return WindowCountOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var WindowCountSubscriber = (function (_super) {
    __extends(WindowCountSubscriber, _super);
    function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
        _super.call(this, destination);
        this.destination = destination;
        this.windowSize = windowSize;
        this.startWindowEvery = startWindowEvery;
        this.windows = [new Subject_1.Subject()];
        this.count = 0;
        destination.next(this.windows[0]);
    }
    WindowCountSubscriber.prototype._next = function (value) {
        var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
        var destination = this.destination;
        var windowSize = this.windowSize;
        var windows = this.windows;
        var len = windows.length;
        for (var i = 0; i < len && !this.closed; i++) {
            windows[i].next(value);
        }
        var c = this.count - windowSize + 1;
        if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
            windows.shift().complete();
        }
        if (++this.count % startWindowEvery === 0 && !this.closed) {
            var window_1 = new Subject_1.Subject();
            windows.push(window_1);
            destination.next(window_1);
        }
    };
    WindowCountSubscriber.prototype._error = function (err) {
        var windows = this.windows;
        if (windows) {
            while (windows.length > 0 && !this.closed) {
                windows.shift().error(err);
            }
        }
        this.destination.error(err);
    };
    WindowCountSubscriber.prototype._complete = function () {
        var windows = this.windows;
        if (windows) {
            while (windows.length > 0 && !this.closed) {
                windows.shift().complete();
            }
        }
        this.destination.complete();
    };
    WindowCountSubscriber.prototype._unsubscribe = function () {
        this.count = 0;
        this.windows = null;
    };
    return WindowCountSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=windowCount.js.map

/***/ }),
/* 1016 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var async_1 = __webpack_require__(23);
var Subscriber_1 = __webpack_require__(6);
var isNumeric_1 = __webpack_require__(149);
var isScheduler_1 = __webpack_require__(57);
function windowTime(windowTimeSpan) {
    var scheduler = async_1.async;
    var windowCreationInterval = null;
    var maxWindowSize = Number.POSITIVE_INFINITY;
    if (isScheduler_1.isScheduler(arguments[3])) {
        scheduler = arguments[3];
    }
    if (isScheduler_1.isScheduler(arguments[2])) {
        scheduler = arguments[2];
    }
    else if (isNumeric_1.isNumeric(arguments[2])) {
        maxWindowSize = arguments[2];
    }
    if (isScheduler_1.isScheduler(arguments[1])) {
        scheduler = arguments[1];
    }
    else if (isNumeric_1.isNumeric(arguments[1])) {
        windowCreationInterval = arguments[1];
    }
    return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
}
exports.windowTime = windowTime;
var WindowTimeOperator = (function () {
    function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
        this.windowTimeSpan = windowTimeSpan;
        this.windowCreationInterval = windowCreationInterval;
        this.maxWindowSize = maxWindowSize;
        this.scheduler = scheduler;
    }
    WindowTimeOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
    };
    return WindowTimeOperator;
}());
var CountedSubject = (function (_super) {
    __extends(CountedSubject, _super);
    function CountedSubject() {
        _super.apply(this, arguments);
        this._numberOfNextedValues = 0;
    }
    CountedSubject.prototype.next = function (value) {
        this._numberOfNextedValues++;
        _super.prototype.next.call(this, value);
    };
    Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
        get: function () {
            return this._numberOfNextedValues;
        },
        enumerable: true,
        configurable: true
    });
    return CountedSubject;
}(Subject_1.Subject));
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var WindowTimeSubscriber = (function (_super) {
    __extends(WindowTimeSubscriber, _super);
    function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
        _super.call(this, destination);
        this.destination = destination;
        this.windowTimeSpan = windowTimeSpan;
        this.windowCreationInterval = windowCreationInterval;
        this.maxWindowSize = maxWindowSize;
        this.scheduler = scheduler;
        this.windows = [];
        var window = this.openWindow();
        if (windowCreationInterval !== null && windowCreationInterval >= 0) {
            var closeState = { subscriber: this, window: window, context: null };
            var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: this, scheduler: scheduler };
            this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
            this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
        }
        else {
            var timeSpanOnlyState = { subscriber: this, window: window, windowTimeSpan: windowTimeSpan };
            this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
        }
    }
    WindowTimeSubscriber.prototype._next = function (value) {
        var windows = this.windows;
        var len = windows.length;
        for (var i = 0; i < len; i++) {
            var window_1 = windows[i];
            if (!window_1.closed) {
                window_1.next(value);
                if (window_1.numberOfNextedValues >= this.maxWindowSize) {
                    this.closeWindow(window_1);
                }
            }
        }
    };
    WindowTimeSubscriber.prototype._error = function (err) {
        var windows = this.windows;
        while (windows.length > 0) {
            windows.shift().error(err);
        }
        this.destination.error(err);
    };
    WindowTimeSubscriber.prototype._complete = function () {
        var windows = this.windows;
        while (windows.length > 0) {
            var window_2 = windows.shift();
            if (!window_2.closed) {
                window_2.complete();
            }
        }
        this.destination.complete();
    };
    WindowTimeSubscriber.prototype.openWindow = function () {
        var window = new CountedSubject();
        this.windows.push(window);
        var destination = this.destination;
        destination.next(window);
        return window;
    };
    WindowTimeSubscriber.prototype.closeWindow = function (window) {
        window.complete();
        var windows = this.windows;
        windows.splice(windows.indexOf(window), 1);
    };
    return WindowTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchWindowTimeSpanOnly(state) {
    var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
    if (window) {
        subscriber.closeWindow(window);
    }
    state.window = subscriber.openWindow();
    this.schedule(state, windowTimeSpan);
}
function dispatchWindowCreation(state) {
    var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
    var window = subscriber.openWindow();
    var action = this;
    var context = { action: action, subscription: null };
    var timeSpanState = { subscriber: subscriber, window: window, context: context };
    context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
    action.add(context.subscription);
    action.schedule(state, windowCreationInterval);
}
function dispatchWindowClose(state) {
    var subscriber = state.subscriber, window = state.window, context = state.context;
    if (context && context.action && context.subscription) {
        context.action.remove(context.subscription);
    }
    subscriber.closeWindow(window);
}
//# sourceMappingURL=windowTime.js.map

/***/ }),
/* 1017 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var Subscription_1 = __webpack_require__(16);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Branch out the source Observable values as a nested Observable starting from
 * an emission from `openings` and ending when the output of `closingSelector`
 * emits.
 *
 * <span class="informal">It's like {@link bufferToggle}, but emits a nested
 * Observable instead of an array.</span>
 *
 * <img src="./img/windowToggle.png" width="100%">
 *
 * Returns an Observable that emits windows of items it collects from the source
 * Observable. The output Observable emits windows that contain those items
 * emitted by the source Observable between the time when the `openings`
 * Observable emits an item and when the Observable returned by
 * `closingSelector` emits an item.
 *
 * @example <caption>Every other second, emit the click events from the next 500ms</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var openings = Rx.Observable.interval(1000);
 * var result = clicks.windowToggle(openings, i =>
 *   i % 2 ? Rx.Observable.interval(500) : Rx.Observable.empty()
 * ).mergeAll();
 * result.subscribe(x => console.log(x));
 *
 * @see {@link window}
 * @see {@link windowCount}
 * @see {@link windowTime}
 * @see {@link windowWhen}
 * @see {@link bufferToggle}
 *
 * @param {Observable<O>} openings An observable of notifications to start new
 * windows.
 * @param {function(value: O): Observable} closingSelector A function that takes
 * the value emitted by the `openings` observable and returns an Observable,
 * which, when it emits (either `next` or `complete`), signals that the
 * associated window should complete.
 * @return {Observable<Observable<T>>} An observable of windows, which in turn
 * are Observables.
 * @method windowToggle
 * @owner Observable
 */
function windowToggle(openings, closingSelector) {
    return this.lift(new WindowToggleOperator(openings, closingSelector));
}
exports.windowToggle = windowToggle;
var WindowToggleOperator = (function () {
    function WindowToggleOperator(openings, closingSelector) {
        this.openings = openings;
        this.closingSelector = closingSelector;
    }
    WindowToggleOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
    };
    return WindowToggleOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var WindowToggleSubscriber = (function (_super) {
    __extends(WindowToggleSubscriber, _super);
    function WindowToggleSubscriber(destination, openings, closingSelector) {
        _super.call(this, destination);
        this.openings = openings;
        this.closingSelector = closingSelector;
        this.contexts = [];
        this.add(this.openSubscription = subscribeToResult_1.subscribeToResult(this, openings, openings));
    }
    WindowToggleSubscriber.prototype._next = function (value) {
        var contexts = this.contexts;
        if (contexts) {
            var len = contexts.length;
            for (var i = 0; i < len; i++) {
                contexts[i].window.next(value);
            }
        }
    };
    WindowToggleSubscriber.prototype._error = function (err) {
        var contexts = this.contexts;
        this.contexts = null;
        if (contexts) {
            var len = contexts.length;
            var index = -1;
            while (++index < len) {
                var context = contexts[index];
                context.window.error(err);
                context.subscription.unsubscribe();
            }
        }
        _super.prototype._error.call(this, err);
    };
    WindowToggleSubscriber.prototype._complete = function () {
        var contexts = this.contexts;
        this.contexts = null;
        if (contexts) {
            var len = contexts.length;
            var index = -1;
            while (++index < len) {
                var context = contexts[index];
                context.window.complete();
                context.subscription.unsubscribe();
            }
        }
        _super.prototype._complete.call(this);
    };
    WindowToggleSubscriber.prototype._unsubscribe = function () {
        var contexts = this.contexts;
        this.contexts = null;
        if (contexts) {
            var len = contexts.length;
            var index = -1;
            while (++index < len) {
                var context = contexts[index];
                context.window.unsubscribe();
                context.subscription.unsubscribe();
            }
        }
    };
    WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        if (outerValue === this.openings) {
            var closingSelector = this.closingSelector;
            var closingNotifier = tryCatch_1.tryCatch(closingSelector)(innerValue);
            if (closingNotifier === errorObject_1.errorObject) {
                return this.error(errorObject_1.errorObject.e);
            }
            else {
                var window_1 = new Subject_1.Subject();
                var subscription = new Subscription_1.Subscription();
                var context = { window: window_1, subscription: subscription };
                this.contexts.push(context);
                var innerSubscription = subscribeToResult_1.subscribeToResult(this, closingNotifier, context);
                if (innerSubscription.closed) {
                    this.closeWindow(this.contexts.length - 1);
                }
                else {
                    innerSubscription.context = context;
                    subscription.add(innerSubscription);
                }
                this.destination.next(window_1);
            }
        }
        else {
            this.closeWindow(this.contexts.indexOf(outerValue));
        }
    };
    WindowToggleSubscriber.prototype.notifyError = function (err) {
        this.error(err);
    };
    WindowToggleSubscriber.prototype.notifyComplete = function (inner) {
        if (inner !== this.openSubscription) {
            this.closeWindow(this.contexts.indexOf(inner.context));
        }
    };
    WindowToggleSubscriber.prototype.closeWindow = function (index) {
        if (index === -1) {
            return;
        }
        var contexts = this.contexts;
        var context = contexts[index];
        var window = context.window, subscription = context.subscription;
        contexts.splice(index, 1);
        window.complete();
        subscription.unsubscribe();
    };
    return WindowToggleSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=windowToggle.js.map

/***/ }),
/* 1018 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var tryCatch_1 = __webpack_require__(21);
var errorObject_1 = __webpack_require__(20);
var OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/**
 * Branch out the source Observable values as a nested Observable using a
 * factory function of closing Observables to determine when to start a new
 * window.
 *
 * <span class="informal">It's like {@link bufferWhen}, but emits a nested
 * Observable instead of an array.</span>
 *
 * <img src="./img/windowWhen.png" width="100%">
 *
 * Returns an Observable that emits windows of items it collects from the source
 * Observable. The output Observable emits connected, non-overlapping windows.
 * It emits the current window and opens a new one whenever the Observable
 * produced by the specified `closingSelector` function emits an item. The first
 * window is opened immediately when subscribing to the output Observable.
 *
 * @example <caption>Emit only the first two clicks events in every window of [1-5] random seconds</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var result = clicks
 *   .windowWhen(() => Rx.Observable.interval(1000 + Math.random() * 4000))
 *   .map(win => win.take(2)) // each window has at most 2 emissions
 *   .mergeAll(); // flatten the Observable-of-Observables
 * result.subscribe(x => console.log(x));
 *
 * @see {@link window}
 * @see {@link windowCount}
 * @see {@link windowTime}
 * @see {@link windowToggle}
 * @see {@link bufferWhen}
 *
 * @param {function(): Observable} closingSelector A function that takes no
 * arguments and returns an Observable that signals (on either `next` or
 * `complete`) when to close the previous window and start a new one.
 * @return {Observable<Observable<T>>} An observable of windows, which in turn
 * are Observables.
 * @method windowWhen
 * @owner Observable
 */
function windowWhen(closingSelector) {
    return this.lift(new WindowOperator(closingSelector));
}
exports.windowWhen = windowWhen;
var WindowOperator = (function () {
    function WindowOperator(closingSelector) {
        this.closingSelector = closingSelector;
    }
    WindowOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
    };
    return WindowOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var WindowSubscriber = (function (_super) {
    __extends(WindowSubscriber, _super);
    function WindowSubscriber(destination, closingSelector) {
        _super.call(this, destination);
        this.destination = destination;
        this.closingSelector = closingSelector;
        this.openWindow();
    }
    WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.openWindow(innerSub);
    };
    WindowSubscriber.prototype.notifyError = function (error, innerSub) {
        this._error(error);
    };
    WindowSubscriber.prototype.notifyComplete = function (innerSub) {
        this.openWindow(innerSub);
    };
    WindowSubscriber.prototype._next = function (value) {
        this.window.next(value);
    };
    WindowSubscriber.prototype._error = function (err) {
        this.window.error(err);
        this.destination.error(err);
        this.unsubscribeClosingNotification();
    };
    WindowSubscriber.prototype._complete = function () {
        this.window.complete();
        this.destination.complete();
        this.unsubscribeClosingNotification();
    };
    WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
        if (this.closingNotification) {
            this.closingNotification.unsubscribe();
        }
    };
    WindowSubscriber.prototype.openWindow = function (innerSub) {
        if (innerSub === void 0) { innerSub = null; }
        if (innerSub) {
            this.remove(innerSub);
            innerSub.unsubscribe();
        }
        var prevWindow = this.window;
        if (prevWindow) {
            prevWindow.complete();
        }
        var window = this.window = new Subject_1.Subject();
        this.destination.next(window);
        var closingNotifier = tryCatch_1.tryCatch(this.closingSelector)();
        if (closingNotifier === errorObject_1.errorObject) {
            var err = errorObject_1.errorObject.e;
            this.destination.error(err);
            this.window.error(err);
        }
        else {
            this.add(this.closingNotification = subscribeToResult_1.subscribeToResult(this, closingNotifier));
        }
    };
    return WindowSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=windowWhen.js.map

/***/ }),
/* 1019 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 OuterSubscriber_1 = __webpack_require__(9);
var subscribeToResult_1 = __webpack_require__(10);
/* tslint:enable:max-line-length */
/**
 * Combines the source Observable with other Observables to create an Observable
 * whose values are calculated from the latest values of each, only when the
 * source emits.
 *
 * <span class="informal">Whenever the source Observable emits a value, it
 * computes a formula using that value plus the latest values from other input
 * Observables, then emits the output of that formula.</span>
 *
 * <img src="./img/withLatestFrom.png" width="100%">
 *
 * `withLatestFrom` combines each value from the source Observable (the
 * instance) with the latest values from the other input Observables only when
 * the source emits a value, optionally using a `project` function to determine
 * the value to be emitted on the output Observable. All input Observables must
 * emit at least one value before the output Observable will emit a value.
 *
 * @example <caption>On every click event, emit an array with the latest timer event plus the click event</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var timer = Rx.Observable.interval(1000);
 * var result = clicks.withLatestFrom(timer);
 * result.subscribe(x => console.log(x));
 *
 * @see {@link combineLatest}
 *
 * @param {ObservableInput} other An input Observable to combine with the source
 * Observable. More than one input Observables may be given as argument.
 * @param {Function} [project] Projection function for combining values
 * together. Receives all values in order of the Observables passed, where the
 * first parameter is a value from the source Observable. (e.g.
 * `a.withLatestFrom(b, c, (a1, b1, c1) => a1 + b1 + c1)`). If this is not
 * passed, arrays will be emitted on the output Observable.
 * @return {Observable} An Observable of projected values from the most recent
 * values from each input Observable, or an array of the most recent values from
 * each input Observable.
 * @method withLatestFrom
 * @owner Observable
 */
function withLatestFrom() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i - 0] = arguments[_i];
    }
    var project;
    if (typeof args[args.length - 1] === 'function') {
        project = args.pop();
    }
    var observables = args;
    return this.lift(new WithLatestFromOperator(observables, project));
}
exports.withLatestFrom = withLatestFrom;
var WithLatestFromOperator = (function () {
    function WithLatestFromOperator(observables, project) {
        this.observables = observables;
        this.project = project;
    }
    WithLatestFromOperator.prototype.call = function (subscriber, source) {
        return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
    };
    return WithLatestFromOperator;
}());
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var WithLatestFromSubscriber = (function (_super) {
    __extends(WithLatestFromSubscriber, _super);
    function WithLatestFromSubscriber(destination, observables, project) {
        _super.call(this, destination);
        this.observables = observables;
        this.project = project;
        this.toRespond = [];
        var len = observables.length;
        this.values = new Array(len);
        for (var i = 0; i < len; i++) {
            this.toRespond.push(i);
        }
        for (var i = 0; i < len; i++) {
            var observable = observables[i];
            this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i));
        }
    }
    WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
        this.values[outerIndex] = innerValue;
        var toRespond = this.toRespond;
        if (toRespond.length > 0) {
            var found = toRespond.indexOf(outerIndex);
            if (found !== -1) {
                toRespond.splice(found, 1);
            }
        }
    };
    WithLatestFromSubscriber.prototype.notifyComplete = function () {
        // noop
    };
    WithLatestFromSubscriber.prototype._next = function (value) {
        if (this.toRespond.length === 0) {
            var args = [value].concat(this.values);
            if (this.project) {
                this._tryProject(args);
            }
            else {
                this.destination.next(args);
            }
        }
    };
    WithLatestFromSubscriber.prototype._tryProject = function (args) {
        var result;
        try {
            result = this.project.apply(this, args);
        }
        catch (err) {
            this.destination.error(err);
            return;
        }
        this.destination.next(result);
    };
    return WithLatestFromSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=withLatestFrom.js.map

/***/ }),
/* 1020 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var zip_1 = __webpack_require__(248);
/**
 * @param project
 * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}
 * @method zipAll
 * @owner Observable
 */
function zipAll(project) {
    return this.lift(new zip_1.ZipOperator(project));
}
exports.zipAll = zipAll;
//# sourceMappingURL=zipAll.js.map

/***/ }),
/* 1021 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subscription_1 = __webpack_require__(16);
/**
 * A unit of work to be executed in a {@link Scheduler}. An action is typically
 * created from within a Scheduler and an RxJS user does not need to concern
 * themselves about creating and manipulating an Action.
 *
 * ```ts
 * class Action<T> extends Subscription {
 *   new (scheduler: Scheduler, work: (state?: T) => void);
 *   schedule(state?: T, delay: number = 0): Subscription;
 * }
 * ```
 *
 * @class Action<T>
 */
var Action = (function (_super) {
    __extends(Action, _super);
    function Action(scheduler, work) {
        _super.call(this);
    }
    /**
     * Schedules this action on its parent Scheduler for execution. May be passed
     * some context object, `state`. May happen at some point in the future,
     * according to the `delay` parameter, if specified.
     * @param {T} [state] Some contextual data that the `work` function uses when
     * called by the Scheduler.
     * @param {number} [delay] Time to wait before executing the work, where the
     * time unit is implicit and defined by the Scheduler.
     * @return {void}
     */
    Action.prototype.schedule = function (state, delay) {
        if (delay === void 0) { delay = 0; }
        return this;
    };
    return Action;
}(Subscription_1.Subscription));
exports.Action = Action;
//# sourceMappingURL=Action.js.map

/***/ }),
/* 1022 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 AsyncAction_1 = __webpack_require__(108);
var AnimationFrame_1 = __webpack_require__(1031);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var AnimationFrameAction = (function (_super) {
    __extends(AnimationFrameAction, _super);
    function AnimationFrameAction(scheduler, work) {
        _super.call(this, scheduler, work);
        this.scheduler = scheduler;
        this.work = work;
    }
    AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        // If delay is greater than 0, request as an async action.
        if (delay !== null && delay > 0) {
            return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
        }
        // Push the action to the end of the scheduler queue.
        scheduler.actions.push(this);
        // If an animation frame has already been requested, don't request another
        // one. If an animation frame hasn't been requested yet, request one. Return
        // the current animation frame request id.
        return scheduler.scheduled || (scheduler.scheduled = AnimationFrame_1.AnimationFrame.requestAnimationFrame(scheduler.flush.bind(scheduler, null)));
    };
    AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        // If delay exists and is greater than 0, or if the delay is null (the
        // action wasn't rescheduled) but was originally scheduled as an async
        // action, then recycle as an async action.
        if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
            return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
        }
        // If the scheduler queue is empty, cancel the requested animation frame and
        // set the scheduled flag to undefined so the next AnimationFrameAction will
        // request its own.
        if (scheduler.actions.length === 0) {
            AnimationFrame_1.AnimationFrame.cancelAnimationFrame(id);
            scheduler.scheduled = undefined;
        }
        // Return undefined so the action knows to request a new async id if it's rescheduled.
        return undefined;
    };
    return AnimationFrameAction;
}(AsyncAction_1.AsyncAction));
exports.AnimationFrameAction = AnimationFrameAction;
//# sourceMappingURL=AnimationFrameAction.js.map

/***/ }),
/* 1023 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 AsyncScheduler_1 = __webpack_require__(109);
var AnimationFrameScheduler = (function (_super) {
    __extends(AnimationFrameScheduler, _super);
    function AnimationFrameScheduler() {
        _super.apply(this, arguments);
    }
    AnimationFrameScheduler.prototype.flush = function (action) {
        this.active = true;
        this.scheduled = undefined;
        var actions = this.actions;
        var error;
        var index = -1;
        var count = actions.length;
        action = action || actions.shift();
        do {
            if (error = action.execute(action.state, action.delay)) {
                break;
            }
        } while (++index < count && (action = actions.shift()));
        this.active = false;
        if (error) {
            while (++index < count && (action = actions.shift())) {
                action.unsubscribe();
            }
            throw error;
        }
    };
    return AnimationFrameScheduler;
}(AsyncScheduler_1.AsyncScheduler));
exports.AnimationFrameScheduler = AnimationFrameScheduler;
//# sourceMappingURL=AnimationFrameScheduler.js.map

/***/ }),
/* 1024 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Immediate_1 = __webpack_require__(1033);
var AsyncAction_1 = __webpack_require__(108);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var AsapAction = (function (_super) {
    __extends(AsapAction, _super);
    function AsapAction(scheduler, work) {
        _super.call(this, scheduler, work);
        this.scheduler = scheduler;
        this.work = work;
    }
    AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        // If delay is greater than 0, request as an async action.
        if (delay !== null && delay > 0) {
            return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
        }
        // Push the action to the end of the scheduler queue.
        scheduler.actions.push(this);
        // If a microtask has already been scheduled, don't schedule another
        // one. If a microtask hasn't been scheduled yet, schedule one now. Return
        // the current scheduled microtask id.
        return scheduler.scheduled || (scheduler.scheduled = Immediate_1.Immediate.setImmediate(scheduler.flush.bind(scheduler, null)));
    };
    AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        // If delay exists and is greater than 0, or if the delay is null (the
        // action wasn't rescheduled) but was originally scheduled as an async
        // action, then recycle as an async action.
        if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
            return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
        }
        // If the scheduler queue is empty, cancel the requested microtask and
        // set the scheduled flag to undefined so the next AsapAction will schedule
        // its own.
        if (scheduler.actions.length === 0) {
            Immediate_1.Immediate.clearImmediate(id);
            scheduler.scheduled = undefined;
        }
        // Return undefined so the action knows to request a new async id if it's rescheduled.
        return undefined;
    };
    return AsapAction;
}(AsyncAction_1.AsyncAction));
exports.AsapAction = AsapAction;
//# sourceMappingURL=AsapAction.js.map

/***/ }),
/* 1025 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 AsyncScheduler_1 = __webpack_require__(109);
var AsapScheduler = (function (_super) {
    __extends(AsapScheduler, _super);
    function AsapScheduler() {
        _super.apply(this, arguments);
    }
    AsapScheduler.prototype.flush = function (action) {
        this.active = true;
        this.scheduled = undefined;
        var actions = this.actions;
        var error;
        var index = -1;
        var count = actions.length;
        action = action || actions.shift();
        do {
            if (error = action.execute(action.state, action.delay)) {
                break;
            }
        } while (++index < count && (action = actions.shift()));
        this.active = false;
        if (error) {
            while (++index < count && (action = actions.shift())) {
                action.unsubscribe();
            }
            throw error;
        }
    };
    return AsapScheduler;
}(AsyncScheduler_1.AsyncScheduler));
exports.AsapScheduler = AsapScheduler;
//# sourceMappingURL=AsapScheduler.js.map

/***/ }),
/* 1026 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 AsyncAction_1 = __webpack_require__(108);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var QueueAction = (function (_super) {
    __extends(QueueAction, _super);
    function QueueAction(scheduler, work) {
        _super.call(this, scheduler, work);
        this.scheduler = scheduler;
        this.work = work;
    }
    QueueAction.prototype.schedule = function (state, delay) {
        if (delay === void 0) { delay = 0; }
        if (delay > 0) {
            return _super.prototype.schedule.call(this, state, delay);
        }
        this.delay = delay;
        this.state = state;
        this.scheduler.flush(this);
        return this;
    };
    QueueAction.prototype.execute = function (state, delay) {
        return (delay > 0 || this.closed) ?
            _super.prototype.execute.call(this, state, delay) :
            this._execute(state, delay);
    };
    QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
        if (delay === void 0) { delay = 0; }
        // If delay exists and is greater than 0, or if the delay is null (the
        // action wasn't rescheduled) but was originally scheduled as an async
        // action, then recycle as an async action.
        if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
            return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
        }
        // Otherwise flush the scheduler starting with this action.
        return scheduler.flush(this);
    };
    return QueueAction;
}(AsyncAction_1.AsyncAction));
exports.QueueAction = QueueAction;
//# sourceMappingURL=QueueAction.js.map

/***/ }),
/* 1027 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 AsyncScheduler_1 = __webpack_require__(109);
var QueueScheduler = (function (_super) {
    __extends(QueueScheduler, _super);
    function QueueScheduler() {
        _super.apply(this, arguments);
    }
    return QueueScheduler;
}(AsyncScheduler_1.AsyncScheduler));
exports.QueueScheduler = QueueScheduler;
//# sourceMappingURL=QueueScheduler.js.map

/***/ }),
/* 1028 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var Subscription_1 = __webpack_require__(16);
var SubscriptionLoggable_1 = __webpack_require__(516);
var applyMixins_1 = __webpack_require__(518);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var ColdObservable = (function (_super) {
    __extends(ColdObservable, _super);
    function ColdObservable(messages, scheduler) {
        _super.call(this, function (subscriber) {
            var observable = this;
            var index = observable.logSubscribedFrame();
            subscriber.add(new Subscription_1.Subscription(function () {
                observable.logUnsubscribedFrame(index);
            }));
            observable.scheduleMessages(subscriber);
            return subscriber;
        });
        this.messages = messages;
        this.subscriptions = [];
        this.scheduler = scheduler;
    }
    ColdObservable.prototype.scheduleMessages = function (subscriber) {
        var messagesLength = this.messages.length;
        for (var i = 0; i < messagesLength; i++) {
            var message = this.messages[i];
            subscriber.add(this.scheduler.schedule(function (_a) {
                var message = _a.message, subscriber = _a.subscriber;
                message.notification.observe(subscriber);
            }, message.frame, { message: message, subscriber: subscriber }));
        }
    };
    return ColdObservable;
}(Observable_1.Observable));
exports.ColdObservable = ColdObservable;
applyMixins_1.applyMixins(ColdObservable, [SubscriptionLoggable_1.SubscriptionLoggable]);
//# sourceMappingURL=ColdObservable.js.map

/***/ }),
/* 1029 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Subject_1 = __webpack_require__(11);
var Subscription_1 = __webpack_require__(16);
var SubscriptionLoggable_1 = __webpack_require__(516);
var applyMixins_1 = __webpack_require__(518);
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
var HotObservable = (function (_super) {
    __extends(HotObservable, _super);
    function HotObservable(messages, scheduler) {
        _super.call(this);
        this.messages = messages;
        this.subscriptions = [];
        this.scheduler = scheduler;
    }
    HotObservable.prototype._subscribe = function (subscriber) {
        var subject = this;
        var index = subject.logSubscribedFrame();
        subscriber.add(new Subscription_1.Subscription(function () {
            subject.logUnsubscribedFrame(index);
        }));
        return _super.prototype._subscribe.call(this, subscriber);
    };
    HotObservable.prototype.setup = function () {
        var subject = this;
        var messagesLength = subject.messages.length;
        /* tslint:disable:no-var-keyword */
        for (var i = 0; i < messagesLength; i++) {
            (function () {
                var message = subject.messages[i];
                /* tslint:enable */
                subject.scheduler.schedule(function () { message.notification.observe(subject); }, message.frame);
            })();
        }
    };
    return HotObservable;
}(Subject_1.Subject));
exports.HotObservable = HotObservable;
applyMixins_1.applyMixins(HotObservable, [SubscriptionLoggable_1.SubscriptionLoggable]);
//# sourceMappingURL=HotObservable.js.map

/***/ }),
/* 1030 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

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 Observable_1 = __webpack_require__(1);
var Notification_1 = __webpack_require__(151);
var ColdObservable_1 = __webpack_require__(1028);
var HotObservable_1 = __webpack_require__(1029);
var SubscriptionLog_1 = __webpack_require__(515);
var VirtualTimeScheduler_1 = __webpack_require__(511);
var defaultMaxFrame = 750;
var TestScheduler = (function (_super) {
    __extends(TestScheduler, _super);
    function TestScheduler(assertDeepEqual) {
        _super.call(this, VirtualTimeScheduler_1.VirtualAction, defaultMaxFrame);
        this.assertDeepEqual = assertDeepEqual;
        this.hotObservables = [];
        this.coldObservables = [];
        this.flushTests = [];
    }
    TestScheduler.prototype.createTime = function (marbles) {
        var indexOf = marbles.indexOf('|');
        if (indexOf === -1) {
            throw new Error('marble diagram for time should have a completion marker "|"');
        }
        return indexOf * TestScheduler.frameTimeFactor;
    };
    TestScheduler.prototype.createColdObservable = function (marbles, values, error) {
        if (marbles.indexOf('^') !== -1) {
            throw new Error('cold observable cannot have subscription offset "^"');
        }
        if (marbles.indexOf('!') !== -1) {
            throw new Error('cold observable cannot have unsubscription marker "!"');
        }
        var messages = TestScheduler.parseMarbles(marbles, values, error);
        var cold = new ColdObservable_1.ColdObservable(messages, this);
        this.coldObservables.push(cold);
        return cold;
    };
    TestScheduler.prototype.createHotObservable = function (marbles, values, error) {
        if (marbles.indexOf('!') !== -1) {
            throw new Error('hot observable cannot have unsubscription marker "!"');
        }
        var messages = TestScheduler.parseMarbles(marbles, values, error);
        var subject = new HotObservable_1.HotObservable(messages, this);
        this.hotObservables.push(subject);
        return subject;
    };
    TestScheduler.prototype.materializeInnerObservable = function (observable, outerFrame) {
        var _this = this;
        var messages = [];
        observable.subscribe(function (value) {
            messages.push({ frame: _this.frame - outerFrame, notification: Notification_1.Notification.createNext(value) });
        }, function (err) {
            messages.push({ frame: _this.frame - outerFrame, notification: Notification_1.Notification.createError(err) });
        }, function () {
            messages.push({ frame: _this.frame - outerFrame, notification: Notification_1.Notification.createComplete() });
        });
        return messages;
    };
    TestScheduler.prototype.expectObservable = function (observable, unsubscriptionMarbles) {
        var _this = this;
        if (unsubscriptionMarbles === void 0) { unsubscriptionMarbles = null; }
        var actual = [];
        var flushTest = { actual: actual, ready: false };
        var unsubscriptionFrame = TestScheduler
            .parseMarblesAsSubscriptions(unsubscriptionMarbles).unsubscribedFrame;
        var subscription;
        this.schedule(function () {
            subscription = observable.subscribe(function (x) {
                var value = x;
                // Support Observable-of-Observables
                if (x instanceof Observable_1.Observable) {
                    value = _this.materializeInnerObservable(value, _this.frame);
                }
                actual.push({ frame: _this.frame, notification: Notification_1.Notification.createNext(value) });
            }, function (err) {
                actual.push({ frame: _this.frame, notification: Notification_1.Notification.createError(err) });
            }, function () {
                actual.push({ frame: _this.frame, notification: Notification_1.Notification.createComplete() });
            });
        }, 0);
        if (unsubscriptionFrame !== Number.POSITIVE_INFINITY) {
            this.schedule(function () { return subscription.unsubscribe(); }, unsubscriptionFrame);
        }
        this.flushTests.push(flushTest);
        return {
            toBe: function (marbles, values, errorValue) {
                flushTest.ready = true;
                flushTest.expected = TestScheduler.parseMarbles(marbles, values, errorValue, true);
            }
        };
    };
    TestScheduler.prototype.expectSubscriptions = function (actualSubscriptionLogs) {
        var flushTest = { actual: actualSubscriptionLogs, ready: false };
        this.flushTests.push(flushTest);
        return {
            toBe: function (marbles) {
                var marblesArray = (typeof marbles === 'string') ? [marbles] : marbles;
                flushTest.ready = true;
                flushTest.expected = marblesArray.map(function (marbles) {
                    return TestScheduler.parseMarblesAsSubscriptions(marbles);
                });
            }
        };
    };
    TestScheduler.prototype.flush = function () {
        var hotObservables = this.hotObservables;
        while (hotObservables.length > 0) {
            hotObservables.shift().setup();
        }
        _super.prototype.flush.call(this);
        var readyFlushTests = this.flushTests.filter(function (test) { return test.ready; });
        while (readyFlushTests.length > 0) {
            var test = readyFlushTests.shift();
            this.assertDeepEqual(test.actual, test.expected);
        }
    };
    TestScheduler.parseMarblesAsSubscriptions = function (marbles) {
        if (typeof marbles !== 'string') {
            return new SubscriptionLog_1.SubscriptionLog(Number.POSITIVE_INFINITY);
        }
        var len = marbles.length;
        var groupStart = -1;
        var subscriptionFrame = Number.POSITIVE_INFINITY;
        var unsubscriptionFrame = Number.POSITIVE_INFINITY;
        for (var i = 0; i < len; i++) {
            var frame = i * this.frameTimeFactor;
            var c = marbles[i];
            switch (c) {
                case '-':
                case ' ':
                    break;
                case '(':
                    groupStart = frame;
                    break;
                case ')':
                    groupStart = -1;
                    break;
                case '^':
                    if (subscriptionFrame !== Number.POSITIVE_INFINITY) {
                        throw new Error('found a second subscription point \'^\' in a ' +
                            'subscription marble diagram. There can only be one.');
                    }
                    subscriptionFrame = groupStart > -1 ? groupStart : frame;
                    break;
                case '!':
                    if (unsubscriptionFrame !== Number.POSITIVE_INFINITY) {
                        throw new Error('found a second subscription point \'^\' in a ' +
                            'subscription marble diagram. There can only be one.');
                    }
                    unsubscriptionFrame = groupStart > -1 ? groupStart : frame;
                    break;
                default:
                    throw new Error('there can only be \'^\' and \'!\' markers in a ' +
                        'subscription marble diagram. Found instead \'' + c + '\'.');
            }
        }
        if (unsubscriptionFrame < 0) {
            return new SubscriptionLog_1.SubscriptionLog(subscriptionFrame);
        }
        else {
            return new SubscriptionLog_1.SubscriptionLog(subscriptionFrame, unsubscriptionFrame);
        }
    };
    TestScheduler.parseMarbles = function (marbles, values, errorValue, materializeInnerObservables) {
        if (materializeInnerObservables === void 0) { materializeInnerObservables = false; }
        if (marbles.indexOf('!') !== -1) {
            throw new Error('conventional marble diagrams cannot have the ' +
                'unsubscription marker "!"');
        }
        var len = marbles.length;
        var testMessages = [];
        var subIndex = marbles.indexOf('^');
        var frameOffset = subIndex === -1 ? 0 : (subIndex * -this.frameTimeFactor);
        var getValue = typeof values !== 'object' ?
            function (x) { return x; } :
            function (x) {
                // Support Observable-of-Observables
                if (materializeInnerObservables && values[x] instanceof ColdObservable_1.ColdObservable) {
                    return values[x].messages;
                }
                return values[x];
            };
        var groupStart = -1;
        for (var i = 0; i < len; i++) {
            var frame = i * this.frameTimeFactor + frameOffset;
            var notification = void 0;
            var c = marbles[i];
            switch (c) {
                case '-':
                case ' ':
                    break;
                case '(':
                    groupStart = frame;
                    break;
                case ')':
                    groupStart = -1;
                    break;
                case '|':
                    notification = Notification_1.Notification.createComplete();
                    break;
                case '^':
                    break;
                case '#':
                    notification = Notification_1.Notification.createError(errorValue || 'error');
                    break;
                default:
                    notification = Notification_1.Notification.createNext(getValue(c));
                    break;
            }
            if (notification) {
                testMessages.push({ frame: groupStart > -1 ? groupStart : frame, notification: notification });
            }
        }
        return testMessages;
    };
    return TestScheduler;
}(VirtualTimeScheduler_1.VirtualTimeScheduler));
exports.TestScheduler = TestScheduler;
//# sourceMappingURL=TestScheduler.js.map

/***/ }),
/* 1031 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var root_1 = __webpack_require__(42);
var RequestAnimationFrameDefinition = (function () {
    function RequestAnimationFrameDefinition(root) {
        if (root.requestAnimationFrame) {
            this.cancelAnimationFrame = root.cancelAnimationFrame.bind(root);
            this.requestAnimationFrame = root.requestAnimationFrame.bind(root);
        }
        else if (root.mozRequestAnimationFrame) {
            this.cancelAnimationFrame = root.mozCancelAnimationFrame.bind(root);
            this.requestAnimationFrame = root.mozRequestAnimationFrame.bind(root);
        }
        else if (root.webkitRequestAnimationFrame) {
            this.cancelAnimationFrame = root.webkitCancelAnimationFrame.bind(root);
            this.requestAnimationFrame = root.webkitRequestAnimationFrame.bind(root);
        }
        else if (root.msRequestAnimationFrame) {
            this.cancelAnimationFrame = root.msCancelAnimationFrame.bind(root);
            this.requestAnimationFrame = root.msRequestAnimationFrame.bind(root);
        }
        else if (root.oRequestAnimationFrame) {
            this.cancelAnimationFrame = root.oCancelAnimationFrame.bind(root);
            this.requestAnimationFrame = root.oRequestAnimationFrame.bind(root);
        }
        else {
            this.cancelAnimationFrame = root.clearTimeout.bind(root);
            this.requestAnimationFrame = function (cb) { return root.setTimeout(cb, 1000 / 60); };
        }
    }
    return RequestAnimationFrameDefinition;
}());
exports.RequestAnimationFrameDefinition = RequestAnimationFrameDefinition;
exports.AnimationFrame = new RequestAnimationFrameDefinition(root_1.root);
//# sourceMappingURL=AnimationFrame.js.map

/***/ }),
/* 1032 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var FastMap = (function () {
    function FastMap() {
        this.values = {};
    }
    FastMap.prototype.delete = function (key) {
        this.values[key] = null;
        return true;
    };
    FastMap.prototype.set = function (key, value) {
        this.values[key] = value;
        return this;
    };
    FastMap.prototype.get = function (key) {
        return this.values[key];
    };
    FastMap.prototype.forEach = function (cb, thisArg) {
        var values = this.values;
        for (var key in values) {
            if (values.hasOwnProperty(key) && values[key] !== null) {
                cb.call(thisArg, values[key], key);
            }
        }
    };
    FastMap.prototype.clear = function () {
        this.values = {};
    };
    return FastMap;
}());
exports.FastMap = FastMap;
//# sourceMappingURL=FastMap.js.map

/***/ }),
/* 1033 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(clearImmediate, setImmediate) {/**
Some credit for this helper goes to http://github.com/YuzuJS/setImmediate
*/

var root_1 = __webpack_require__(42);
var ImmediateDefinition = (function () {
    function ImmediateDefinition(root) {
        this.root = root;
        if (root.setImmediate && typeof root.setImmediate === 'function') {
            this.setImmediate = root.setImmediate.bind(root);
            this.clearImmediate = root.clearImmediate.bind(root);
        }
        else {
            this.nextHandle = 1;
            this.tasksByHandle = {};
            this.currentlyRunningATask = false;
            // Don't get fooled by e.g. browserify environments.
            if (this.canUseProcessNextTick()) {
                // For Node.js before 0.9
                this.setImmediate = this.createProcessNextTickSetImmediate();
            }
            else if (this.canUsePostMessage()) {
                // For non-IE10 modern browsers
                this.setImmediate = this.createPostMessageSetImmediate();
            }
            else if (this.canUseMessageChannel()) {
                // For web workers, where supported
                this.setImmediate = this.createMessageChannelSetImmediate();
            }
            else if (this.canUseReadyStateChange()) {
                // For IE 6–8
                this.setImmediate = this.createReadyStateChangeSetImmediate();
            }
            else {
                // For older browsers
                this.setImmediate = this.createSetTimeoutSetImmediate();
            }
            var ci = function clearImmediate(handle) {
                delete clearImmediate.instance.tasksByHandle[handle];
            };
            ci.instance = this;
            this.clearImmediate = ci;
        }
    }
    ImmediateDefinition.prototype.identify = function (o) {
        return this.root.Object.prototype.toString.call(o);
    };
    ImmediateDefinition.prototype.canUseProcessNextTick = function () {
        return this.identify(this.root.process) === '[object process]';
    };
    ImmediateDefinition.prototype.canUseMessageChannel = function () {
        return Boolean(this.root.MessageChannel);
    };
    ImmediateDefinition.prototype.canUseReadyStateChange = function () {
        var document = this.root.document;
        return Boolean(document && 'onreadystatechange' in document.createElement('script'));
    };
    ImmediateDefinition.prototype.canUsePostMessage = function () {
        var root = this.root;
        // The test against `importScripts` prevents this implementation from being installed inside a web worker,
        // where `root.postMessage` means something completely different and can't be used for this purpose.
        if (root.postMessage && !root.importScripts) {
            var postMessageIsAsynchronous_1 = true;
            var oldOnMessage = root.onmessage;
            root.onmessage = function () {
                postMessageIsAsynchronous_1 = false;
            };
            root.postMessage('', '*');
            root.onmessage = oldOnMessage;
            return postMessageIsAsynchronous_1;
        }
        return false;
    };
    // This function accepts the same arguments as setImmediate, but
    // returns a function that requires no arguments.
    ImmediateDefinition.prototype.partiallyApplied = function (handler) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var fn = function result() {
            var _a = result, handler = _a.handler, args = _a.args;
            if (typeof handler === 'function') {
                handler.apply(undefined, args);
            }
            else {
                (new Function('' + handler))();
            }
        };
        fn.handler = handler;
        fn.args = args;
        return fn;
    };
    ImmediateDefinition.prototype.addFromSetImmediateArguments = function (args) {
        this.tasksByHandle[this.nextHandle] = this.partiallyApplied.apply(undefined, args);
        return this.nextHandle++;
    };
    ImmediateDefinition.prototype.createProcessNextTickSetImmediate = function () {
        var fn = function setImmediate() {
            var instance = setImmediate.instance;
            var handle = instance.addFromSetImmediateArguments(arguments);
            instance.root.process.nextTick(instance.partiallyApplied(instance.runIfPresent, handle));
            return handle;
        };
        fn.instance = this;
        return fn;
    };
    ImmediateDefinition.prototype.createPostMessageSetImmediate = function () {
        // Installs an event handler on `global` for the `message` event: see
        // * https://developer.mozilla.org/en/DOM/window.postMessage
        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
        var root = this.root;
        var messagePrefix = 'setImmediate$' + root.Math.random() + '$';
        var onGlobalMessage = function globalMessageHandler(event) {
            var instance = globalMessageHandler.instance;
            if (event.source === root &&
                typeof event.data === 'string' &&
                event.data.indexOf(messagePrefix) === 0) {
                instance.runIfPresent(+event.data.slice(messagePrefix.length));
            }
        };
        onGlobalMessage.instance = this;
        root.addEventListener('message', onGlobalMessage, false);
        var fn = function setImmediate() {
            var _a = setImmediate, messagePrefix = _a.messagePrefix, instance = _a.instance;
            var handle = instance.addFromSetImmediateArguments(arguments);
            instance.root.postMessage(messagePrefix + handle, '*');
            return handle;
        };
        fn.instance = this;
        fn.messagePrefix = messagePrefix;
        return fn;
    };
    ImmediateDefinition.prototype.runIfPresent = function (handle) {
        // From the spec: 'Wait until any invocations of this algorithm started before this one have completed.'
        // So if we're currently running a task, we'll need to delay this invocation.
        if (this.currentlyRunningATask) {
            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
            // 'too much recursion' error.
            this.root.setTimeout(this.partiallyApplied(this.runIfPresent, handle), 0);
        }
        else {
            var task = this.tasksByHandle[handle];
            if (task) {
                this.currentlyRunningATask = true;
                try {
                    task();
                }
                finally {
                    this.clearImmediate(handle);
                    this.currentlyRunningATask = false;
                }
            }
        }
    };
    ImmediateDefinition.prototype.createMessageChannelSetImmediate = function () {
        var _this = this;
        var channel = new this.root.MessageChannel();
        channel.port1.onmessage = function (event) {
            var handle = event.data;
            _this.runIfPresent(handle);
        };
        var fn = function setImmediate() {
            var _a = setImmediate, channel = _a.channel, instance = _a.instance;
            var handle = instance.addFromSetImmediateArguments(arguments);
            channel.port2.postMessage(handle);
            return handle;
        };
        fn.channel = channel;
        fn.instance = this;
        return fn;
    };
    ImmediateDefinition.prototype.createReadyStateChangeSetImmediate = function () {
        var fn = function setImmediate() {
            var instance = setImmediate.instance;
            var root = instance.root;
            var doc = root.document;
            var html = doc.documentElement;
            var handle = instance.addFromSetImmediateArguments(arguments);
            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
            var script = doc.createElement('script');
            script.onreadystatechange = function () {
                instance.runIfPresent(handle);
                script.onreadystatechange = null;
                html.removeChild(script);
                script = null;
            };
            html.appendChild(script);
            return handle;
        };
        fn.instance = this;
        return fn;
    };
    ImmediateDefinition.prototype.createSetTimeoutSetImmediate = function () {
        var fn = function setImmediate() {
            var instance = setImmediate.instance;
            var handle = instance.addFromSetImmediateArguments(arguments);
            instance.root.setTimeout(instance.partiallyApplied(instance.runIfPresent, handle), 0);
            return handle;
        };
        fn.instance = this;
        return fn;
    };
    return ImmediateDefinition;
}());
exports.ImmediateDefinition = ImmediateDefinition;
exports.Immediate = new ImmediateDefinition(root_1.root);
//# sourceMappingURL=Immediate.js.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(520).clearImmediate, __webpack_require__(520).setImmediate))

/***/ }),
/* 1034 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var root_1 = __webpack_require__(42);
var MapPolyfill_1 = __webpack_require__(1035);
exports.Map = root_1.root.Map || (function () { return MapPolyfill_1.MapPolyfill; })();
//# sourceMappingURL=Map.js.map

/***/ }),
/* 1035 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var MapPolyfill = (function () {
    function MapPolyfill() {
        this.size = 0;
        this._values = [];
        this._keys = [];
    }
    MapPolyfill.prototype.get = function (key) {
        var i = this._keys.indexOf(key);
        return i === -1 ? undefined : this._values[i];
    };
    MapPolyfill.prototype.set = function (key, value) {
        var i = this._keys.indexOf(key);
        if (i === -1) {
            this._keys.push(key);
            this._values.push(value);
            this.size++;
        }
        else {
            this._values[i] = value;
        }
        return this;
    };
    MapPolyfill.prototype.delete = function (key) {
        var i = this._keys.indexOf(key);
        if (i === -1) {
            return false;
        }
        this._values.splice(i, 1);
        this._keys.splice(i, 1);
        this.size--;
        return true;
    };
    MapPolyfill.prototype.clear = function () {
        this._keys.length = 0;
        this._values.length = 0;
        this.size = 0;
    };
    MapPolyfill.prototype.forEach = function (cb, thisArg) {
        for (var i = 0; i < this.size; i++) {
            cb.call(thisArg, this._values[i], this._keys[i]);
        }
    };
    return MapPolyfill;
}());
exports.MapPolyfill = MapPolyfill;
//# sourceMappingURL=MapPolyfill.js.map

/***/ }),
/* 1036 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var root_1 = __webpack_require__(42);
function minimalSetImpl() {
    // THIS IS NOT a full impl of Set, this is just the minimum
    // bits of functionality we need for this library.
    return (function () {
        function MinimalSet() {
            this._values = [];
        }
        MinimalSet.prototype.add = function (value) {
            if (!this.has(value)) {
                this._values.push(value);
            }
        };
        MinimalSet.prototype.has = function (value) {
            return this._values.indexOf(value) !== -1;
        };
        Object.defineProperty(MinimalSet.prototype, "size", {
            get: function () {
                return this._values.length;
            },
            enumerable: true,
            configurable: true
        });
        MinimalSet.prototype.clear = function () {
            this._values.length = 0;
        };
        return MinimalSet;
    }());
}
exports.minimalSetImpl = minimalSetImpl;
exports.Set = root_1.root.Set || minimalSetImpl();
//# sourceMappingURL=Set.js.map

/***/ }),
/* 1037 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var root_1 = __webpack_require__(42);
function assignImpl(target) {
    var sources = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        sources[_i - 1] = arguments[_i];
    }
    var len = sources.length;
    for (var i = 0; i < len; i++) {
        var source = sources[i];
        for (var k in source) {
            if (source.hasOwnProperty(k)) {
                target[k] = source[k];
            }
        }
    }
    return target;
}
exports.assignImpl = assignImpl;
;
function getAssign(root) {
    return root.Object.assign || assignImpl;
}
exports.getAssign = getAssign;
exports.assign = getAssign(root_1.root);
//# sourceMappingURL=assign.js.map

/***/ }),
/* 1038 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function not(pred, thisArg) {
    function notPred() {
        return !(notPred.pred.apply(notPred.thisArg, arguments));
    }
    notPred.pred = pred;
    notPred.thisArg = thisArg;
    return notPred;
}
exports.not = not;
//# sourceMappingURL=not.js.map

/***/ }),
/* 1039 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
    "use strict";

    if (global.setImmediate) {
        return;
    }

    var nextHandle = 1; // Spec says greater than zero
    var tasksByHandle = {};
    var currentlyRunningATask = false;
    var doc = global.document;
    var registerImmediate;

    function setImmediate(callback) {
      // Callback can either be a function or a string
      if (typeof callback !== "function") {
        callback = new Function("" + callback);
      }
      // Copy function arguments
      var args = new Array(arguments.length - 1);
      for (var i = 0; i < args.length; i++) {
          args[i] = arguments[i + 1];
      }
      // Store and register the task
      var task = { callback: callback, args: args };
      tasksByHandle[nextHandle] = task;
      registerImmediate(nextHandle);
      return nextHandle++;
    }

    function clearImmediate(handle) {
        delete tasksByHandle[handle];
    }

    function run(task) {
        var callback = task.callback;
        var args = task.args;
        switch (args.length) {
        case 0:
            callback();
            break;
        case 1:
            callback(args[0]);
            break;
        case 2:
            callback(args[0], args[1]);
            break;
        case 3:
            callback(args[0], args[1], args[2]);
            break;
        default:
            callback.apply(undefined, args);
            break;
        }
    }

    function runIfPresent(handle) {
        // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
        // So if we're currently running a task, we'll need to delay this invocation.
        if (currentlyRunningATask) {
            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
            // "too much recursion" error.
            setTimeout(runIfPresent, 0, handle);
        } else {
            var task = tasksByHandle[handle];
            if (task) {
                currentlyRunningATask = true;
                try {
                    run(task);
                } finally {
                    clearImmediate(handle);
                    currentlyRunningATask = false;
                }
            }
        }
    }

    function installNextTickImplementation() {
        registerImmediate = function(handle) {
            process.nextTick(function () { runIfPresent(handle); });
        };
    }

    function canUsePostMessage() {
        // The test against `importScripts` prevents this implementation from being installed inside a web worker,
        // where `global.postMessage` means something completely different and can't be used for this purpose.
        if (global.postMessage && !global.importScripts) {
            var postMessageIsAsynchronous = true;
            var oldOnMessage = global.onmessage;
            global.onmessage = function() {
                postMessageIsAsynchronous = false;
            };
            global.postMessage("", "*");
            global.onmessage = oldOnMessage;
            return postMessageIsAsynchronous;
        }
    }

    function installPostMessageImplementation() {
        // Installs an event handler on `global` for the `message` event: see
        // * https://developer.mozilla.org/en/DOM/window.postMessage
        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages

        var messagePrefix = "setImmediate$" + Math.random() + "$";
        var onGlobalMessage = function(event) {
            if (event.source === global &&
                typeof event.data === "string" &&
                event.data.indexOf(messagePrefix) === 0) {
                runIfPresent(+event.data.slice(messagePrefix.length));
            }
        };

        if (global.addEventListener) {
            global.addEventListener("message", onGlobalMessage, false);
        } else {
            global.attachEvent("onmessage", onGlobalMessage);
        }

        registerImmediate = function(handle) {
            global.postMessage(messagePrefix + handle, "*");
        };
    }

    function installMessageChannelImplementation() {
        var channel = new MessageChannel();
        channel.port1.onmessage = function(event) {
            var handle = event.data;
            runIfPresent(handle);
        };

        registerImmediate = function(handle) {
            channel.port2.postMessage(handle);
        };
    }

    function installReadyStateChangeImplementation() {
        var html = doc.documentElement;
        registerImmediate = function(handle) {
            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
            var script = doc.createElement("script");
            script.onreadystatechange = function () {
                runIfPresent(handle);
                script.onreadystatechange = null;
                html.removeChild(script);
                script = null;
            };
            html.appendChild(script);
        };
    }

    function installSetTimeoutImplementation() {
        registerImmediate = function(handle) {
            setTimeout(runIfPresent, 0, handle);
        };
    }

    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;

    // Don't get fooled by e.g. browserify environments.
    if ({}.toString.call(global.process) === "[object process]") {
        // For Node.js before 0.9
        installNextTickImplementation();

    } else if (canUsePostMessage()) {
        // For non-IE10 modern browsers
        installPostMessageImplementation();

    } else if (global.MessageChannel) {
        // For web workers, where supported
        installMessageChannelImplementation();

    } else if (doc && "onreadystatechange" in doc.createElement("script")) {
        // For IE 6–8
        installReadyStateChangeImplementation();

    } else {
        // For older browsers
        installSetTimeoutImplementation();
    }

    attachTo.setImmediate = setImmediate;
    attachTo.clearImmediate = clearImmediate;
}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(152), __webpack_require__(523)))

/***/ }),
/* 1040 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var ansiRegex = __webpack_require__(784)();

module.exports = function (str) {
	return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
};


/***/ }),
/* 1041 */
/***/ (function(module, exports, __webpack_require__) {


        var result = __webpack_require__(793);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),
/* 1042 */
/***/ (function(module, exports, __webpack_require__) {


        var result = __webpack_require__(794);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),
/* 1043 */
/***/ (function(module, exports, __webpack_require__) {

/*eslint-env browser*/

var clientOverlay = document.createElement('div');
clientOverlay.id = 'webpack-hot-middleware-clientOverlay';
var styles = {
  background: 'rgba(0,0,0,0.85)',
  color: '#E8E8E8',
  lineHeight: '1.2',
  whiteSpace: 'pre',
  fontFamily: 'Menlo, Consolas, monospace',
  fontSize: '13px',
  position: 'fixed',
  zIndex: 9999,
  padding: '10px',
  left: 0,
  right: 0,
  top: 0,
  bottom: 0,
  overflow: 'auto',
  dir: 'ltr',
  textAlign: 'left'
};
for (var key in styles) {
  clientOverlay.style[key] = styles[key];
}

var ansiHTML = __webpack_require__(783);
var colors = {
  reset: ['transparent', 'transparent'],
  black: '181818',
  red: 'E36049',
  green: 'B3CB74',
  yellow: 'FFD080',
  blue: '7CAFC2',
  magenta: '7FACCA',
  cyan: 'C3C2EF',
  lightgrey: 'EBE7E3',
  darkgrey: '6D7891'
};
ansiHTML.setColors(colors);

var Entities = __webpack_require__(795).AllHtmlEntities;
var entities = new Entities();

exports.showProblems =
function showProblems(type, lines) {
  clientOverlay.innerHTML = '';
  lines.forEach(function(msg) {
    msg = ansiHTML(entities.encode(msg));
    var div = document.createElement('div');
    div.style.marginBottom = '26px';
    div.innerHTML = problemType(type) + ' in ' + msg;
    clientOverlay.appendChild(div);
  });
  if (document.body) {
    document.body.appendChild(clientOverlay);
  }
};

exports.clear =
function clear() {
  if (document.body && clientOverlay.parentNode) {
    document.body.removeChild(clientOverlay);
  }
};

var problemColors = {
  errors: colors.red,
  warnings: colors.yellow
};

function problemType (type) {
  var color = problemColors[type] || colors.red;
  return (
    '<span style="background-color:#' + color + '; color:#fff; padding:2px 4px; border-radius: 2px">' +
      type.slice(0, -1).toUpperCase() +
    '</span>'
  );
}


/***/ }),
/* 1044 */
/***/ (function(module, exports, __webpack_require__) {

/**
 * Based heavily on https://github.com/webpack/webpack/blob/
 *  c0afdf9c6abc1dd70707c594e473802a566f7b6e/hot/only-dev-server.js
 * Original copyright Tobias Koppers @sokra (MIT license)
 */

/* global window __webpack_hash__ */

if (false) {
  throw new Error("[HMR] Hot Module Replacement is disabled.");
}

var hmrDocsUrl = "http://webpack.github.io/docs/hot-module-replacement-with-webpack.html"; // eslint-disable-line max-len

var lastHash;
var failureStatuses = { abort: 1, fail: 1 };
var applyOptions = { ignoreUnaccepted: true };

function upToDate(hash) {
  if (hash) lastHash = hash;
  return lastHash == __webpack_require__.h();
}

module.exports = function(hash, moduleMap, options) {
  var reload = options.reload;
  if (!upToDate(hash) && module.hot.status() == "idle") {
    if (options.log) console.log("[HMR] Checking for updates on the server...");
    check();
  }

  function check() {
    var cb = function(err, updatedModules) {
      if (err) return handleError(err);

      if(!updatedModules) {
        if (options.warn) {
          console.warn("[HMR] Cannot find update (Full reload needed)");
          console.warn("[HMR] (Probably because of restarting the server)");
        }
        performReload();
        return null;
      }

      var applyCallback = function(applyErr, renewedModules) {
        if (applyErr) return handleError(applyErr);

        if (!upToDate()) check();

        logUpdates(updatedModules, renewedModules);
      };

      var applyResult = module.hot.apply(applyOptions, applyCallback);
      // webpack 2 promise
      if (applyResult && applyResult.then) {
        // HotModuleReplacement.runtime.js refers to the result as `outdatedModules`
        applyResult.then(function(outdatedModules) {
          applyCallback(null, outdatedModules);
        });
        applyResult.catch(applyCallback);
      }

    };

    var result = module.hot.check(false, cb);
    // webpack 2 promise
    if (result && result.then) {
        result.then(function(updatedModules) {
            cb(null, updatedModules);
        });
        result.catch(cb);
    }
  }

  function logUpdates(updatedModules, renewedModules) {
    var unacceptedModules = updatedModules.filter(function(moduleId) {
      return renewedModules && renewedModules.indexOf(moduleId) < 0;
    });

    if(unacceptedModules.length > 0) {
      if (options.warn) {
        console.warn(
          "[HMR] The following modules couldn't be hot updated: " +
          "(Full reload needed)\n" +
          "This is usually because the modules which have changed " +
          "(and their parents) do not know how to hot reload themselves. " +
          "See " + hmrDocsUrl + " for more details."
        );
        unacceptedModules.forEach(function(moduleId) {
          console.warn("[HMR]  - " + moduleMap[moduleId]);
        });
      }
      performReload();
      return;
    }

    if (options.log) {
      if(!renewedModules || renewedModules.length === 0) {
        console.log("[HMR] Nothing hot updated.");
      } else {
        console.log("[HMR] Updated modules:");
        renewedModules.forEach(function(moduleId) {
          console.log("[HMR]  - " + moduleMap[moduleId]);
        });
      }

      if (upToDate()) {
        console.log("[HMR] App is up to date.");
      }
    }
  }

  function handleError(err) {
    if (module.hot.status() in failureStatuses) {
      if (options.warn) {
        console.warn("[HMR] Cannot check for update (Full reload needed)");
        console.warn("[HMR] " + err.stack || err.message);
      }
      performReload();
      return;
    }
    if (options.warn) {
      console.warn("[HMR] Update check failed: " + err.stack || err.message);
    }
  }

  function performReload() {
    if (reload) {
      if (options.warn) console.warn("[HMR] Reloading page");
      window.location.reload();
    }
  }
};


/***/ }),
/* 1045 */
/***/ (function(module, exports) {

module.exports = function(module) {
	if(!module.webpackPolyfill) {
		module.deprecate = function() {};
		module.paths = [];
		// module.parent = undefined by default
		if(!module.children) module.children = [];
		Object.defineProperty(module, "loaded", {
			enumerable: true,
			get: function() {
				return module.l;
			}
		});
		Object.defineProperty(module, "id", {
			enumerable: true,
			get: function() {
				return module.i;
			}
		});
		module.webpackPolyfill = 1;
	}
	return module;
};


/***/ }),
/* 1046 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(17);

/***/ }),
/* 1047 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(18);

/***/ }),
/* 1048 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(26);

/***/ }),
/* 1049 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(27);

/***/ }),
/* 1050 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(29);

/***/ }),
/* 1051 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(40);

/***/ }),
/* 1052 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(41);

/***/ }),
/* 1053 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(42);

/***/ }),
/* 1054 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(48);

/***/ }),
/* 1055 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(64);

/***/ }),
/* 1056 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(66);

/***/ }),
/* 1057 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(68);

/***/ }),
/* 1058 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(70);

/***/ }),
/* 1059 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(71);

/***/ }),
/* 1060 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(72);

/***/ }),
/* 1061 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(73);

/***/ }),
/* 1062 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(74);

/***/ }),
/* 1063 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(75);

/***/ }),
/* 1064 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(76);

/***/ }),
/* 1065 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(77);

/***/ }),
/* 1066 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(79);

/***/ }),
/* 1067 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(80);

/***/ }),
/* 1068 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(81);

/***/ }),
/* 1069 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(85);

/***/ }),
/* 1070 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = (__webpack_require__(4))(86);

/***/ }),
/* 1071 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(531);
__webpack_require__(530);
module.exports = __webpack_require__(529);


/***/ })
/******/ ]);
//# sourceMappingURL=main-client.js.map